xml - Are elements with mismatched prefixes allowed? -


the "common syntatic constructs" section of xml 1.0 recommendation contains following note:

the namespaces in xml recommendation assigns meaning names containing colon characters. therefore, authors should not use colon in xml names except namespace purposes, xml processors must accept colon name character.

this means following invalid xml:

<xhtml:span     xmlns:xhtml="http://www.w3.org/1999/xhtml"     xmlns:html="http://www.w3.org/1999/xhtml">   <xhtml:a>anchor text</html:a> </xhtml:span> 

however, the "qualified names" section of namespaces in xml recommendation contains statement:

note prefix functions placeholder namespace name. applications should use namespace name, not prefix, in constructing names scope extends beyond containing document.

this leads ambiguity. when happens, xml recommendation have precedence, rendering above document invalid, or should namespace-aware xml processor first convert prefixes appropriate namespaces , consider above document valid?

the namespaces recommendation states in section 7 (conformance):

to conform specification, document must well-formed according xml 1.0 specification [xml].

therefore prefixes used in start , end tag must match.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -