[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Children with the same name
Hi I'm stuck with an Xpath. How can I select child nodes with the same name? The names are arbitrary. So far I have this, which does not work: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <test> <xsl:apply-templates select="array/node()[name() = name(../node())]" /> </test> </xsl:template> <xsl:template match="node()"> <xsl:copy-of select="*" /> </xsl:template> </xsl:stylesheet> Input <array> <item/> <nope/> <item>4</item> <item>5</item> <wibble/> <item>six</item> <wibble>stuff</wibble> <item>item</item> <no/> </array> Desired output <array> <item>4</item> <item>5</item> <wibble/> <item>six</item> <wibble>stuff</wibble> <item>item</item> </array> Thanks -----Original Message----- From: Merrilees, David Sent: 18 October 2011 16:46 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: required parameter It returns <form id="fLanguage" action="/en-GB/Language/Set" method="post"></form> Thanks This is a confidential email. Tesco may monitor and record all emails. The views expressed in this email are those of the sender and not Tesco. Tesco Stores Limited Company Number: 519500 Registered in England Registered Office: Tesco House, Delamare Road, Cheshunt, Hertfordshire EN8 9SL VAT Registration Number: GB 220 4302 31
|
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
|