Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Subtle question about QName-magic #786
Suppose the following pipeline fragment:
In the current version of the specs I am not able to find an answer to this question. What did I miss?
I’m leaning towards 1, but I have a hard time applying the XML namespace spec to this issue.
The first part of this sentence seems to be clear: “Default namespace declarations do not apply directly to attribute names”
The second part, however, muddies the water again: “the interpretation of unprefixed attributes is determined by the element on which they appear”. What does this mean?
If 2. were true then the processor would need to invent a prefix for the default namespace if there is no prefix associated with this namespace. How can you then create attributes in no namespace when a default namespace is in force? However, creating an attribute in no namespace is what you do when a default namespace is in place and you create
So if someone would corroborate that only the first part of the sentence in the namespace spec applies here (or as a bonus, helps me understand what the second part is supposed to say), then 1. is the answer.
IMHO the second sentence is the important one. I choose p:add-attribute as an example, but there are other options where the QName-magic needs to be applied (and they are not related to attributes on xml documents), e.g.
Where do we say something about this?
After doing some research, I think that we need to say more about QName-magic in this special case. We explain QName-magic with reference to the EQName production rules in XPath 3.1. And there it says:
Since the context is XProc, we have to say whether the default namespace is taken into account here or not. Given this, I do not think that "https://www.w3.org/TR/REC-xml-names/#defaulting" (quoted by @gimsieke) is automatically relevant. It might be relevant, if we say it is.