Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: XSL select only nodes which contain a specific child node XSL select only nodes which contain a specific child nodeTo: NULL Date: 7/8/2009 7:31:00 AM Given the following extremely simplified XML... <AA> <BB></BB> <BB><CC>foo</CC></BB> <BB></BB> <BB><CC>bar</CC></BB> </AA> ...is there an easy way to use and XSL select to get only the <BB> nodes which have a <CC> child node? <xsl:for-each select="AA/BB"> Gives me 4 nodes: <BB></BB> <BB><CC>foo</CC></BB> <BB></BB> <BB><CC>bar</CC></BB> <xsl:for-each select="AA/BB/CC"> Gives me 2 nodes, but it's at the CC level and I need it to be at the BB level because there's a bunch of other nodes there that need to be processed as well. <CC>foo</CC> <CC>bar</CC> I'm thinking that there must be some sort of conditional select XPATH that will get me what I need: <BB><CC>foo</CC></BB> <BB><CC>bar</CC></BB> Any tips? | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
