![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Why would encoding="UTF-8" chance to "UTF=16"? Why would encoding="UTF-8" chance to "UTF=16"?To: NULL Date: 7/16/2007 8:25:00 PM
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>
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
