W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > April 2008

Changing base URIs

From: Norman Walsh <ndw@nwalsh.com>
Date: Thu, 03 Apr 2008 10:34:53 -0400
To: public-xml-processing-model-wg@w3.org
Message-ID: <m27iffgg6q.fsf@nwalsh.com>
I think the problem that Toman raises in message #83 is significant.
Although many of the particular cases can be worked out with XPath 2.0
and with XSLT, I wonder if we should consider a new atomic step,

<p:declare-step type="p:set-base-uri">
  <p:input port="source"/>
  <p:output port="result"/>
  <p:option name="base-uri"/>  

Where we define base-uri, like replace in p:string-match, as an XPath

The result of this step is a new document, identical to the source,
except that it has a new base URI.

The 'base-uri' expression is evaluated *by the step*. I think we have
a step that sets a variable binding automatically (though I can't find
that in the current draft???), so we could say that $p:current-base-uri
is set to the base URI of the source document. This gives XPath 1.0
implementations a mechansim for writing things like this:

  <p:set-base-uri base-uri="concat(substring-before($p:current-base-uri,'.xml'),'-processed.xml')"/>

                                        Be seeing you,

Norman Walsh <ndw@nwalsh.com> | It costs a great deal to be reasonable;
http://nwalsh.com/            | it costs youth.--Madame de la Fayette

Received on Thursday, 3 April 2008 14:35:37 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:32:45 UTC