[xsl] Universally quantified test of child attribute presence/absence
Subject: [xsl] Universally quantified test of child attribute presence/absence
From: Yves Forkl <Y.Forkl@xxxxxx>
Date: Tue, 20 Mar 2007 12:56:59 +0100
|
When processing some element in XSLT 2, I need to make sure whether all
of its element children carry a specific attribute or if they don't. A
mixed situation is to be considered as a fatal error, caught in an
xsl:otherwise clause.
While the expression for the positive test obviously is
every $child in * satisfies $child/@my_attribute
I am unsure about the correct form of the negated expression to mandate
that no child may have that attribute. Which variant can or must be
used, and why?
every $child in * satisfies $child[not(@my_attribute)]
every $child in * satisfies not($child/@my_attribute)
not(every $child in * satisfies $child/@my_attribute)
Yves