RE: [xsl] How to escape invalid characters in XML to XML process

Subject: RE: [xsl] How to escape invalid characters in XML to XML process
From: Jarno.Elovirta@xxxxxxxxx
Date: Wed, 22 Jan 2003 09:44:12 +0200
Hi,

> I'm receiving my input XML from an ASP page, and i get a lot 
> of invalid for
> XML characters. How can I escape/convert these invalid 
> characters for XML
> into valid characters. I need to do this because after the 
> transformation I
> post my output XML once again into a ASP page. This is the process:
>  getXML from ASP --> applyXSLT --> output XML --> 
> validateXML(use Schema)
> --> postXML to ASP
>  Can I do that in XSLT when I receive my input XML by matching these
> characters and convert them? If yes, how? Validation is done 

No. Your XSLT engine uses an XML parser when building the XPath source tree, and if the parser rejects the input, it'll never reach XSLT processing.

Use e.g. sed, perl etc. to fix the input; or better yet, fix the ASP that's generating the ill-formed XML.

Cheers,

Jarno - Dreadful Shadows: Homeless (Cyber edit)

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread