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

XSLT 2.0: Character Output Issue

Subject: XSLT 2.0: Character Output Issue
From: "Sam Byland" <shbyland@xxxxxxxxxxx>
Date: Wed, 18 Jul 2007 11:14:56 -0400
 XSLT 2.0:  Character Output Issue
Hello all,

We're in the process of upgrading from XSLT 1.x (Saxon6) to XSLT 2.0 (Saxon8). It's a fairly significant effort (perhaps similar in scope to David's "big switch" http://dpcarlisle.blogspot.com/2007/06/big-switch.html), and I'm finally at the point where I'm reviewing differences in the output files and trying to make those differences go away :-).

Many of the instance files we deal with use various math symbols throughout them. I'll use the "not equal" symbol &#x2260; in the example of the problem below.

XML file:

<?xml version="1.0" encoding="UTF-8"?>
<Test>"Hello" &#x2260; "World"</Test>

XSLT1.1 stylesheet:

<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="Test">
<xsl:document href="test.html">
<html>
<head>
<title>test</title>
</head>
<body>
<p><xsl:value-of select="."/></p>
</body>
</html>
</xsl:document>
</xsl:template>
</xsl:stylesheet>


XSLT2.0 stylesheet:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output name="OutHTML" method="html"/>
<xsl:template match="Test">
<xsl:result-document href="test.html" format="OutHTML">
<html>
<head>
<title>test</title>
</head>
<body>
<p><xsl:value-of select="."/></p>
</body>
</html>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>


When I transform the isntance file above with the XSLT1.1 stylesheet using Saxon6, I get the following output:

<html>
   <head>
       <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
       <title>test</title>
   </head>
   <body>
       <p>"Hello" &#8800; "World"</p>
   </body>
</html>

When I transform the instance file with XSLT2.0 stylesheet using Saxon8, I get the following output (I hope the output isn't mangled by the usual email limitations.....).

<html>
   <head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
       <title>test</title>
   </head>
   <body>
       <p>"Hello" b?  "World"</p>
   </body>
</html>

In IE, I notice that these two display the same way as a web page. However, our output html files are eventually opened within MS Word, and only the Saxon6 output files show up correctly.

One thing I notice is that when I open the simplified example output files above, both display fine in MS Word. If someone can provide some advice as to where this problem might be coming from and only affecting our large output files from displaying right in Word, that would be great!.

thanx,

...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.