[XML-SIG] 2 Qs: encoding & entities with xmlproc

Dan Libby danda@netscape.com
Mon, 07 Jun 1999 21:17:44 -0700


This is a multi-part message in MIME format.
--------------9D9B38E890EEB29BE54CC4B6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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.

-dan

--------------9D9B38E890EEB29BE54CC4B6
Content-Type: text/x-vcard; charset=us-ascii;
 name="danda.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Dan Libby
Content-Disposition: attachment;
 filename="danda.vcf"

begin:vcard 
n:Libby;Dan
x-mozilla-html:TRUE
org:Netscape Communications
adr:;;;Mountain View;CA;94043;USA
version:2.1
email;internet:danda@netscape.com
x-mozilla-cpt:;0
tel;home:650-964-5913
tel;work:650-937-2276
fn:Dan Libby
end:vcard

--------------9D9B38E890EEB29BE54CC4B6--