Hi all,
I've spend the last night googling, for a solution... I've learned a lot, but no solution to this:
I have to transform an xml document to an html fragment using XSL. For the original XML to contain special characters I have the following choices:
- Textdata in UTF-8 within CDATA sections
- named HTML entities
- named HTML entities within CDATA sections
Using numeric representation of entities is not possible, since the xml is produced by flash. So translating client-side is not possible due to performance resons, both for client and for server side (PHP) I am not able to find a function to translate to numeric entities.
When I try to parse the doc with XSLT, I either get an error due to using named entities, or the parser swallows special chars altogether, or it leaves the UTF-8 encoded character in. What I need though, is the output haveing named HTML entities.
I have found and tried the following solutions:
- Give the input xml (named entities without CDATA) an HTML DTD. The XSL Processor doesn't throw an error, but the output is still wrong
- Leave the input XML in UTF-8 without entity encoding and use a <xsl

utput method="html" encoding="UTF-8"/> to automatically transform the chars - no use
- both of the above with any comination of encoding/decoding to UTF-8 at serveral points during the program
The only thing that works is using <xsl

utput method="text" encoding="UTF-8"/> with named entities as input, but the the HTML tags in my XSL get swallowed, so that is no practical solution.
Any suggestions are very much appreciated, thanks in advance!