[XML-SIG] Parsers which include external parsed entities

Lars Marius Garshol larsga@ifi.uio.no
16 Dec 1998 16:29:51 +0100


* Gabe Wachob
| 
| I'm having problems parsing this with all of the python xml parsers:
|
| <?xml version="1.0"?>
| <!DOCTYPE top  [
| 	  <!ENTITY linklist SYSTEM "links.xml">
| 	  <!ENTITY classification SYSTEM "classification.xml">
| ]
| >

Congratulations! You've found a bug in xmlproc! It turns out that this
way to end the internal DTD subset is well-formed after all. I'll fix
this now so that it will work with the next release (which shouldn't
be too far off).

Meanwhile, just change ']\n>' to ']>' and it should work.

| Is my brain mush? 

Don't think so. I'm more worried about mine... :)

| I get no errors, but I also get no DOM tree. 

This is probably because you don't set any errorhandler so the errors
are just silently swallowed. saxutils.ErrorPrinter is handy if you
want one that simply prints the error messages.

| XML is case sensitive, while SGML is not -- SX assumes it the
| incoming data is SGML and therefore ignores the case of the incoming
| element tags text. 

I should have guessed that, of course.

| Is there an option for SX to behave case sensitively?

In a sense, yes. If you use an SGML declaration where you set element
type names to be case sensitive it shouldn't behave in this way. 

Another trick you can try is jade with an identity-transform DSSSL
stylesheet like:

jade -d id.dsl -t xml mydoc.sgml

and the stylesheet:

(default
   (make element))

You'll lose comments and PIs. You'll also lose attributes, but it
shouldn't be too hard to write a little snippet that puts them in,
using queries on (current-node). Don't have time to put that together
now, unfortunately.

--Lars M.