473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Parsing UTF-8 string with XSLT

Hello, the majority of my sites use PHP MYSQL and XSLT for dynamic
pages and all of it works ok for English characters. The problem begins
when I try to use Romanian or Russian characters while creating the XML
string.

What I used to do is:
1) Query the MYSQL database that is UTF-8 (the conection is also set by
a query to UTF-8)
2) Create a XML string in PHP using the query results
3) Transform the XML string using a XSLT parser

As I said it all works ok with the English data but when I try using
Russian instead of letters I get question signs. If I try to echo the
Russian text when creating the XML data it is displayed correctly, so
the problem is in the XML string that is somehow not UTF-8 encoded or
what??

Can someone help me?

Feb 10 '06 #1
2 2137
Which version of PHP are you using? Which XML functions - DOM XML or XML?
Which xslt engine - Sablotron or XSL?

--
Tony Marston
http://www.tonymarston.net

<Be**********@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Hello, the majority of my sites use PHP MYSQL and XSLT for dynamic
pages and all of it works ok for English characters. The problem begins
when I try to use Romanian or Russian characters while creating the XML
string.

What I used to do is:
1) Query the MYSQL database that is UTF-8 (the conection is also set by
a query to UTF-8)
2) Create a XML string in PHP using the query results
3) Transform the XML string using a XSLT parser

As I said it all works ok with the English data but when I try using
Russian instead of letters I get question signs. If I try to echo the
Russian text when creating the XML data it is displayed correctly, so
the problem is in the XML string that is somehow not UTF-8 encoded or
what??

Can someone help me?

Feb 10 '06 #2
Thank you! I already found the problem. It is a validator class that
was just cutting all the Russian characters away from the string before
processing. I just didn't notice that in the first place. Sorry.

Feb 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kumar | last post by:
I have the following code SAXBuilder sb = new SAXBuilder(false); sb.build(new File(filename.xml)); The filename.xml file is utf-16 encoded. However, i get java.lang.InternalError while...
8
by: Anders Eriksson | last post by:
Hello! I want to extract some info from a some specific HTML pages, Microsofts International Word list (e.g. http://msdn.microsoft.com/library/en-us/dnwue/html/swe_word_list.htm). I want to...
0
by: Ewan B | last post by:
Hi, I'm using Xerces to parse XML files using SAX2, and am wondering if there is any information as to what exceptions are being thrown when certain validation errors occur. Taking a simple...
5
by: Aleksandar Matijaca | last post by:
Hi there, I am in some need of help. I am trying to parse using the apache sax parser a file that has vaid UTF-8 characters - I keep end up getting a sun.io.MalformedInputException error. ...
10
by: George | last post by:
How can I parse an HTML file and collect only that the A tags. I have a start for the code but an unable to figure out how to finish the code. HTML_parse gets the data from the URL document. Thanks...
9
by: srikantht | last post by:
hi, i am trying to open a xml file which is in unicode format utf-16. the file is <?xml version="1.0" encoding="UTF-16"?> <CurrentWeather> <Location>Bombay / Santacruz, India (VABB) 19-07N...
4
by: R Wood | last post by:
Greetings - A recent Perl experiment hasn't turned out so well, which has piqued my interest in Python. The project is this: take a Vcard file exported from Apple's Addressbook and use a...
2
by: ashmir.d | last post by:
Hi, I am trying to parse an xml file using the minidom parser. <code> from xml.dom import minidom xmlfilename = "sample.xml" xmldoc = minidom.parse(xmlfilename) </code> The parser is...
13
by: Phillip B Oldham | last post by:
Is there a standard library for parsing emails that can cope with the different way email clients quote?
1
by: Moistly | last post by:
I am having difficulty parsing a unicode (UTF-16) XML file that has been generated by a 3rd party piece of software. I ideally would like to use XmlDocument though would settle with using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.