Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Why would encoding="UTF-8" chance to "UTF=16"?

From: "Brandon Gano" <bgano@----------.--->
To: NULL
Date: 7/16/2007 6:48:00 PM

(This is a guess.)

Try adding encoding="utf-8" in your <xsl:output /> element. Your XSL 
processor may default to UTF-16 if that attribute is not specified.


"Hennie" <ze1@h...> wrote in message 
news:u%Tmi.39242$KV1.23035@r......
>
>
> Good Day,
> I have the XSL style sheet attached below.  Whenever I do a transformation 
> of an XML file the "UTF= 8" enconding is always changed to "UTF = 16". 
> Before I can use the transformed file I need to Edit it in Notepad.  The 
> rest of the transformed file works as a charm.  I assume it is something 
> small but I know to little to solve the problem.
>
> Thank you for your time.
>
> Hennie
>
>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
>
>   <xsl:output method="xml" indent="yes"/>
>
> <!-- the key determines (here) what to group by -->
>   <xsl:key name="sample" match="sample" use="concat(sample_date_time, 
> cp_name, imis_cp_ext, dischg_sample_cd, sample_comment)" />
>
> <xsl:template match="/">
>       <submission imis_company_code="0001843309" ws_name="ONTARIO POWER 
> GENERATION INC. -  LENNOX GS">
>           <xsl:apply-templates />
>       </submission>
>
> </xsl:template>
>   <xsl:template match="dataroot">
>       <!-- the actual 'group by' construct -->
>        <xsl:for-each select="sample[generate-id() = 
> generate-id(key('sample',concat(sample_date_time, cp_name, imis_cp_ext, 
> dischg_sample_cd, sample_comment))[1])]">
>           <xsl:copy>
>               <!-- date-time must become an attribute -->
>               <xsl:apply-templates select="sample_date_time | cp_name | 
> imis_cp_ext | dischg_sample_cd | sample_comment"/>
>
>  <!-- find all samples with equal date time -->
>               <xsl:apply-templates select="key('sample', 
> concat(sample_date_time, cp_name, imis_cp_ext, dischg_sample_cd, 
> sample_comment))" />
>           </xsl:copy>
>       </xsl:for-each>
>   </xsl:template>
>   <!-- match the sample's that are grouped -->
>   <xsl:template match="sample">
>       <result>
>
>  <xsl:apply-templates select="*[not(self::sample_date_time or 
> self::cp_name or self::imis_cp_ext or self::dischg_sample_cd or 
> self::sample_comment)]" />
>
>       </result>
>   </xsl:template>
>
>   <!-- any direct child of 'sample' must be turned into an attribute -->
>   <xsl:template match="sample/*">
>       <xsl:attribute name="{name()}">
>           <xsl:value-of select="."/>
>       </xsl:attribute>
>   </xsl:template>
> 



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent