W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2009

Re: Bug with p:add-xml-base?

From: Jeni Tennison <jeni@jenitennison.com>
Date: Sat, 6 Jun 2009 20:37:31 +0100
Cc: "'xproc-dev@w3.org'" <xproc-dev@w3.org>
Message-Id: <0C5D18E4-C19E-44E1-9A4E-9835CB737034@jenitennison.com>
To: "Costello, Roger L." <costello@mitre.org>
Roger,

The base URI of a document is its full location (unless you override  
it with xml:base). Other URIs are resolved relative to this base URI  
using the rules in RFC 3986 [1], which basically strip off the final  
component (the filename) before appending a new relative URI, in order  
to create a new URI. So with a base URI of:

   file:/C:/xproc/example/BookStore.xml

and a relative URI of:

   siddhartha/Siddhartha.xml

the resolved URI is:

   file:/C:/xproc/example/siddhartha/Siddhartha.xml

Cheers,

Jeni

[1]: http://tools.ietf.org/html/rfc3986

On 6 Jun 2009, at 16:47, Costello, Roger L. wrote:

>
> Hi Folks,
>
> I have a simple pipeline that uses p:add-xml-base:
>
> -----------------------------------------------------
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
>
>    <p:input port="source">
>        <p:document href="BookStore.xml"/>
>    </p:input>
>
>    <p:output port="result">
>        <p:pipe step="store" port="result"/>
>    </p:output>
>
>    <p:add-xml-base />
>
>    <p:store href="result.xml" name="store"/>
>
> </p:declare-step>
> -----------------------------------------------------
>
>
> The file that is stored, result.xml, is the BookStore with xml:base  
> added to the root element:
>
> <BookStore xml:base="file:/C:/xproc/example/BookStore.xml">
>    ...
> </BookStore>
>
>
> Is that value for xml:base correct? It doesn't seem correct.
>
> I think it should be:
>
>   file:/C:/xproc/example/
>
>
> If the xml:base is:
>
>   file:/C:/xproc/example/BookStore.xml
>
> then I can't see how p:xinclude could work.
>
> That is, if I put this include statement in BookStore.xml:
>
>    <xi:include href="siddhartha/Siddhartha.xml" />
>
> The absolute URL is the value of xml:base plus the relative URL:
>
>    file:/C:/xproc/example/BookStore.xml/siddhartha/Siddhartha.xml
>
> which is clearly wrong (and which explains why I get an error  
> whenever I use p:xinclude)
>
> What am I missing?
>
> /Roger
>

-- 
Jeni Tennison
http://www.jenitennison.com
Received on Saturday, 6 June 2009 19:38:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 6 June 2009 19:38:04 GMT