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

Re: XSLT 2.0: Character Output Issue

Subject: Re: XSLT 2.0: Character Output Issue
From: "Sam Byland" <shbyland@xxxxxxxxxxx>
Date: Wed, 18 Jul 2007 12:21:11 -0400
Re:  XSLT 2.0:  Character Output Issue
Sam Byland wrote:

Our original XSLT has the following meta element output:

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

So changing that to

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

fixes the problem with regards to the display when opened within MS Word.

You should not put such a meta element in your stylesheet, use xsl:output with method html and the intended output encoding and the XSLT processor will place the proper meta element in the HTML result when serializing the result tree.
--


Martin Honnen

Agreed (in general anyway). Notice I didn't put such an element into my simplified example. In the real stylesheet set I have to put it there or it doesn't end up in the output. I never got around to trying to figure out why this was the case since adding the meta element to the stylesheet fixed the problem. Note that my actual stylesheet is quite large (both in number of xsl files being imported/included and lines of code), using many modes etc. In this case, we have:


<xsl:result-document href="{$OutputFileName}" format="WordHTML">
   <xsl:apply-templates select="$ProcedureNodes" mode="Output">
       ...
   </xsl:apply-templates>
</xsl:result-document>

where the "Output" mode stylesheet code resides in another file where, after setting up several variables etc., it has:

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word">
<head>
<meta http-equiv='Content-Type' content="text/html; charset=windows-1252"/>
<meta name='ProgId' content='Word.Document'/>
<meta name='Generator' content="Microsoft Word 9"/>
<meta name='Originator' content="Microsoft Word 9"/>
...and so on....


If I remove that first meta line, it doesn't appear in the output...

...sam

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-2013 All Rights Reserved.