[XML-SIG] Possible DTD parsing bug

Alleman, Lowell lalleman at mfps.com
Thu Jan 8 18:41:59 EST 2004


I found the same thing and asked about on this list  (copied below).  It
looks like the short answer is a problem with the underlining XML parser.
Hopefully it will be helpful to you.  I'm not sure what underlining parser
is being used or how to change it.  I decided to use a different approach,
so I didn't end up using DTD parsing and I haven't looked into this further.
Maybe this can point you in the right direction.

Good luck,

Lowell Alleman

-----Original Message-----
From: martin at v.loewis.de [mailto:martin at v.loewis.de]
Sent: Thursday, December 11, 2003 4:07 PM
To: Alleman, Lowell
Cc: 'Alexandre Fayolle'; xml-sig at python.org
Subject: Re: [XML-SIG] Working with non-compliant XML utilities

"Alleman, Lowell" <lalleman at mfps.com> writes:

> The order that the attributes should appear happens to be the same order
> that they are listed in the <!ATTRLIST> in the DTD.  I've tried to pull
> the DTD info using 4DOM and minidom, but haven't had much success. 

You should explicitly use xmlproc, and install a DTDListener. The
add_attribute callbacks will come in the order of attribute declaration.

> I did notice that 4DOM seemed to choke on ENTITY references ( %entity_ref;
> when the DTD was inline.  Can anyone confirm that?

No. 4DOM only uses some underlying parser, so it will never choke
itself - if something chokes, it is the underlying parser.


-----Original Message-----
From: Chris Herborth [mailto:chrish at cryptocard.com]
Sent: Thursday, January 08, 2004 4:22 PM
To: XML-Sig
Subject: [XML-SIG] Possible DTD parsing bug

I've switched to using a validating parser for my XML processor, and I've 
just run into something that I _think_ might be a bug with PyXML 0.8.3...

In my DTD, I have something like this:

<!ENTITY % target.foo "(a|b|c)">
<!ENTITY % target.bar "(1|2|3)">
<!ENTITY % attrs.control "
	foo %target.foo; 'a'
	bar %target.bar; '1'
<!ELEMENT something EMPTY>
<!ATTLIST something

When parsing my XML docs, I get a warning that "foo" and "bar" are being 
defined again.

I expanded %target.foo; and %target.bar; by hand to get this:

<!ENTITY % attrs.control "
	foo (a|b|c) 'a'
	bar (1|2|3) '1'

and it parses without errors or warnings.

Is this a bug or operator error?

Chris Herborth                                     chrish at cryptocard.com
Documentation Overlord, CRYPTOCard Corp.      http://www.cryptocard.com/
Never send a monster to do the work of an evil scientist.

XML-SIG maillist  -  XML-SIG at python.org

More information about the XML-SIG mailing list