Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#5 mathml2.dtd defeats DTDParse

open
nobody
dtdparse (5)
5
2007-01-26
2007-01-26
Tony Graham
No

The convoluted construction for the declaration of the MathML namespace in the MathML 2.0 DTD defeats DTDParse.

DTDParse gets confused at 'xmlns:%MATHML.prefix;' during the expansion of:

<!ATTLIST %math.qname;
%att-topinfo;
%att-browif; >

with the result firstly that '%MATHML.prefix;' is treated as the attribute value declaration and secondly that DTDParse misses the end of the attribute list declaration and treats the following declaration as part of the attribute list.

The eventual output is:

Loading mathml2.dtd
Loading mathml/mathml2-qname-1.mod
Attlist mml:mathError: %mathml-charent.module; undeclared.

One solution is to expand parameter entity references in entity values as part of parsing the entity declaration in parse_entity(). (I will leave it to a reader more familiar with the code to work out how to pass $expand to parse_entity() to control whether or not to expand entity references.)

Also, the debug output when parsing attribute lists is confusing since there's no labelling of the output of $values and $type. It doesn't help to have them look the same when DTDParse is reporting one as the other.

Regards,

Tony Graham.

Discussion

  • Tony Graham
    Tony Graham
    2007-01-26

    Patch for DTD.pm

     
    Attachments
  • Earl Hood
    Earl Hood
    2007-04-19

    Logged In: YES
    user_id=115552
    Originator: NO

    Would you provide the input files you used for dtdparse?

    I downloaded the zip bundle from w3c for the mathml2 dtd, ran
    dtdparse on it, and I got no errors.

     
  • I'd be very interested to see if this could be fixed. Is anyone watching this issue? Earl, are you still around?

     
  • I hadn't noticed the patch file that Tony attached. I tried it out and it works. Earl, I'd be happy to send you a DTD that causes it to fail, if you're still interested.