Subject: comparing attributes if missing at times
From: "Szabo, Patrick (LNG-VIE)" <patrick.szabo@xxxxxxxxxxxxx>
Date: Wed, 26 Mar 2014 12:41:43 +0000
|
Hi,
I'm observing a behaviour that seems weird to me but it might be correct
anyway.
If I compare values of attributes among sibling nodes then missing attributes
give me a little headache.
example:
<elem x="1"/>
<elem x="1"/>
<elem x="2"/>
<elem/>
<elem x="3"/>
If I group these elements into groups like this:
<xsl:for-each-group select="elem" group-starting-with="elem[@x !=
preceding-sibling::elem[1]/@x]">
....
Then the element with @x="2" and the element without the attribute will be in
the same group. So a the lack of the attribut is not interpreted as "having a
different value".
Is that normal ?
regards
. . . . . . . . . . . . . . . . . . . . . . . . . .
Ing. Patrick Szabo
Developer
LexisNexis
A-1030 Wien, Marxergasse 25
mailto:Patrick.Szabo@xxxxxxxxxxxxx
Tel.: +43 1 53452 1514
Fax.: +43 1 534 52 146
. . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . .
Ing. Patrick Szabo
Developer
LexisNexis
A-1030 Wien, Marxergasse 25
mailto:Patrick.Szabo@xxxxxxxxxxxxx
Tel.: +43 1 53452 1514
Fax.: +43 1 534 52 146
. . . . . . . . . . . . . . . . . . . . . . . . . .
|