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:

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

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 Toman
Consultant Software Engineer
EMC | Information Intelligence Group

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"
  <p:add-attribute match="div" attribute-name="a" attribute-namespace="foo" attribute-prefix="_1" attribute-value="3"/>

And here is the input file

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

Calabash gives the following result

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

Best regards,

Received on Monday, 8 August 2011 07:29:10 UTC

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