[XML-SIG] 2 Qs: encoding & entities with xmlproc
Mon, 07 Jun 1999 21:17:44 -0700
This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii
1) The version of xmlproc I have does not appear to support any encoding other
than "iso-8859-1". It returns an error for any other value. Before, when we were
using xmllib, it simply called handle_xml(), where we were able to look at the
encoding value and make appropriate decisions at the application level. Does
xmlproc have any equivalent functionality, perhaps in a more recent version?
2) Explanation: I need to preserve XML/HTML entities. For example, if the
document contains % then I want to print that out exactly, not the
parsed/converted value. If I don't do this, then any random person can embed html
markup, etc, which could break an HTML page. This was pretty easy using xmllib -
a non-validating parser, because it simply calls my handler for all entities it
encounters and I can provide the mapping. However, with xmlproc, it doesn't seem
to call any callback that I can find, it simply looks up the entity in its map and
returns it, or else spits out an error 3021: Undeclared Entity. So my question
is: Is there a suggested workaround? I suppose I could always pre-process the
document before giving it to the parser, but that seems pretty messy.
Content-Type: text/x-vcard; charset=us-ascii;
Content-Description: Card for Dan Libby