W3C home > Mailing lists > Public > xproc-dev@w3.org > August 2011

p:insert

From: mozer <xmlizer@gmail.com>
Date: Wed, 3 Aug 2011 22:30:43 +0200
Message-ID: <CAKdwC_M7snsAn6HH4psW_jWyoRaVWt5JFNH-efjBe_SYxgpYrw@mail.gmail.com>
To: XProc Dev <xproc-dev@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 August 2011 20:31:10 GMT