Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Non NCName IDs

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Daniel Veillard <veillard AT redhat.com>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>, Wolfgang Hoschek <whoschek AT lbl.gov>, public-xml-id AT w3.org
  • Subject: Re: [XOM-interest] Non NCName IDs
  • Date: Mon, 20 Mar 2006 11:06:38 -0500

On Mon, Mar 20, 2006 at 10:45:58AM -0500, Elliotte Harold wrote:
>
> Wolfgang Hoschek pointed out an inconsistency in how XOM tests xml:id
> values which I've now traced to an apparent discrepancy between the
> current xml:id test suite and the xml:id spec, and I was hoping somebody
> could explain this to me.
>
> Section 4 of xml:id states:
>
> An xml:id processor must assure that the following constraints hold for
> all xml:id attributes:
>
> * The normalized value of the attribute is an NCName according to
> the Namespaces in XML Recommendation which has the same version as the
> document in which this attribute occurs (NCName for XML 1.0, or NCName
> for XML 1.1).
>
> However the very first test case normal_001 uses a non-NCName and
> apparently expects this test to pass:
>
> <doc>
> <para xml:id=" te st ">MATCH</para>
> </doc>


xmllint raises an error about it:

paphio:~/XML -> xmllint --noout id_err3.xml
id_err3.xml:2: validity error : xml:id : attribute value te st is not an
NCName
<para xml:id=" te st ">MATCH</para>
^
paphio:~/XML ->

> However a probably older version of the catalog I find laying around on
> my hard drive lists this as an error condition. i.e. the value of the
> operation attribute of the scenario element is error, not standard.

that's my recollection too.

> Can anyone shed some light on this? What is supposed to happen here? Is
> the test suite wrong or the spec? Or are they consistent in a way I'm
> not seeing?

I tend to think that's an error. Moreover libxml2 does not register an
ID in that case, XPath can't find one.

Daniel

--
Daniel Veillard | Red Hat http://redhat.com/
veillard AT redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




Archive powered by MHonArc 2.6.24.

Top of Page