[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: More on my problem with namespaces
Martin Honnen wrote:
I am not sure you will achieve your aim of having the namespace declared on each calypso:value element but fix the other problem first. As for your stated output, the following achieves that: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:calypso="http://www.calypso.com/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <bonds> <xsl:for-each select="//isin"> <bond> <calypso:secCode> <calypso:name>ISIN</calypso:name> <calypso:value xmlns:ns3="http://www.w3.org/2001/XMLSchema" xsi:type="ns3:string"> <xsl:value-of select="."/> </calypso:value> </calypso:secCode> </bond> </xsl:for-each> </bonds> </xsl:template> </xsl:stylesheet> Of course the above is only necessary if you want the xmlns:ns3 declaration on each calypso:value element, it should suffice to put it on the xsl:stylesheet element but your earlier posts seemed to say you want to ensure the declaration is present on the value element itself. -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|