[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: removing nesting in data structure
Andrew Welch wrote: > Ive found a problem already... for some reason it applies subpara3 > twice. Why is this? <xsl:apply-templates select="*[not(subpara1)][not(subpara2)][not(subpara3)]"/> In English, you're saying "Of all the element node children of the current node, I want just those that do not have subpara1 children..." and so on. You wanted something more like *[not(local-name()='subpara1' or local-name()='subpara2')] or *[not(starts-with(local-name(),'subpara')] I posted a better example where you just go ahead and select all children for processing, and have templates matching the ones you expect to encounter. Also, I question the wisdom of having distinct element types 'subpara1', 'subpara2', 'subpara3', when you could just have nested 'subpara' elements, eliminating the need for numbering. Even then, if the content model of subpara is (para,subpara?), then I'd be inclined to change the names to something like paragroup & paracontent or something less confusing. ;) - Mike ____________________________________________________________________________ mike j. brown | xml/xslt: http://skew.org/xml/ denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|