Re: Proposal for Additions for Namespace Fixup

On 9/6/07, Norman Walsh <ndw@nwalsh.com> wrote:
> / 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"?

When you add a namespace declaration and the prefix you'd like to use is
bound to something else.  In that situation, you have to generate a prefix.

I was trying to have a generic statement that says we generate prefixes
when we can use the ones we have.

>
> | "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.)

Right.

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

I'll have to look at p:pack.

p:unescape-markup must come from well-formed XML.  As such,
there can't be any undeclared prefixes.

> 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.

Hmm... I suppose that's true.

I wonder if we could all set-attributes to do that...


-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics

Received on Thursday, 6 September 2007 22:33:52 UTC