W3C home > Mailing lists > Public > public-grddl-wg@w3.org > April 2007

Re: issue-base-param

From: Fabien Gandon <Fabien.Gandon@sophia.inria.fr>
Date: Tue, 17 Apr 2007 14:03:03 +0200
Message-ID: <4624B777.7030902@sophia.inria.fr>
To: ogbujic@ccf.org
CC: GRDDL Working Group <public-grddl-wg@w3.org>

Chimezie Ogbuji a écrit :
> Yes, this is the problem. XPath doesn't cite XML Infoset *or* XML Base 
> and *doesn't* define any notion of a base URI for its nodes. The XML 
> infoset OTOH *does* define a [base URI] for its Element Information 
> Items.So, basicaly, the xml:base = 'http://www.example.org/' in the 
> concrete XML form is lost to the underlying XPath data model.
Apologies if the following question is not relevant to that point but I 
would like to make sure I am not missing something important here.

The RDFa2RDFXML transformation is in XSLT1.0 and XPath 1.0. Unless I 
missed something in the specs (which could be the case) there is no way 
for me to get the IRI of the source document in this transformation i.e. 
there is no get-base-uri() function available. Thus What I do now is this:

<!--get the base of the current XHTML page -->
<variable name='base' select="//*/@xml:base[position()=1]"/>

<!-- get the url of the current XHTML page if provided as a parameter to 
the XSLT engine -->
<param name='url' select=""/>

<!-- set the variable to contain the URL of the source document whether 
it was provided by the base or as a parameter e.g. 
<variable name='this' >
        <when test="string-length($base)>0"><value-of 
        <otherwise><value-of select="$url"/></otherwise>

Is there a better way to get and use the source IRI in a transformation?
Also, it seemed to me, reading your message, that the base may change 
for different nodes in the same document. Is that right? Is it only for 
external entities or can several xml:base be specified in the document?


Fabien - http://www.inria.fr/acacia/fabien/
Received on Tuesday, 17 April 2007 12:06:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:52:37 UTC