RE: [xml-dev] JAXP's ID Transform failing to include namespace declaration attributes

From
Evan Lenz <>
To
Jeni Tennison <>
Date
2002-01-04T20:29:04Z
ID
<>
Thread
RE: [xml-dev] JAXP's ID Transform failing to include namespace declaration attributes
Jeni Tennison wrote:
> I take your other point about what happens if the attribute is false
> ID attribute. But id() only returns more than one node if the
> attribute has whitespace in the value, which can't happen if it's an
> ID attribute anyway, and you could (and should, I think) test for this
> separately. The expressions above are even more likely to give you
> false positives than the expression I suggested. I think you should
> use:
>
>   not(contains(., ' ')) and count(..|id(.)) = 1
>
> instead. Although, as you say, that doesn't solve the other source of
> false positives. If you were prepared to have false negatives, you
> could supplement the above with the test:
>
>   not(../@*[. = current()][2])
>
> which returns true if no other attributes have the same value as this
> one, but I admit it's not perfect.

All good points. Thanks, Jeni, for helping me perfectly refine this broken
solution ;-)

Evan