[Bug 4487] [XDM] Missing constraint for attribute names

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4487





------- Comment #2 from mike@saxonica.com  2007-04-27 10:22 -------
Namespace fixup is not the responsibility of the serializer: the XDM model
contains the tree structure *after* fixup has been applied. This enables anyone
accessing an XDM tree to be confident that it will satisfy basic XML rules such
as names being valid, and no element having two attributes with the same name.
The rule that an attribute in a namespace always has a prefix falls into the
same category.

>In both cases the XDM
shouldn't care, because the prefix is irrelevant to the actual name of the
attribute (the namespace URI/local name pair).

The name of the attribute is not a namespace URI/local name pair: it is a
triple that also includes a prefix: see section 3.3.3 ("In this Data Model,
therefore, the value space for qualified names contains a local-name, an
optional namespace URI, and an optional prefix.")

The prefix is ignored when comparing two names, but it is visible to
applications via functions such as name(). It's important from a usability
perspective that name() applied to a node should return the same string that
you see when serializing the node, since it is often used in messages and
similar output.

Received on Friday, 27 April 2007 10:22:57 UTC