Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 9th, 2007, 06:18 PM
Authorized User
 
Join Date: Oct 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default making special characters work

i have to put up both an english and french version of our terms of service document on the website. the xsl parser yaks on characters such as é etc in the french TOS. what's the easiest way to convert all these to a format that the parser will like that will also display properly in the HTML?

 
Old January 9th, 2007, 06:39 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Your description of what you've done is very vague, and using words like "yaks" only makes it vaguer. Perhaps you have actually written the entity reference é in your stylesheet (or your source document) without declaring it? It's a fundamental rule in XML that except for the 5 built-in entities (<, etc) you can't use an entity reference unless you declare it first. You can get hold of standard files that declare all the HTML entity references to include in your document (but you'll have to search for them).

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old January 9th, 2007, 07:18 PM
Authorized User
 
Join Date: Oct 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I get the error "XML parser error 11: undefined entity" when things like « and è are in the code. I know i can use something like the following, but that gets obnoxious pretty fast...

<xsl:text disable-output-escaping="yes">&amp;egrave;</xsl:text>

 
Old January 9th, 2007, 07:33 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You can download files that declare these entities from

http://www.oasis-open.org/docbook/xm....3/index.shtml

and incorporate them in your stylesheet by means of an internal DTD.

(Personally though, if I'm using Western European characters I prefer just to use iso-8859-1 encoding and enter the characters directly in their native encoding, rather than using entity references for them.)

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old January 10th, 2007, 03:43 PM
Authorized User
 
Join Date: Oct 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

perfect, thank you!






Similar Threads
Thread Thread Starter Forum Replies Last Post
XML vs. special characters brko C# 1 January 23rd, 2006 11:05 AM
storing special special characters in nvarchar... ACE2084 SQL Server 2000 2 February 9th, 2005 11:45 AM
special characters lian_a Classic ASP Basics 3 June 23rd, 2004 05:16 AM
how to escape special characters? reddygaru XML 2 December 16th, 2003 07:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.