W3C home > Mailing lists > Public > xproc-dev@w3.org > August 2015

Passing a variable to p:document href?

From: <dvint@dvint.com>
Date: Tue, 25 Aug 2015 11:13:53 -0700
Message-ID: <cbbb722786153d475ad00105a2dbb837.squirrel@webmail.dvint.com>
To: xproc-dev@w3.org
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 18:14:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:17:25 UTC