Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > XSLT and UTF-8

XSLT and UTF-8
Thread Tools
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jul 11, 2002, 09:36 PM
 
I'm working on some XSLT transforms with PHP. Sablotron doesn't seem to compile well on OSX, so I can't test my transforms directly with PHP. Instead I use TestXSLT, a small program that also uses Sablotron, though for the life of me I haven't a clue how he got it working. Search for it on VersionTracker.

Anyway, one of my pages contains some Japanese text. Here's a sample string: 夢の中得 (in HTML/XML entities that's 夢の中&#x5f97 ; just in case UBB doesn't let the Japanese text through).

I need to get this text through the XSLT transform intact. Sablotron can't handle it when the text is encoded "natively" in UTF-8. But when I use HTML entities, it gets processed by Sablotron's parser and turned into garbage (and it's UTF-8 encoded garbage, so no amount of browser View-menu trickage will work). If I try to get cute and encode the ampersands as an entity (so Sablotron will see those and pass them through), it encodes them into an HTML entity instead, so I still get messed up.

This is driving me nuts. All I want to do is get some Japanese text into the parser and have it come out the other side unchanged. Several other XSLT processors can do this, but because I'm using PHP for this I have to use Sablotron.

Alternatively, if someone can tell me how to get Sablotron to compile on OSX I may be able to tinker with this better; it's entirely possible that something is wrong with TestXSLT's build of it.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Mac Enthusiast
Join Date: Jul 2002
Location: Leiden, Netherlands
Status: Offline
Reply With Quote
Jul 15, 2002, 03:17 PM
 
</font><blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">quote:</font><hr /><font size="1" face="Geneva, Verdana, Arial, sans-serif">Originally posted by Millennium:
<strong>
Alternatively, if someone can tell me how to get Sablotron to compile on OSX I may be able to tinker with this better; it's entirely possible that something is wrong with TestXSLT's build of it.</strong></font><hr /></blockquote><font size="1" face="Geneva, Verdana, Arial, sans-serif">Why don't you generate you page using something like OpenJade ? and then parse the HTML output using PHP ?
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:35 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2