- From: Harry Halpin <hhalpin@ibiblio.org>
- Date: Tue, 29 Aug 2006 17:45:00 +0100
- Cc: public-grddl-wg <public-grddl-wg@w3.org>
Chimezie Ogbuji wrote:wrote: >> That just says "Every node also has an associated URI called its >> base URI" but it doesn't tell me how to get at the dang thing. >> What a tease. ;-) > > Well, it does actually. It says 'the base URI of the document node is > the URI of the document entity'. XPath 2.0 does indeed have a function for retrieving the base-URI, it's fn:base-uri()[1]. There's also in the same doc fn:document-uri() and fn:static-base-uri(). However, since XSLT implementations are still working up to full XPath 2.0 support, one could say: "If the base URI is given using XPath 2.0's fn:base-uri(), then that should be the base URI. If the base URI is embedded in the document content using other methods, the details are implementation dependent." I'm a bit nervous about that though - since i.e. the only language the WG seems to agree we should support is XSLT 1.0, where we're basically saying that rather important detail is implementation dependent. Although, it appears most implementations (including Saxon[2], although not libxslt as far as I can tell). So, we'd be recommending using XPath 2.0, which we haven't committed to saying GRDDL processors should support. Second, as for Chime's point that the xml:base spec says this may all be a non-issue, since according to xml:base[3]: 1. The base URI is embedded in the document's content. 2. The base URI is that of the encapsulating entity (message, document, or none). 3. The base URI is the URI used to retrieve the entity. 4. The base URI is defined by the context of the application. Therefore, we should use the name (rules 2 or 3) before even worrying about fn:base-uri() or some extension function (rule 4). Then, the question is - do we legislate in our spec that this should be the case, and that we should use the base-URI of the entity or the URI to retrieve the entity before using fn:base-uri() or an extension function? If this was indeed the case, it seems the chances of a base-uri function being used by XSLT would be very low, since most apps can get the base URI of the entity/URI to retrieve the entity. This would allow us to completely escape the base-uri issue in XSLT 1.0 by just ferring to rules 1.,2., and 3. Yet I get a red-flag since that seems very application dependent, and so it might hurt the compatibility of GRDDL processors. There also seems to be some use-cases when following the xml:base rules are a bad idea [4]. [1] http://www.w3.org/TR/xquery-operators/#func-base-uri [2] http://www.stylusstudio.com/xsllist/200112/post40430.html [3] http://www.w3.org/TR/xmlbase/ [4] http://sources.redhat.com/ml/docbook/2003-03/msg00132.html > >> If the source document explicitly gives its own base (using xml:base >> or <base href="...">) then life is simple. But what about documents >> that don't? How are GRDDL transformations written in XSLT to deal >> with relative URI references in such documents, if not with >> a base/Source parameter? > > Following the rules for determining a base URI, I would think the > GRDDL transformations should use the URI of the source document first > *before* having one specified within the XSLT. [1]http://www.w3.org/TR/xquery-operators/#func-base-uri -- -harry Harry Halpin, University of Edinburgh http://www.ibiblio.org/hhalpin 6B522426
Received on Tuesday, 29 August 2006 16:45:18 UTC