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]

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