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. 
http://example.org/bla/file.html-->
<variable name='this' >
    <choose>
        <when test="string-length($base)>0"><value-of 
select="$base"/></when>
        <otherwise><value-of select="$url"/></otherwise>
    </choose>
</variable>

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?

Cheers,

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

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:11:48 GMT