p:insert

Dear all,

Here are few thoughts about the behavior of p:insert

Suppose I have this pipeline

<?xml version="1.0" encoding="UTF-8"?>
<p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
  name="one-two-three"
  version="1.0">
  <p:identity>
    <p:input port="source">
      <p:inline>
        <root>
          <first/>
          <prices/>
          <names/>
        </root>
      </p:inline>
    </p:input>
  </p:identity>
  <p:insert match="/root/first" position="first-child">
    <p:input port="insertion">
      <p:inline>
        <?pi toto?>
        <!-- -->
        <toto/>
        <!-- -->
        <?pi tata?>
      </p:inline>
    </p:input>
  </p:insert>
</p:pipeline>


I expect as a result (whatever the input is) to be :

        <root>
          <first>
        <?pi toto?>
        <!-- -->
        <toto/>
        <!-- -->
        <?pi tata?>
      </first>
          <prices/>
          <names/>
        </root>


You can see that in this case, we expect the original whitespace to appear


Suppose now that I add select="//toto" on the p:input; like this


<p:insert match="/root/first" position="first-child">
    <p:input port="insertion" select="//toto">
      <p:inline>
        <?pi toto?>
        <!-- -->
        <toto/>
        <!-- -->
        <?pi tata?>
      </p:inline>
    </p:input>
  </p:insert>


Hence I expect the result to be

        <root>

           <first><toto/></first>
          <prices/>
          <names/>
        </root>


without any space


But Calabash give this out (with extra space around the element)

        <root>
          <first>
      <toto/>
   </first>
          <prices/>
          <names/>

        </root>



Regards,


Xmlizer

Received on Wednesday, 3 August 2011 20:31:10 UTC