W3C home > Mailing lists > Public > xproc-dev@w3.org > September 2008

Re: possible bug in p:iteration select

From: Norman Walsh <ndw@nwalsh.com>
Date: Tue, 30 Sep 2008 14:05:10 -0400
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m2wsgtpl0p.fsf@nwalsh.com>
James Garriss <james@garriss.org> writes:
> 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>
> Pipeline failed: org.xproc.XProcException:
> net.sf.saxon.s9api.SaxonApiException: Cannot create an attribute node (name)
> whose parent is a document node

There error message is a bit awkward, but the problem *is* that you're
trying to create an attribute node as a document.

What you want is something more like this:

    <p:output port="result"/>
    <p:iteration-source select="//c:file">
      <p:option name="href" select="/c:file/@name"/>

Unfortunately, that doesn't work in Calabash 0.6.3. All I can do is
repeat my promise to try to get an 0.6.4 out this week that fixes this

> It seems that XProc is trying to *create* an attribute instead of *reading*
> the value of the attribute.
> Is that a bug?

No :-)

                                        Be seeing you,

Norman Walsh <ndw@nwalsh.com> | Why shouldn't things be largely absurd,
http://nwalsh.com/            | futile, and transitory? They are so,
                              | and we are so, and they and we go very
                              | well together.-- Santayana

Received on Tuesday, 30 September 2008 18:05:51 UTC

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