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

RE: add-attribute test case

From: <vojtech.toman@emc.com>
Date: Mon, 8 Aug 2011 03:25:16 -0400
To: <xproc-dev@w3.org>
Message-ID: <3799D0FD120AD940B731A37E36DAF3FE33D974E52B@MX20A.corp.emc.com>
I must admit it took me a moment to spot the error. When I ran the pipeline with Calumet, I got the following result:

<root>
  <div _11:a="3" xmlns:_11="foo" xmlns:_1="bar">
    <div _11:a="3" xmlns:_2="bar">
      <div _11:a="3" xmlns:_3="bar">
      </div>
    </div>
  </div>
</root>

So what Calumet does is that if it detects that the prefix (as specified in "attribute-prefix") cannot be used, it manufactures a new one. I believe that is the expected behavior as "attribute-prefix", according to the specification, is used "to suggest a prefix for the attribute name".

Vojtech


--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech

From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On Behalf Of mozer
Sent: Saturday, August 06, 2011 11:44 PM
To: XProc Dev
Subject: add-attribute test case

Dear all,

I came across an interesting case about p:add-attribute

Here is the pipeline


<?xml version="1.0" encoding="UTF-8"?>
<p:pipeline xmlns:p="http://www.w3.org/ns/xproc"
   version="1.0">
  <p:add-attribute match="div" attribute-name="a" attribute-namespace="foo" attribute-prefix="_1" attribute-value="3"/>
</p:pipeline>



And here is the input file

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <div xmlns:_1="bar">
    <div xmlns:_2="bar">
      <div xmlns:_3="bar">
      </div>
    </div>
  </div>
</root>



Calabash gives the following result



<root>
  <div xmlns:_1="bar" _1:a="3">
      <div xmlns:_2="bar" _1:a="3">
         <div xmlns:_3="bar" _1:a="3">
      </div>
      </div>
  </div>
</root>



Best regards,



Xmlizer
Received on Monday, 8 August 2011 07:29:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 8 August 2011 07:29:10 GMT