Problem in manipulating XML data with XSLT

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi All ,
I am trying to convert an XML with the XSLT . But while iterating the XML file using the <xsl:foreach> tag I am facing the problem and the iteration is not working. I am giving my sample XML and the XSLT .Please provide some solution.

My Sample XML is like this which is saved in a XML file.
<BPAddresses><br/>
<row><br/>
<AddressName>Utpal Maity</AddressName><br/>
<Street>street 1</Street><br/>
<Block>street2</Block><br/>
<ZipCode>435453</ZipCode><br/>
<City>Kolkata</City><br/>
<Country>US</Country><br/>
<AddressType>bo_BillTo</AddressType><br/>
<BPCode>W02</BPCode><br/>
<U_WBCUSTADDID>1</U_WBCUSTADDID><br/>
</row><br/>
<row><br/>
<AddressName>Utpal Maity</AddressName><br/>
<Street>street 1</Street><br/>
<Block>street2</Block><br/>
<ZipCode>435453</ZipCode><br/>
<City>Kolkata</City><br/>
<Country>US</Country><br/>
<AddressType>bo_ShipTo</AddressType><br/>
<BPCode>W02</BPCode><br/>
<U_WBCUSTADDID>1</U_WBCUSTADDID><br/>
</row><br/>
</BPAddresses>

And my sample XSLT file is
<pre style="font-family:consolas <span style="color:blue <?<span style="color:#a31515 xml<span style="color:blue <span style="color:red version<span style="color:blue ="<span style="color:blue 1.0"<span style="color:blue <span style="color:red encoding<span style="color:blue ="<span style="color:blue utf-8"<span style="color:blue ?><br/><span style="color:blue <<span style="color:#2b91af xsl:transform<span style="color:blue <span style="color:red version<span style="color:blue ="<span style="color:blue 1.0"<span style="color:blue <span style="color:red xmlns:xsl<span style="color:blue ="<span style="color:blue http://www.w3.org/1999/XSL/Transform"<span style="color:blue <span style="color:red exclude-result-prefixes<span style="color:blue ="<span style="color:blue xsl"<br/><span style="color:blue <span style="color:red xmlns:env<span style="color:blue ="<span style="color:blue http://www.w3.org/2003/05/soap-envelope"<br/><span style="color:blue <<span style="color:#2b91af xsl:output<span style="color:blue <span style="color:red method<span style="color:blue ="<span style="color:blue xml"<span style="color:blue <span style="color:red indent<span style="color:blue ="<span style="color:blue yes"<span style="color:blue /><br/> <br/><span style="color:blue <<span style="color:#2b91af xsl:template<span style="color:blue <span style="color:red match<span style="color:blue ="<span style="color:blue /"<span style="color:blue ><br/><span style="color:blue <<span style="color:#2b91af xsl:variable<span style="color:blue <span style="color:red name<span style="color:blue ="<span style="color:blue custdetails"<span style="color:blue <span style="color:red select<span style="color:blue ="<span style="color:blue document(Customer.xml)/node()[1]/node()[2]"<span style="color:blue /><br/><span style="color:blue <<span style="color:#2b91af xsl:for-each<span style="color:blue <span style="color:red select<span style="color:blue ="<span style="color:blue $custdetails/row"<span style="color:blue ><span style="color:blue <br/><span style="color:blue </<span style="color:#2b91af xsl:for-each<span style="color:blue ><br/><span style="color:blue </<span style="color:#2b91af xsl:template<span style="color:blue ><br/><span style="color:blue </<span style="color:#2b91af xsl:transform<span style="color:blue >[/code]
Please help.

<br/>

View the full article
 
Back
Top