[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: 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@s...] > Sent: Thursday, November 29, 2001 1:00 PM > To: xml-dev@l... > Subject: 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|