- From: Romain Deltour <rdeltour@gmail.com>
- Date: Fri, 7 Feb 2014 09:55:01 +0100
- To: "Toman, Vojtech" <vojtech.toman@emc.com>
- Cc: "public-xml-processing-model-wg@w3.org" <public-xml-processing-model-wg@w3.org>, "xproc-dev@w3.org" <xproc-dev@w3.org>
Good question. My expectation would be that setting the doc’s base URI amends the base URI of all its nodes (elements and all), unless when they are explicitly overridden (with xml:base attributes). In other words: 1. your test would not produce the same result. The second pipeline would return: <c:base-uri>http://example.com/</c:base-uri> 2. but <p:identity> <p:input port=“source"> <p:inline><doc xml:base=“http://example.org/“/></p:inline> </p:input> </p:identity> <pxp:set-base-uri uri="http://example.com/"/> <p:template> <p:input port="template"> <p:inline><c:base-uri>{base-uri(/*)}</c:base-uri></p:inline> </p:input> <p:input port="parameters"> <p:empty/> </p:input> </p:template> would return: <c:base-uri>http://example.org/</c:base-uri> Romain. On 7 févr. 2014, at 09:22, Toman, Vojtech <vojtech.toman@emc.com> wrote: > What is the effect on the base URI of the nodes within the document? > > Do: > > <p:load href=""/> > <p:template> > <p:input port="template"> > <p:inline><c:base-uri>{base-uri(/*)}</c:base-uri></p:inline> > </p:input> > <p:input port="parameters"> > <p:empty/> > </p:input> > </p:template> > > and: > > <p:load href=""/> > <pxp:set-base-uri uri="http://example.com/"/> > <p:template> > <p:input port="template"> > <p:inline><c:base-uri>{base-uri(/*)}</c:base-uri></p:inline> > </p:input> > <p:input port="parameters"> > <p:empty/> > </p:input> > </p:template> > > produce the same result? > > Regards, > Vojtech > > -- > Vojtech Toman > Consultant Software Engineer > EMC | Information Intelligence Group > vojtech.toman@emc.com > http://developer.emc.com/xmltech > > >> -----Original Message----- >> From: Norman Walsh [mailto:ndw@nwalsh.com] >> Sent: Thursday, February 06, 2014 11:01 PM >> To: public-xml-processing-model-wg@w3.org >> Cc: XProc Dev >> Subject: pxp:set-base-uri >> >> Hi folks, >> >> I have a long standing action to "propose a pxp:set-base-uri" step. >> Not sure for whom I took the action, but here it is: >> >> http://exproc.org/proposed/steps/other.html#set-base-uri >> >> Here's a test that my implementation passes. >> >> <?xml-stylesheet type="text/xsl" >> href="http://tests.xproc.org/style/testcase.xsl"?> >> <t:test xmlns:t="http://xproc.org/ns/testsuite" >> xmlns:c="http://www.w3.org/ns/xproc-step"> >> >> <t:title>Test pxp:set-base-uri</t:title> >> >> <t:pipeline> >> <p:declare-step version='1.0' name="main" >> xmlns:pxp="http://exproc.org/proposed/steps" >> xmlns:p="http://www.w3.org/ns/xproc" >> xmlns:c="http://www.w3.org/ns/xproc-step"> >> >> <p:output port="result"/> >> >> <p:declare-step type="pxp:set-base-uri"> >> <p:input port="source"/> >> <p:output port="result"/> >> <p:option name="uri" required="true"/> </p:declare-step> >> >> <p:load href=""/> >> >> <pxp:set-base-uri uri="http://example.com/"/> >> >> <p:template> >> <p:input port="template"> >> <p:inline><c:base-uri>{base-uri(/)}</c:base-uri></p:inline> >> </p:input> >> <p:input port="parameters"> >> <p:empty/> >> </p:input> >> </p:template> >> >> </p:declare-step> >> </t:pipeline> >> >> <t:output port='result'> >> <c:base-uri>http://example.com/</c:base-uri> >> </t:output> >> >> </t:test> >> >> Be seeing you, >> norm >> >> -- >> Norman Walsh >> Lead Engineer >> MarkLogic Corporation >> Phone: +1 512 761 6676 >> www.marklogic.com >
Received on Friday, 7 February 2014 08:55:32 UTC