Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ser31] ancestor in xhtml prefix normalization #11

Open
benibela opened this issue Mar 28, 2020 · 1 comment
Open

[ser31] ancestor in xhtml prefix normalization #11

benibela opened this issue Mar 28, 2020 · 1 comment

Comments

@benibela
Copy link

XSLT and XQuery Serialization 3.1 says in 6 XHTML Output Method

[Definition: During prefix normalization, any element node in the instance of the data model that is to be serialized that is in one of the XHTML namespace, the SVG namespace or the MathML namespace has its name replaced by the local part of its name. Such an element node is given a default namespace node whose value is the element's namespace URI. Any namespace node for any of those three namespaces that was previously present on any element node in the instance of the data model is also removed, unless the prefix that that namespace node declared is used as the prefix on the name of an attribute on that element or an ancestor of that element.]

Should that not be "a descendant", since ancestors are not affected by namespace nodes?

@michaelhkay
Copy link
Contributor

My first instinct was to agree with you, but I think it's correct.

Consider <svg:a xmlns:svg="zz"><svg:b svg:att="3"><svg:c/></svg:b></svg:a>. In the final result the a element won't have a namespace node for the svg namespace, because it doesn't need one. The b element will have such a namespace node, because it has an attribute in the svg namespace. The c element will have such a namespace node, inherited from its parent element: or in the language of this paragraph, retained because an ancestor has an attribute in the svg namespace.

(It helps to know something of the people who wrote the spec. This is almost certainly drafted by Henry Zongaro. Henry writes very precisely and rarely gets such things wrong. He also writes very concisely: he rarely says anything twice, and rarely adds any kind of gloss or note to say "yes I really meant that"; he demands that his readers pay very careful attention to every word).

rhdunn pushed a commit to rhdunn/qtspecs that referenced this issue Dec 17, 2020
Cleanup build artifacts and remove a few more specs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants