[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Universally quantified test of child attribute pr
Abel,
you wrote: The expression: OK, so I could (as well) use this expression for the "negative case", or stick with the easiest understandable variant, like David suggested: not(every $child in * satisfies $child[@my_attribute]) The expression: Thank you very much for this hint - I actually need a test that returns true if all children carry the attribute AND if there are element children at all - maybe David's suggestion might help? (See below.) David, you wrote: > Personally I'd have probably written the "positive test" in negative > form, rather than saying every chiuld has teh attribute, say no child > doesn't have the attribute > not(*[not(@my_attribute)]) Not bad either. Could I even use this expression to return false when there are no element children at all? Or would I have to make this an additional condition?
Nice and neat.
Like I (partially) wrote, I prefer to leave the condition equalling this third case implied in my xsl:otherwise clause, while explicitly testing for the other two cases using xsl:when. I am grateful to both of you for your precise explanations. Yves P.S.: It seems that in XSLT just as well as in life, being negative often is much easier than being positive. :-)
|
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
|