- From: Jostein Austvik Jacobsen <josteinaj@gmail.com>
- Date: Tue, 25 Aug 2015 21:50:30 +0200
- To: dvint@dvint.com
- Cc: XProc Dev <xproc-dev@w3.org>
- Message-ID: <CAOCxfQeCdDDYe+2=p2Ze9dRzOcicoRZhPBDz22_wM=CtK3iOrA@mail.gmail.com>
Hi Dan.
In `<p:document href="$Makexsltfile"/>`, the variable in the href attribute
is not evaluated, it is taken literally which is why the error is saying
that the file "$Makexsltfile" could not be read.
You will need to load the document referenced by your variable and pipe it
into the p:xslt step. Have a look at p:load
<http://www.w3.org/TR/xproc/#c.load>.
Something like this should work I think (untested):
<p:declare-step type="l:flatten-map">
<p:option name="Makexsltfile" required="true"/>
<p:input port="source"/>
<p:output port="result">
<p:pipe step="flatten-map" port="result"/>
</p:output>
<!-- Process the DITAMAP file source to travel all the included
maps and topics with stylesheet to flatten the structure and
gather information for later processing. -->
<p:xslt name="flatten-map">
<p:input port="source"/>
<p:input port="stylesheet">
<p:pipe step="Makexsltfile" port="result"/>
</p:input>
<p:input port="parameters">
<p:empty/>
</p:input>
<p:load name="Makexsltfile">
<p:with-option name="href" select="$Makexsltfile"/>
</p:load>
<p:sink/>
</p:xslt>
Best regards
Jostein
On 25 August 2015 at 20:13, <dvint@dvint.com> wrote:
> If I want to pass a value in when calling an XPROC script that will be the
> filename/URI for the document element, is there a way I can do this.
>
> I was looking for the p:with-option but that doesn't exist and it doesn't
> look like variable expansion is occurring. I get this error:
>
> "err:XD0011 : Could not read: $Makexsltfile It is a dynamic error if the
> resource referenced by a p:document element does not exist, cannot be
> accessed, or is not a well-formed XML document.
> C:\work\svn\scripts\translations\$Makexsltfile"
>
> I have this:
>
> <l:flatten-map>
> <p:with-option name="Makexsltfile" select="$Makexsltfile"/>
> </l:flatten-map>
>
> Defined as:
>
> <p:declare-step type="l:flatten-map">
> <p:option name="Makexsltfile" required="true"/>
>
> <p:input port="source"/>
> <p:output port="result"/>
>
> <!-- Process the DITAMAP file source to travel all the included
> maps and topics with stylesheet to flatten the structure and
> gather information for later processing. -->
> <p:xslt name="flatten-map">
> <p:input port="source"/>
> <p:input port="stylesheet">
> <p:document href="$Makexsltfile"
> />
> </p:input>
> <p:input port="parameters">
> <p:empty/>
> </p:input>
>
> </p:xslt>
>
>
> I don't really want to include the XSLT in my XPROC as that makes it hard
> to develop the stylesheet as well as it is long enough that I don't want
> it to confuse the situation. But at the moment it seems to be the only way
> around this problem.
>
> ..dan
>
>
>
>
>
Received on Tuesday, 25 August 2015 19:51:19 UTC