You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Peter A. Volchek" <Pe...@ti.com.od.ua> on 2001/06/12 17:25:03 UTC

colon in the attribute's name

Let's parse two xml documents.

1.
<A xmlns:my="http://my.http" my:name="Peter"/>

This is parsed w/o errors. Prefix my is mapped to http://my.http, so all is
fine


2.
<A my:name="Peter"/>

The parser throws the following error:
    [The prefix 'my' has not been mapped to any URI ( line 1, char 21 )]

But, in this case the colon ":" is part of attribute name rather then
namespace quailified name.
Let's look at xml rec http://www.w3.org/TR/REC-xml#NT-Name
.........
Note:

The Namespaces in XML Recommendation [XML Names] assigns a meaning to names
containing colon characters. Therefore, authors should not use the colon in
XML names except for namespace purposes,
but XML processors must accept the colon as a name character.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
..........

So, I guess, there should be no error.
Ideas?



Peter A. Volchek
Software Engineer
Metis International, Inc.
PeterV@ti.com.od.ua



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org