xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] A different question about xml:base
- From: Sandy Mustard <Sandy.Mustard AT ugsplm.com>
- To: xom-interest <xom-interest AT lists.ibiblio.org>
- Subject: Re: [XOM-interest] A different question about xml:base
- Date: Wed, 07 Apr 2004 16:13:04 -0400
Forgive my ignorance of BaseURIs but is this possible?
<element xml:base="">abc</element>
If so, then shouldn't getBaseURI() return "" and in the following case
<element>abc</element>
getBaseURI() return NULL?
Sandy Mustard
Elliotte Harold wrote:
A recent erratum to the XML Base spec states:
The base URI of an element bearing an |xml:base| attribute with a value that is not a valid URI reference is application dependent.
In this context, XOM is an application, and can do whatever it wants to in this case.
The question is what it should do. For example, consider this document:
<element xml:base="http://www.example.com/test/%GF.html"/>
What is the base URI of the element? Here are the possibilities I've thought of:
1. Return null (what XOM is doing now)
2. Return the value of the xml:base attribute untouched and unresolved.
3. Return the empty string
Any other ideas?
Related question:
Element root = new Element("root");
Document doc = new Document(root);
What should doc.getBaseURI() and root.getBaseURI() return? Currently null is being returned. However
according to RFC 2396:
A URI reference that does not contain a URI is a reference to the
current document. In other words, an empty URI reference within a
document is interpreted as a reference to the start of that document,
and a reference containing only a fragment identifier is a reference
to the identified fragment of that document.
Thus perhaps it makes sense here to return the empty string here instead of null? That would also avoid some possible unexpected NullPointerExceptions if a client forgot to do a null check.
--
Elliotte Rusty Harold
_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest
-
[XOM-interest] A different question about xml:base,
Elliotte Harold, 04/05/2004
-
Re: [XOM-interest] A different question about xml:base,
Sandy Mustard, 04/07/2004
- Re: [XOM-interest] A different question about xml:base, Elliotte Rusty Harold, 04/07/2004
- <Possible follow-up(s)>
- RE: [XOM-interest] A different question about xml:base, Brendan . Johnston, 04/14/2004
-
Re: [XOM-interest] A different question about xml:base,
Sandy Mustard, 04/07/2004
Archive powered by MHonArc 2.6.24.