This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

how to make the XP parser recognize xml encoding


Hi,

This is an interesting problem.  I appreciate if anyone can offer me some
help on the following.  Here's my source xml:

<?xml version="1.0" encoding="iso-8859-1"?>
...

The xml file contains non-ascii characters and it must use the eocoding
specified in the document itself.  I'm using James Clark's XT engine
(com.jclark.xsl.sax.XSLProcessor) and XP parser (com.jclark.xml.sax.Driver).
I construct a FileReader for the above xml file, then use it to construct an
InputSource that feeds into the xsl processor.  But somehow the XP parser is
not recognizing the encoding embedded in the XML decl.  I actually put
garbage there (e.g., encoding="xxx") and the results come out the same.

I traced into James Clark's code and found that because the InputSource is
from a FileReader, it uses encoding "UTF-16" for all character streams.
Help please?

Thanks!

-Tom



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]