[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Renaming One Element in a XML document using XSL


Subject: [xsl] Renaming One Element in a XML document using XSL
From: "Sian Mace" <sianmace@xxxxxxxxxxx>
Date: Wed, 02 Feb 2005 14:02:22 +0000

HI,



I am using Amazon web services and asp.net for a university project.



Im getting the xml back from the web service, but when trying to load in to
asp.net dataset I get problems because Microsoft cannot support XML fully
yet.



This is because the xml returned has element names the same in different
places.



What I need to do is to get the whole dataset, which is quite massive, and
just rename the rogue elements to something to make them unique.



Here are the code and examples of what I want.



<ItemSearchResponse>

<OperationRequest>

<HTTPHeaders>

<Header ></Header>

</HTTPHeaders>

<RequestId>187MFFZ905VXM20D1H6J</RequestId>

<Arguments>

                                    <Argument Name="Service"
Value="AWSECommerceService"></Argument>

</Arguments>


<RequestProcessingTime>0.546659946</RequestProcessingTime>


</OperationRequest>

<Items>

<Request>

<IsValid>True</IsValid>

<ItemSearchRequest>

                                                <Power>title:Harry
Potter</Power>

<ResponseGroup>Large</ResponseGroup>


<SearchIndex>Books</SearchIndex>


<Sort>salesrank</Sort>

</ItemSearchRequest>

</Request>

<TotalResults>717</TotalResults>

<TotalPages>72</TotalPages>

<Item>

<ASIN>0747581088</ASIN>

<DetailPageURL> </DetailPageURL>

<SalesRank>1</SalesRank>

<SmallImage>


<URL>http://images.amazon.com/images/P/0747581088.02._SCTHUMBZZZ_.jpg</URL>


<Height>75</Height>

<Width>53</Width>

</SmallImage>

<MediumImage>


<URL>http://images.amazon.com/images/P/0747581088.02._SCMZZZZZZZ_.jpg</URL>


<Height>160</Height>

<Width>113</Width>

</MediumImage>

<LargeImage>


<URL>http://images.amazon.com/images/P/0747581088.02._SCLZZZZZZZ_.jpg</URL>


<Height>500</Height>

<Width>352</Width>

</LargeImage>

</Item>

</Items>

</ItemSearchResponse>



There is the a Height element (and width) in SmallImage, LargeImage and
Medium Image, And .Net Datasets cannot deal with this.

So I need to convert this to something like SmallHeight, MediumHeight ect.



So I want to copy all the document and rename certain nodes.  How can I do
this??



Any help would be greatly appreciated


Current Thread
Keywords
xml