[XML-SIG] [ pyxml-Bugs-578553 ] nonconformance: NOTATION-type attributes

noreply@sourceforge.net noreply@sourceforge.net
Sun, 07 Jul 2002 23:10:12 -0700


Bugs item #578553, was opened at 2002-07-08 02:10
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=578553&group_id=6473

Category: xmlproc
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthew Gruenke (mgruenke)
Assigned to: Lars Marius Garshol (larsga)
Summary: nonconformance: NOTATION-type attributes

Initial Comment:
xmlproc's DTD parser seems to be nonconformant, in a
couple of NOTATION-related areas.  I tripped over the
initial case, when an error was incorrectly reported,
while trying to use xmlproc to parse the XML DocBook
DTD v4.1.2 (there's no reason to believe 4.2 won't have
the same issue).  Since DocBook is a fairly popular
DTD, I think this error is fairly serious, even though
NOTATION-type attributes are surely one of XML's more
infrequently used features.

While I was reproducing this error, I figured I'd try a
couple related cases, and uncovered two more areas of
nonconformance.  I could have reported these as
separate bugs, but it was easiest to reproduce them all
in the same source file, and I think they should be
easy to fix.  If anyone wants to split them out, please
feel free to do so.


The first error occurs when xmlproc complains about a
default being supplied, for NOTATION-type attributes. 
The specific error message (for my test case) is:
    ERROR: 'gif' is not an allowed value for the
'format' attribute at xmlproc_notation_bugs.dtd:27:46

As far as I can tell, there's no reason a default value
can't be applied to a NOTATION-type attribute, though I
don't see where the spec explicitly states this as a
possibility (since it does explicitly disallow defaults
for ID attributes, one could assume that no similar
statement, about NOTATION attributes, means it's
allowed).  The fact that XML DocBook does this, has
been around for quite a while, and is routinely
processed by dozens of different XML parsers, lends
weight to the case that NOTATION-type attributes should
be able to take a default value.

I think the problem is that, in
_xmlplus/parsers/xmlproc/xmldtd.py:
Attribute.validate(), someone decided to be a little
too clever and allow default values only if the type of
the attribute value is StringType (types.StringType or
types.UnicodeType).


The second case of nonconformance is one in which an
error is reported as a warning.  The case is that two
NOTATION-type attributes aren't allowed to be applied
to the same element (the spec notes this as a
compatibility constraint, so I assume it's due to some
SGML legacy).

I didn't look into possible causes of this.


The third case I encountered is that NOTATION
attributes are allowed, on empty elements, when they
shouldn't be.  No warning or error is issued.

I didn't look into possible causes of this, either.


Again, the first problem is really the highest-priority
issue, for me (and probably others).  However, I expect
the XML-SIG will want to see all of these fixed, if
knowing that xmlproc is nonconformant weighs down on
anyone's conscience.  ;-)

I'd have gone ahead and proposed a fix, but figured the
maintainer(s) may have different ideas about the best
way to address it.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=106473&aid=578553&group_id=6473