Re: how to make the XP parser recognize xml encoding

Subject: Re: how to make the XP parser recognize xml encoding
From: "Tom Wang" <tomw@xxxxxxxxx>
Date: Tue, 27 Jun 2000 16:38:13 -0700

Thank you for your reply!  I couldn't use the code in
com.jclark.xsl.sax.Driver.main() because my XML input source not always come
in from a file.  Sorry I did not state this clear in my last email.  What
I'm trying to do is to chain a series of transformations together.  So the
source.xml goes into the first xslt processor and come out as a character
stream, which is then fed into the second xslt processor, and so on ...

The problem lies in the second xslt, where its input stream is the output of
the first xslt, and its encoding is embedded within the stream itself (say
utf-8).  How can I make the 2nd xslt recognize that encoding and not to use
utf-16?  I don't want to use URL string here as it requires me to save my
character stream (or results of 1st xslt) to a temp file and the performance
will suffer.

More help please.  Thanx bunch!


----- Original Message -----
From: Ron Ten-Hove <rtenhove@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxx>
Sent: Tuesday, June 27, 2000 3:17 PM
Subject: RE: how to make the XP parser recognize xml encoding

> > -----Original Message-----
> > This is an interesting problem.  I appreciate if anyone can offer me
> > 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.
> >
> You should use the same technique used by
> it supplies the processor with InputSource objects that are constructed
> using URL strings that indicate the files to be processed.  I'm not sure
> *how* you are managing to invoke the processor with FileReader objects,
> but I'd guess that the XML parser is assuming that InputStreamReaders
> provide conversion to Unicode.
> -Ron
>  XSL-List info and archive:

 XSL-List info and archive:

Current Thread