XML (XHTML) character entities and PxXml

andrew cooke andrew at acooke.org
Tue May 7 20:55:36 EDT 2002


martin at v.loewis.de (Martin v. Loewis) wrote in message news:<m3offru8mq.fsf at mira.informatik.hu-berlin.de>...
> You have the following options:
> - don't use entity references; use character references (&#num;)
>   instead, or use utf-8
> - include the entity definitions in the document itself, i.e. as
>   internal entities.

please could you explain how to do that.  do i just stick a <!ENTITY
...> thing after the doctype?  if so, what should it include?  i can
probably automate that.

> - use a validating parser, such as xmlproc

i'll try that tomorrow (am now at home).

> - implement your own entity resolver, and try to integrate it into
>   the parsing process. This can be done in several ways; one is:
>   * implement an EntityResolver. Construct a SAX parser that uses
>     this entity resolver. Use the SAX parser to build the DOM tree.

i tried this.  at least, i tried implementing the interface and using
a method that i thought would set the entityresolver on the parser,
but the method on the class was never called (sorry for the lack of
details - it was at work - i believe i used setEntityResolver and
implemented the single method in EntityResolver as a simple "print",
but nothing printed).

thanks v much,
andrew



More information about the Python-list mailing list