Re: [xsl] Universally quantified test of child attribute presence/absence

Subject: Re: [xsl] Universally quantified test of child attribute presence/absence
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Tue, 20 Mar 2007 13:30:38 +0100
Abel Braaksma wrote:

every $child in * satisfies $child[not(@my_attribute)]

will return true if no child has a @my_attribute that returns false. I.e., if the value were empty, but available, it would return false.

I have to correct myself here. You test for the node, not for the value of the node. It will return false in all situations, except when @my_attribute is not there for any of the $child.




every $child in * satisfies not($child/@my_attribute)

will return true if no child has a sequence of nodes @my_attribute (alsways one or zero attribute nodes) that when normalized returns false. That is in this scenario effectively the same as above, I believe.

same here. Again, you test the node, not the value. I.e.:


<child my_attribute="" />
<child my_attribute="" />
<child my_attribute="" />

will return false for the above test.
And the following:

<child attribute="" />
<child attribute="" />
<child attribute="" />

will return true for the above test.
And the following will return false again:

<child my_attribute="" />
<child attribute="" />
<child attribute="" />



Sorry for the confusion.

Cheers,
-- Abel

Current Thread