[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Find node with no child text() nodes
Karl Stubsjoen wrote: > Need help with XSLT 1.0 template please. How do you match on block_x > when no descendant text() nodes exist? Note: there is no predictive > knowledge of the depth of block within block_x. In sample below, > block_x id 2 should match. Like: > <blocks> > <block_x id="1"> > <block/> > <block/> > <block>asdf</block> > </block_x> > <block_x id="2"> > <block/> > <block> > <sub_block/> > </block> > </block_x> > </blocks> Your description is not very clear. do you just want a block_x with id=2? Or does the fact that is has no descendent text() play a role in the selection? If only id=2 is important it would be: <xsl:template match="//block_x[id='2']"> -- Piet van Oostrum Utrecht, NL. URL: http://pietvanoostrum.com/
|
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
|