Re: add-attribute adding namespace declarations.

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 
attritibutes,
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" 
xmlns:test="http://test.com">

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

</p:add-attribute>

===

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" 
xmlns:test2="http://test.com">

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

</p:add-attribute>





-----BEGIN PGP SIGNED MESSAGE-----
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].

ht
- -- 
       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 
spam]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFJSTaNkjnJixAXWBoRAhW6AJ9T1W1ARZvvL/miLKf6vprAUgjZ6ACePI9n
2edmo86toKDfW4k1zGX5hSY=
=WCPJ
-----END PGP SIGNATURE-----

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