p:insert with-option

Hello.

I have a problem doing something which I thought would be simple but its
proving quite tricky.

I am trying to insert a fragment into an "envelope" like this:

   <p:insert  match="/Structure" position="last-child">

        <p:input port="source">
            <p:document href="./sdmx_message.xml"/>

        </p:input>

        <p:input port="insertion">
            <p:pipe port="source" step="sdmx_message"/>
        </p:input>

    </p:insert>

The problem is that Structure is defined in sdmx_message.xml as:
<Structure xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message<http://www.sdmx.org/resources/SDMXML/schemas/v2_0/message>"
xmlns:structure="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/structure<http://www.sdmx.org/resources/SDMXML/schemas/v2_0/structure>"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message<http://www.sdmx.org/resources/SDMXML/schemas/v2_0/message>SDMXMessage.xsd">

So I am struggling to match the namespace part of Structure.

I thought I could rewrite the insert step as:
    <p:insert>
        <p:with-option name="match" select="/Structure"
            xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message<http://www.sdmx.org/resources/SDMXML/schemas/v2_0/message>
"/>
        <p:with-option name="position" select="last-child"/>
        <p:input port="source">
            <p:document href="./sdmx_message.xml"/>
        </p:input>

        <p:input port="insertion">
            <p:pipe port="source" step="sdmx_message"/>
        </p:input>

    </p:insert>

But it seems that the insert step won't accept match and position being
passed in this way using with-option (using calabash).

Can anybody suggest (i) what I might be doing wrong and (ii) is there a
workaround which I can use?  For the moment I am replacing the insert step
with an xslt step but that does kind of ruin the simplicity of insertion.

Regards
Bob

Received on Monday, 2 November 2009 01:51:13 UTC