[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Renaming One Element in a XML document using XSL

Subject: Renaming One Element in a XML document using XSL
From: "Sian Mace" <sianmace@xxxxxxxxxxx>
Date: Wed, 02 Feb 2005 14:02:22 +0000
.net rename xml element
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.