[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Handling invalid characters

Subject: RE: Handling invalid characters
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 2 Oct 2006 22:34:56 +0100
handling invalid characters in xml
XSLT can only handle well-formed XML documents, so you need to fix the
problem at the point where you are generating XML: that is, in your php
function. In fact, it goes without saying that if you have code that
attempts to generate XML, it should always generate well-formed XML.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: Huynh Bao-E11524 [mailto:bao.huynh@xxxxxxxxxxxx] 
> Sent: 02 October 2006 21:42
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Handling invalid characters
> 
> Hi all,
>  
> Is there a way to handle/discard invalid characters?
>  
> Problem:
> I have to use data from several different sources that have 
> different/unknown encoding types.  I store all of them in a 
> MySQL db using ISO-8859-1 encoding.  A php function grabs the 
> data and fits it into XML format.  When I use the XML file as 
> input to an xsl transform, I get "Invalid character 
> (character code 25) detected".
>  
> Possible solutions:  
> 1) I would prefer to somehow convert all invalid characters to valid
> ISO-8859-1 (I also have control of the php function)
> 2) Delete all the invalid characters
> 3) Display them as gibberish in my documents
> 4) Basically anything that won't cause an error and will let 
> the transform continue
>  
> Any lead would be much appreciated,
> Thanks,
> Bao

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.