W3C home > Mailing lists > Public > public-xml-processing-model-comments@w3.org > December 2008

Re: add-attribute adding namespace declarations.

From: David A. Lee <dlee@calldei.com>
Date: Wed, 17 Dec 2008 12:34:06 -0500
Message-ID: <C183F550A6CF45F29F3E1414451B9DCB@calldei.com>
To: "Henry S. Thompson" <ht@inf.ed.ac.uk>
Cc: <Toman_Vojtech@emc.com>, <public-xml-processing-model-comments@w3.org>

I think that would be extremely useful.

You are correct that it is "clear" that xmlns attributes cannot be added, 
but ...
Its not at all "clear" to me that namespace declarations are added with the 
or even that attributes in any namespace, let alone a namespace not already 
declared in the document can be added.
Or even where the namespace declarations are added.

For example:
The test case add-attributes-002.xml puts the namespace declaration on the 
step itself (in the the first step of the pipeline)

=== quote
<p:add-attribute match="title" attribute-value="bar" 

  <p:with-option name="attribute-name" select="'test:foo'"/>



I suggest it is absolutely unclear in the spec that

1) namespace declarations are added as a side effect of this action

2) the namespace declaration is added to only (and every) node effected by 
the add-attribute, as apposed to say, put on the document root element, when 
the namespace is declared on the step at the step level instead of the 
option level.

(as in the second part of this test)

=== quote

<p:add-attribute match="title" attribute-value="bar" 

    <p:with-option name="attribute-name" select="'test2:foo'"/>


Hash: SHA1

David A. Lee writes:

> Cross-posting to the xml-processing group.
> I belive this requires a clarification in the spec.
> add-attribute absolutely *can* add namespace declarations, but the
> spec explicitly says it cannot.
> It just cant add namespace declarations without adding an additional
> (non xmlns) attribute.

The spec. is already perfectly clear in stating that the value of the
attribute name option cannot be 'xmlns:...'.  At most a Note could be
added along the lines of:

  Note: Adding an attribute whose name is in a namespace with no
  namespace declaration in scope in the target document may result in
  a namespace binding being added by [ref: namespace fixup].

- -- 
       Henry S. Thompson, School of Informatics, University of Edinburgh
                         Half-time member of W3C Team
      10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440
                Fax: (44) 131 651-1426, e-mail: ht@inf.ed.ac.uk
                       URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged 
Version: GnuPG v1.2.6 (GNU/Linux)

Received on Wednesday, 17 December 2008 17:34:53 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:28:26 UTC