W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > September 2007

Re: Proposal for Additions for Namespace Fixup

From: Norman Walsh <ndw@nwalsh.com>
Date: Thu, 06 Sep 2007 17:01:51 -0400
To: public-xml-processing-model-wg@w3.org
Message-ID: <m2zlzzik3k.fsf@nwalsh.com>
/ Alex Milowski <alex@milowski.org> was heard to say:
| This proposal gets us a long way there.

This proposal is of the form, "We're going to spell it all out, and
here it is. We believe we got it exactly right, we've enumerated every
possible errors and described precisely what to do in each case."

I had hoped not to attempt to got here.

| In general:
|
| "Unless stated otherwise, when a namespace binding is added, a unique prefix
| is generated."

I'm not sure I understand this rule. Given what follows, does it ever
apply? What steps "add a namespace binding"?

| "Any element or attribute generated by a step in this library as output
|  must have a namespace name binding in the in-scope namespaces of that
|  generated element."
|
| 1. p:add-attribute:
|
| If a namespace binding does not exist for the namespace name
| of the attribute, a namespace binding must be added where the prefix
| from the QName should be used if it is not already bound to another
| namespace.  Otherwise, the prefix bound to the attribute's namespace
| in the in-scope namespaces is used in the attribute information item generated.

The "Otherwise" clause here goes with "If a namespace binding does not
exist...", right? (And especially, not with the second "if" clause.)

| 2. p:insert and p:replace
|
| When the element is copied into the resulting document, all the in-scope
| namespaces must be declared unless the prefix is bound to the same
| namespace name by an ancestor.
|
| 3. p:rename
|
| If the target being renamed is an element, the following namespace adjustments
| must be made for the namespace name used by the new element:
|
|    * if the namespace name is not bound to a prefix, a namespace
| declaration must
|      be added where the prefix from the QName should be used if it is
| not already
|      bound to another namespace. .  Otherwise, the prefix bound to the
| namespace
|      name must be used.
|
|    * if there is no namespace name, a default namespace name
| declaration must be
|      added or replaced setting it to the empty string (no namespace).
|
|    * if the default namespace name is changed and there is an in-scope default
|      namespace name, the original default namespace name must be declared on
|      all child elements.
|
| If the target being renamed is an attribute, then if the namespace
| name is not bound to
| a prefix, a namespace declaration must be added where the prefix from
| the QName should be
| used if it is not already bound to another namespace. .  Otherwise,
| the prefix bound to the
| namespace name must be used.
|
| 4. p:wrap
|
| If the namespace name is not bound to a prefix, a namespace declaration must
| be added where the prefix from the QName should be used if it is not already
| bound to another namespace. .  Otherwise, the prefix bound to the namespace
| name must be used.
|
| 5. p:wrap-sequence
|
| The namespace name must be declared using the prefix specified.
|
| Note: There are no consequences here since we are wrapping document elements
| and there are no in-scope namespaces except the predefined namespaces
| and prefixes.
|
| 6. p:unwrap
|
| Any namespace declarations on the element being unwrapped must be copied to the
| element children.
|
| 7. p:set-attributes
|
| For each attribute being added, if a namespace binding does not exist for the
| namespace name of the attribute, a namespace binding must be added where
| the prefix from the QName should be used if it is not already bound to another
| namespace.  Otherwise, the prefix bound to the attribute's namespace
| in the in-scope namespaces is used in the attribute information item generated.
|
| 8. p:xslt
|
| When an element is generated from the xsl:element or an attribute from
| xsl:attribute,
| this step must guarantee that an namespace declaration exists for the namespace
| name used.  As necessary, the step must add namespace declarations in the output
| of the transformation if the XSLT processor does not do so.

Haven't you overlooked p:pack and p:unescape-markup?

If we're going to go to this level of detail, do we need to provide a
step for adding a binding explicitly? Consider the case where you use
p:string-replace to change an attribute value that happens to contain
a QName.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Virtuous people often revenge
http://nwalsh.com/            | themselves for the constraints to which
                              | they submit by the boredom which they
                              | inspire.--Gustave Le Bon

Received on Thursday, 6 September 2007 21:02:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:54 GMT