Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 24th, 2006, 09:51 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Preventing entities in result-tree

Hey everybody

I want to prevent my stylesheets from generating entities for foreign (i.e. non-ascii) characters in the serialized result-tree. I'm using the HTML output method of XSL 1.0/1.1, and it always converts my special characters (such as German umlauts & Cyrillic characters) to entities.
All the XML-files use UTF-8 as encoding, and that's also what I specify in the <xsl:output> tag, but still those entities appear.

I know I could prevent this behaviour by using the "disable-output-escaping" attribute, but this would mean changing a lot of files, which would mean a lot of (extra) work.

Using the XML output method is another way of preventing this (I've tested), but then the generated HTML-files are not rendered correctly in some browsers (i.e. Internet Explorer).

At the moment, upgrading to XSL 2.0 is also out-of-the-question, because of time-constraints and I'm not sure that would do me any good.

Is there another way of forcing XSL not to generate entities? I've been searching the Web for the past week, and all I can find are question of people who actually want to have those entities in their result [:-(]

Thanks in advance

Rolf
Reply With Quote
  #2 (permalink)  
Old April 24th, 2006, 10:03 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Technically they aren't entities, they are either entity references or character references. For example, & nbsp; is an entity reference, while & #xa0; is a character reference.

XSLT 1.0 gives the serializer free range on this: it can do what it likes, so long as the serialized form is an accurate representation of what is in the result tree. Your particular product might give you more control (Saxon 6.x does, for example, though an extension attribute in xsl:output called saxon:character-representation).

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old April 24th, 2006, 03:47 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Mr. Kay!

I knew there had to be a way, and I knew you would have the answer :-) We have always been very satisfied with Saxon, and once again it proved to be the right choice.

Greetz

Rolf
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
for-each on result tree fragment RoeZ XSLT 11 November 22nd, 2007 07:31 AM
GridView and SQL More than one result = one result DarkForce ASP.NET 2.0 Basics 0 July 20th, 2007 04:29 AM
how to exclude elements in the result tree output ntmt XSLT 0 May 25th, 2006 10:33 AM
Transforming a result tree with yet another Xslt ballo XSLT 2 March 7th, 2006 09:42 AM
Entities safin XSLT 1 November 7th, 2005 04:59 AM



All times are GMT -4. The time now is 01:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.