[Home] [By Thread] [By Date] [Recent Entries]

  • To: "Jeni Tennison" <jeni@j...>
  • Subject: RE: JAXP's ID Transform failing to include namespace declaration attributes
  • From: "Evan Lenz" <elenz@x...>
  • Date: Fri, 4 Jan 2002 12:29:04 -0800
  • Cc: <xml-dev@l...>
  • Importance: Normal
  • In-reply-to: <16020606300.20020104201311@j...>

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


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member