You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Olivier Moïses <co...@generic-concept.com> on 2001/11/02 11:36:47 UTC

RE: RE: How to get the character encoding of the XSLTResultTarget ?

Hi David,

Thanks for your answer. This is a new formulation of my question :
I am writing a code wrapper for the XalanTransfomer in Python.
My problem is simple: after the transformation, I use the byte stream
returned by XSLTResultTarget, but in the case of UTF-16, I must encapsulate
it in a special Unicode class, in all other cases in a string case.

In the first step, I just want to detect the character wide (but I don't
know how!).

In the second step, I would like to send the transformation's result via a
HTTP layer, so I must know the exact character encoding if I want fill
correctly the encoding field of the HTTP REQUEST HEADER.

The only way I found is to get the <xsl:output encoding=""> value of the
XSLT document, (but it implies to process two times the stylesheet, I
think?).
But, may be is it another reliable and more efficient way to get the
encoding result ? (direct access to the compiled stylesheet ...?)

Regards

Olivier Moises


Generic Concept
94, Av Jean Lebas
59100 Roubaix
FRANCE
e-mail: contact@generic-concept.com

-----Message d'origine-----
De : David_N_Bertoni@lotus.com [mailto:David_N_Bertoni@lotus.com]
Envoyé : mercredi 31 octobre 2001 16:02
À : xalan-c-users@xml.apache.org
Objet : Re: How to get the character encoding of the XSLTResultTarget ?


I don't think I understand your question.  There is no data in an
XSLTResultTarget.  The processor chooses an output encoding as follows:

   1. If there is an xsl:output element in the stylesheet, and it has an
   encoding attribute, and the processor supports that encoding, the
   serialized result will be in that encoding.

   2. Otherwise, the serialized result will be encoded in UTF-8.

Does that anwer your question?

Dave




                    Olivier Moïses
                    <contact@generic-co        To:
<xa...@xml.apache.org>
                    ncept.com>                 cc:     (bcc: David N
Bertoni/CAM/Lotus)
                                               Subject:     How to get the
character encoding
                    10/31/2001 05:40 AM        of the XSLTResultTarget ?
                    Please respond to
                    contact





Hi everybody,





Does someone knows how to get the character encoding of the
XSLTResultTarget returned by XalanTransformer.transform (?).


I would like to know if the data are ISO-8859-1 or UTF-16 inside the
XSLTResultTarget.


I believe that the getEncoding () is just returning the value the source
code gave.





Thanks,





Regards





Olivier Moises



Generic Concept
94, Av Jean Lebas
59100 Roubaix
FRANCE
e-mail: contact@generic-concept.com