OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [xml-dev] Use of colon in ID



If you use XMLCharacterProperties.validNCName, it should return false.
XMLCharacterProperties.validName verifies that is a valid name per the XML
1.0 spec, and colons are allowed in names by XML 1.0 (and IDs conform to the
"Name" construct of that spec). XMLCharacterProperties.validNCName verifies
that it is a valid NCName per the XML Namespaces rec, and an NCName cannot
contain any colons. XML Namespaces places further constraints on names
beyond XML 1.0. Specifically, XML Namespaces states that element and
attribute names must match the QName construct, and all other XML constructs
that match the "Name" construct of XML 1.0 must be NCNames, so IDs must not
contain colons.

I suspect that if you configured Xerces to not be namespace-aware, then it
would not raise an error for an ID containing a colon. But if you want to be
compatible with XML Namespaces, you'll need to avoid IDs with colons.


> -----Original Message-----
> From: Justin Lipton [mailto:justin@speedlegal.com]
> Sent: Thursday, November 29, 2001 1:00 PM
> To: xml-dev@lists.xml.org
> Subject: [xml-dev] Use of colon in ID
> 
> 
> Hi,
> 
> I'm curious about the use of the colon character (":") in IDs -
> As far as I can tell the spec says that they are permitted but not 
> recommended.
> Xerces 1.4.0's XMLCharacterProperties.validName method 
> returns true for
> IDs containing ||colons - yet when the document is parsed an error is 
> returned.
> 
> Anyone know the status on the use of colons in IDs?
> 
> Thanks,
> Justin.