Skip to Content.
Sympa Menu

xom-interest - RE: [XOM-interest] Relative namespace URIs

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Michael Kay" <mike AT saxonica.com>
  • To: "'Elliotte Harold'" <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: RE: [XOM-interest] Relative namespace URIs
  • Date: Sat, 2 Oct 2004 22:39:06 +0100

The XPath 2.0 data model isn't defined in terms of the infoset. It defines a
mapping to the infoset, but that mapping doesn't impose any constraints:

http://www.w3.org/TR/xpath-datamodel/#const-other

The XPath data model doesn't place any constraints on the value of a
namespace URI, other than the constraint that the name of a node must be a
QName, where QName is as defined in XML Schema. The XML Schema definition of
QName is that the namespace part must be an instance of xs:anyURI, and the
definition of xs:anyURI contains the notorious provision:

"Because it is impractical for processors to check that a value is a
context-appropriate URI reference, this specification follows the lead of
[RFC 2396] (as amended by [RFC 2732]) in this matter: such rules and
restrictions are not part of type validity and are not checked by .minimally
conforming. processors. Thus in practice the above definition imposes only
very modest obligations on .minimally conforming. processors"

(It's not clear what the "very modest obligations" are; but certainly
xs:anyURI allows relative URIs.)

As for Saxon, this is all academic. Saxon accepts whatever the XML parser
throws at it, whether via SAX, DOM, XOM, or whatever.

When namespaces are constructed dynamically, as in <xsl:element
namespace="{$x}">, XSLT 2.0 says "The effective value SHOULD be a URI
reference. It is not an error if the string is not a syntactically legal URI
reference." This attempts to reflect what the Namespaces Rec says. It also
has to be that way for compatibility with XSLT 1.0 (which contained the
second sentence quoted, but not the first).

As a matter of interest, does XOM accept unescaped URIs (wannabe-URIs,
strings that would be URIs if escaped) as namespace names? The XML Schema
definition of a QName does.

Michael Kay

> -----Original Message-----
> From: Elliotte Harold [mailto:elharo AT metalab.unc.edu]
> Sent: 02 October 2004 21:23
> To: Michael Kay
> Cc: xom-interest AT lists.ibiblio.org
> Subject: Re: [XOM-interest] Relative namespace URIs
>
> How does XSLT 2 (and Saxon 8) handle this? The XPath 2.0 Data
> Model is
> defined in terms of the Infoset, and a document that uses relative
> namespace URIs has no infoset. Is this an area in which XSLT
> 2 and XSLT
> 1 (and XPath 2.0 and XPath 1.0) are incompatible?
>
>
> --
> Elliotte Rusty Harold
> elharo AT metalab.unc.edu
>





Archive powered by MHonArc 2.6.24.

Top of Page