OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]
  • To: "Jeni Tennison" <jeni@jenitennison.com>
  • Subject: RE: [xml-dev] JAXP's ID Transform failing to include namespace declaration attributes
  • From: "Evan Lenz" <elenz@xyzfind.com>
  • Date: Fri, 4 Jan 2002 12:29:04 -0800
  • Cc: <xml-dev@lists.xml.org>
  • Importance: Normal
  • In-reply-to: <16020606300.20020104201311@jenitennison.com>

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





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS