W3C home > Mailing lists > Public > xproc-dev@w3.org > December 2010

Re: result-document() and XProc secondaries

From: Jostein Austvik Jacobsen <josteinaj@gmail.com>
Date: Sat, 11 Dec 2010 02:32:35 +0100
Message-ID: <AANLkTi=8F-tEvHHJdJi9EUT9MUh0r8-krSRywsTbKPzi@mail.gmail.com>
To: David <david@davidpriest.ca>
Cc: xproc-dev@w3.org
I don't know what your XSLT does, but to see what a p:for-each matches, you
can for instance switch the p:store with a p:add-attribute and have a look
at the output. If the XSLT output is not valid XML though, then I don't
know. You might also want a select on the p:iteration-source.

<?xml version="1.0"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="
    version="1.0" name="bootstrap">
    <p:input port="source"/>
    <p:output port="result"/>

    <p:identity name="extract_literate_programs">
        <p:input port="source">

        <p:iteration-source select="/foo/bar">
            <p:pipe step="extract_literate_programs" port="result"/>
        <p:add-attribute match="/*" attribute-name="this"
attribute-value="is the matched element"/>
    <p:wrap-sequence wrapper="foo"/>


2010/12/11 David <david@davidpriest.ca>

> Is there any reason to believe that the XProc below would error-out with an
> XD0001 (non-XML resource)?  When the self-same XSLT transformation is run
> through Saxon, it correctly produces the files through its result-document()
> statements.
> How can I discover exactly what is being received by the p:store statement?
>  If I could only see the (presumably non-XML) data, I'd have a much better
> clue as to what the problem is.
> <?xml version="1.0"?>
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0"
> name="bootstrap">
> <p:xslt name="extract_literate_programs" version="2.0">
> <p:input port="source">
> <p:document href="bootstrap_literate_xml.xml"/>
> </p:input>
> <p:input port="stylesheet">
> <p:document href="bootstrap_tangle.xsl"/>
> </p:input>
> <p:input port="parameters">
> <p:empty/>
> </p:input>
> </p:xslt>
> <p:sink/>
> <p:for-each>
> <p:iteration-source>
> <p:pipe step="extract_literate_programs" port="secondary"/>
> </p:iteration-source>
> <p:store>
> <p:with-option name="href" select="concat('src-',p:iteration-position())"/>
> </p:store>
> <p:identity/>
> </p:for-each>
> </p:declare-step>
Received on Saturday, 11 December 2010 01:33:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:07 UTC