|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Names, Nmtokens, and Namespaces
I have the following document:
<?xml version="1.0" ?>
<!DOCTYPE foo [
<!ELEMENT foo EMPTY>
<!ATTLIST foo
bar NMTOKEN #REQUIRED>
]>
<foo bar="b:baz"/>
When running it through the Oracle parser version 2, it returns an
error:
Unrecognized text at end of attribute value.
at oracle.xml.parser.v2.XMLError.flushErrors(XMLError.java:221)
at
oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingP
arser.java:228)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:111)
at test.main(test.java:19)
The error does not occur if I remove the b: in the value of the bar
attribute:
<?xml version="1.0" ?>
<!DOCTYPE foo [
<!ELEMENT foo EMPTY>
<!ATTLIST foo
bar NMTOKEN #REQUIRED>
]>
<foo bar="baz"/>
As far as I can tell, this is a bug in the parser. My guess is that the
parser authors have mis-interpreted the following statement in the
namespaces spec to apply to the Nmtoken production as well as the Name
production.
"An XML document conforms to this specification if all
other tokens in the document which are required, for XML
conformance, to match the XML production for Name, match this
specification's production for NCName."
I assume this is incorrect, as it would mean that attributes with
prefixed values could never have type NMTOKEN. (Doing this is a useful
thing, as you get a check for valid prefixed element type names, which
is useful when you want attribute values to point to other elements.)
--
Ronald Bourret
Programming, Writing, and Training
XML, Databases, and Schemas
http://www.rpbourret.com
|
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
|
|||||||||

Cart








