2 Dec 2005 16:14
Comparing XML, xsl:normalize-space and schemaTron
Fraser Goffin <goffinf <at> hotmail.com>
2005-12-02 15:14:09 GMT
2005-12-02 15:14:09 GMT
Slightly confused about using normalize-space.
If I have the following XML instance document (notice the spaces) :-
<compare>
<compareWith> A</compareWith>
<comparisonValues>
<value>B</value>
<value> A </value>
<value>A </value>
</comparisonValues>
</compare>
and I use this expression :-
normalize-space(/compare/comparisonValues/value[3]) =
normalize-space(/compare/compareWith)
the result is true.
If I remove [3] it is an error ('too many items')
if I remove normalize-space and [3] from the LHS, the result is false.
and if I remove spaces from the final comparisonValues/value in the XML, the
result is true
This seems OK (although it would be nice if I *could* use normalize-space on
all of the nodes returned)
(Continue reading)
RSS Feed