[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

URGENT!! encoding header changing after transforming

Subject: URGENT!! encoding header changing after transforming
From: "Pramodh Peddi" <peddip@xxxxxxxxxxxxxxxx>
Date: Sat, 18 Oct 2003 16:07:32 -0400
xml encoding header
Hi,

I am using Java's Transformer API to transform the xml content.

The xml source has "windows-1252" encoding and xsl is in "windows-1252"
encoding. But the resultant transformed file has "UTF-8" encoding. When I
use XMLSpy, the encoding is changed to "UTF-16", irrespective of the
encoding of xml source and xsl is. The transformation is working fine, but
later I am getting problems while parsing the transformed file (I am using
JDOM parser).

Can I know the reason. Is there any way to force the transformer to preserve
the encoding as is? I am not good in these encoding stuff, is there any
information on internet on encoding stuff with xml/xsl?

Thanks in advance.

pp.
----- Original Message -----
From: "Lars Huttar" <lars_huttar@xxxxxxx>
To: "'Richard Lewis'" <richard.lewis@xxxxxxxxx>
Cc: "XSL-List (E-mail)" <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Saturday, October 18, 2003 2:13 PM
Subject: RE:  RE: XPath expression to perform 'keyword' query


> > I still have one problem.  I can't get it to search on more
> > than one keyword.
> > I think this is because I'm using the contains() function like this:
> >
> > contains({element content}, $keywords)
> >
> > Any ideas?
>
> You could do
>   contains({element content}, $keyword1) and contains({element content},
$keyword2)
>
> but of course that would only work if the number of keywords was fixed in
advance
> (unlikely).
>
> Otherwise you'd probably have to define a recursive template to parse
> $keyword.
>
> Something like:  (untested)
>
>  <xsl:template name="contains-keywords">
>    <xsl:param name="str" select="''" />
>    <xsl:param name="keywords" select="''" />
>    <!-- Return '1' if the given string contains all keywords
>      (space-separated strings); otherwise '0'. -->
>    <xsl:choose>
>      <xsl:when test="$str = ''">1</xsl:when>
>      <xsl:otherwise>
>        <xsl:variable name="first-keyword"
select="substring-before($keywords, ' ')" />
>        <xsl:choose>
>          <xsl:when test="contains($str, $first-keyword)">
>            <xsl:call-template name="contains-keywords">
>    <xsl:with-param name="str" select="$str" />
>    <xsl:with-param name="keywords" select="substring-after($keywords, '
')" />
> </xsl:call-template>
>          </xsl:when>
>          <xsl:otherwise>0</xsl:otherwise>
>        </xsl:choose>
>      </xsl:otherwise>
>    </xsl:choose>
>  </xsl:template>
>
> Lars
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>
>


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.