[XML-SIG] Skipped entities under SAX
derekfountain at yahoo.co.uk
Fri Apr 23 01:33:34 EDT 2004
> > I'm only guessing the above, and it seems that the expat parser doesn't
> > entertain such ideas. AFAICT, if it comes across an entity which it
> > doesn't recognise, it throws an error.
> Why are you saying this? It works for me just fine:
Yes, your example works for me too. However, the same code with my XML sample
didn't work. It raises an exception:
xml.sax._exceptions.SAXParseException: ./bookmarks.xml:8:10: undefined entity
It turns out that the problem is my lack of a DTD declaration. If I add an
external DTD declaration:
<!DOCTYPE BOOKMARKS SYSTEM 'x.dtd'>
then it works.
Why might that be?
More information about the XML-SIG