[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Transforming xml with any namespace
Hi, I would like extract name=value for a specific element,for any namespace. How can I make this code work properly? Thanks for any ideas! XSL: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="text" /> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="//*[local-name()='Type1']"> <xsl:value-of select="local-name(.)"/> <xsl:text disable-output-escaping="yes">=</xsl:text> <xsl:value-of select="."/> </xsl:template> </xsl:stylesheet> XML: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="http://something"?><ns0:orderReq xmlns:ns0="http://somethingelse"> <ns1:order xmlns:ns1="http://nothing"> <ns1:orderItems> <ns1:orderItem> <ns1:Type1>value1</ns1:Type1> <ns1:Type1>value2</ns1:Type1> <ns1:Type2>please dont print me</ns1:Type2> </ns1:orderItem> </ns1:orderItems> </ns1:order> </ns0:orderReq> OUTPUT: Type1=value1 Type1=value2 please dont print me DESIRED OUTPUT: Type1=value1 Type2=value2 _________________________________________________________________ Keep your friends updatedeven when youre not signed in. http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/soci al-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_5:092010
|
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
|