[xsl] Move one node in xml down one level

Subject: [xsl] Move one node in xml down one level
From: "SianMace" <sianmace@xxxxxxxxxxx>
Date: Mon, 7 Feb 2005 14:50:53 -0000
Hi,

I would like to Move one element down a level, and removing it from its
original location, and making another copy further down.

Heres what i have

XML
<ItemSearchResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
 <OperationRequest
xmlns="http://webservices.amazon.com/AWSECommerceService/2005-01-19";>
  <Items
xmlns="http://webservices.amazon.com/AWSECommerceService/2005-01-19";>
   <Item>
    <ASIN>0747581088</ASIN>
     <ItemAttributes>
      <Author>J.K. Rowling</Author>
     </ItemAttributes>
   </Item>
.....


Here is what i would like
................ (the same beginning)
<item>
<itemAttributes>
<asin></asin>
.....

Right so here is as far as i have got.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:amazon="http://webservices.amazon.com/AWSECommerceService/2005-01-
19"
    xmlns="http://webservices.amazon.com/AWSECommerceService/2005-01-19";>
    
    <xsl:namespace-alias stylesheet-prefix="amazon"
result-prefix="#default"/>
 
   <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template
match="/ItemSearchResponse/amazon:Items/amazon:Item/amazon:ItemAttributes">
    <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        <asin><xsl:value-of select="parent::amazon:ASIN"/></asin>
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>

so i have all the other elements, and i have entered the item attributes
node, and im trying to copy an element from above.

once i have done this, i need to delete the original from the above node.

please help me im stuck

Current Thread