Re: pxp:set-base-uri

Looks like it perfectly does the job... until it’s standardized in V2 :)

Thanks!
Romain.

On 6 févr. 2014, at 23:00, Norman Walsh <ndw@nwalsh.com> wrote:

> 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 Thursday, 6 February 2014 22:27:42 UTC