- From: James Garriss <james@garriss.org>
- Date: Tue, 30 Sep 2008 13:20:18 -0400
- To: XProc Dev <xproc-dev@w3.org>
- Message-ID: <C507D812.BDC%james@garriss.org>
Using Calabash 0.6.3:
I have folder with XML files. I use p:directory-list to get a list of the
files.
<p:directory-list path="./albums"/>
It returns a list as expected:
<c:directory xmlns:c="http://www.w3.org/ns/xproc-step" name="albums">
<c:file name="beautiful_new.xml"/>
<c:file name="considering_lily.xml"/>
<c:file name="i_2_(EYE).xml"/>
</c:directory>
So I add a p:for-each with a p:iteration-source to enable me to process each
XML file:
<p:for-each>
<p:output port="result"/>
<p:iteration-source select="//c:file/@name"/>
<p:identity/>
</p:for-each>
(The p:identity is a temp placeholder; it will be replaced by p:xslt in a
bit.) This code produces an interesting error:
Pipeline failed: org.xproc.XProcException:
net.sf.saxon.s9api.SaxonApiException: Cannot create an attribute node (name)
whose parent is a document node
It seems that XProc is trying to *create* an attribute instead of *reading*
the value of the attribute.
Is that a bug?
James Garriss
http://garriss.blogspot.com
PS: Here's my entire pipeline:
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:c="http://www.w3.org/ns/xproc-step">
<p:input port="source">
<p:empty/>
</p:input>
<p:output port="result"/>
<p:directory-list path="./albums"/>
<p:for-each>
<p:output port="result"/>
<p:iteration-source select="//c:file/@name"/>
<p:identity/>
</p:for-each>
</p:declare-step>
Received on Tuesday, 30 September 2008 17:21:05 UTC