Hi, Praveen --

Okay, I see the problem.  When you do a transform with a DOMResult, the
DOM that is built represents text in UTF-16, in accordance with the DOM
Recommendation, section 1.1.5 of the DOM Level 2 Core Recommendation. 
When writing out the DOM to a stream, a process called "serialization",
the writer needs to decide what encoding will be used for the output
stream.

In your code, you obtained the output properties, which includes the
encoding, by using

  OutputProperties.getDefaultMethodProperties("xml")

As you can see, this just gets the default encoding (and other
properties) for the XML output method.  If you wish to get the actual
output properties represented in the xsl:output element of your
stylesheet, as supplemented by XSLT defaults, you should replace the
above with

  transformer.getOutputProperties()

Then, I think that everything will work as you expect.

Gary

> Praveen Kumar Venkatesa Perumal wrote:
> 
> Hi Gary,
> 
> Here is the source u have asked for.
> 
> HTH,
> Praveen Kumar V,
> Wipro Technologies, Guindy.
> ) Off : 2301530 Extn : 219
> 
>      ----- Original Message -----
>      From: Gary L Peskin
>      To: [EMAIL PROTECTED]
>      Sent: Monday, June 11, 2001 12:06 PM
>      Subject: Re: Internationalization in XALAN
> 
>      Praveen --
> 
>      Yes, I'm looking into bug 1950.  However, I need to
>      understand exactly
>      what you're doing when you encounter this problem.  I have
>      the
>      "Variable1.xml" and "Variable1.xsl" files from your previous
>      posts.  I'd
>      also like to see the java code you use when you're creating
>      your
>      DOMSource.
> 
>      You seay that it works when you explicitly set the encoding
>      style.
>      Where are you setting this encoding style?
> 
>      When I receive your java code, I should be able to locate
>      the problem.
> 
>      Thanks,
>      Gary
> 
>      > Praveen Kumar Venkatesa Perumal wrote:
>      >
>      > Just now I saw the Bug ID - 1950.
>      >
>      > Even I have the same problem. I am also using DOMSource. I
>      think thats
>      > y when I explicitly set the encoding style it works or
>      else it is not
>      > working. Is anybody looking on that bug.
>      >
>      > Regards,
>      > Praveen Kumar V,
>      > Wipro Technologies, Guindy.
>      > ) Off : 2301530 Extn : 219
>      >
>      >      ----- Original Message -----
>      >      From: Praveen Kumar Venkatesa Perumal
>      >      To: [EMAIL PROTECTED]
>      >      Sent: Monday, June 11, 2001 10:19 AM
>      >      Subject: Re: Internationalization in XALAN
>      >
>      >      Hi Gary,
>      >
>      >      Thanks for the reply, it was very helpful.
>      >
>      >      I have set the encoding has iso-2022-jp in XSL output
>      >      element it was not working, then what i did was, set
>      the
>      >      encoding in XSLT, after that it has started working.
>      Concern
>      >      here is that, XSLT has to take the encoding from XSL,
>      but
>      >      here why it is asking us to say the encoding style
>      >      explicitly.
>      >
>      >      Regards,
>      >      Praveen Kumar V,
>      >      Wipro Technologies, Guindy.
>      >      ) Off : 2301530 Extn : 219
>      >
>      >           ----- Original Message -----
>      >           From: Gary L Peskin
>      >           To: [EMAIL PROTECTED]
>      >           Sent: Sunday, June 10, 2001 12:18 PM
>      >           Subject: Re: Internationalization in XALAN
>      >
>      >           Praveen --
>      >
>      >           I'm not sure what isn't working here.  But, if
>      you
>      >           want your output in
>      >           iso-2022-jp, try adding
>      >
>      >             encoding="iso-2022-jp"
>      >
>      >           to the xsl:output element in your XSLT.
>      >
>      >           HTH,
>      >           Gary
>      >
>      >           > Praveen Kumar Venkatesa Perumal wrote:
>      >           >
>      >           > Hi Joseph,
>      >           >
>      >           > I have tried encoding with iso-2022-jp in
>      SAXON
>      >           the same stuff works
>      >           > fine, but in xalan it is not seems to be
>      working
>      >           I have tried
>      >           > iso-2022-jp, SJIS, Shift_JIS.
>      >           >
>      >           > Has you have asked I have attached the my
>      source
>      >           for your ready
>      >           > reference.  Please do the needful
>      >           >
>      >           > Regards,
>      >           > Praveen Kumar V,
>      >           > Wipro Technologies, Guindy.
>      >           > ) Off : 2301530 Extn : 219
> 
>                    Name: DOM2DOM.java
>    DOM2DOM.java    Type: unspecified type (application/octet-stream)
>                Encoding: quoted-printable

Reply via email to