xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: "Michael Kay" <mike AT saxonica.com>
- To: <xom-interest AT lists.ibiblio.org>
- Subject: [XOM-interest] Relative namespace URIs
- Date: Sat, 2 Oct 2004 15:58:14 +0100
As far as I can tell, XOM is rejecting source documents that use namespace
names where the namespace name is not a valid absolute URI.
Assuming I'm right, I can't see the justification for this.
The "Namespaces in XML" specification [1] (usually called Namespaces 1.0,
though the spec itself seems to carry no version number) does not impose any
such rule. It states:
"An XML namespace is a collection of names, identified by a URI reference
[RFC2396]": this allows both absolute and relative URIs. Section 6 of the
specification (Conformance) is even more liberal: an XML document conforms
to the specification even if the string used as a namespace name is not a
URI reference at all, let alone an absolute URI.
There is an erratum, NE04, that states that the use of relative URIs in
namespace declarations is deprecated. However, this is a statement of future
intent, and does not alter the conformance rules: documents using relative
URIs as namespace names are still namespace-well-formed.
The Namespaces 1.1 specification has not materially altered this. Although
the specification goes to great lengths to say that IRIs rather than URIs
are now permitted as namespace names, it still states only that relative
IRIs are deprecated, it does not say they are disallowed; and it still
declines to say in its conformance section (7) that a document using an
invalid IRI in a namespace name is non-conformant.
(This is not an oversight. In comments during the CR phrase, I pressed the
WG to make such a statement if this was what they intended, and they
declined to do so. Instead, and somewhat confusingly, they added a statement
to section 8, that conforming processors are not required to check that
namespace names are legal IRIs. One could read this as implying that
conforming processors are allowed to make such a check, but in my view that
would be a misreading. Strangely, the specification does seem to allow a
conformant processor to reject a conformant document; but it's hard to
imagine that that was intended.)
Getting down to practicalities, I have hundreds of documents in a test suite
that use relative URIs as namespace names, and I can't use XOM on these
documents. I suspect they were automatically generated; they certainly
predate W3C's decision to deprecate relative namespace URIs. With
considerable effort I could convert the documents to use absolute URIs, but
this would invalidate my reference results for the tests.
I believe the only reasonable interpretation of the specs is to allow any
character string to be used as a namespace name.
Michael Kay
http://www.saxonica.com/
[1] http://www.w3.org/TR/REC-xml-names/
[2] http://www.w3.org/TR/xml-names11/
-
[XOM-interest] Relative namespace URIs,
Michael Kay, 10/02/2004
-
Re: [XOM-interest] Relative namespace URIs,
Elliotte Harold, 10/02/2004
- RE: [XOM-interest] Relative namespace URIs, Michael Kay, 10/02/2004
-
Re: [XOM-interest] Relative namespace URIs,
Elliotte Harold, 10/02/2004
-
RE: [XOM-interest] Relative namespace URIs,
Michael Kay, 10/02/2004
- Re: [XOM-interest] Relative namespace URIs, Elliotte Harold, 10/03/2004
- Re: [XOM-interest] Relative namespace URIs, Elliotte Harold, 10/03/2004
-
RE: [XOM-interest] Relative namespace URIs,
Michael Kay, 10/02/2004
-
Re: [XOM-interest] Relative namespace URIs,
Elliotte Harold, 10/02/2004
Archive powered by MHonArc 2.6.24.