p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

xslt thread: raw & in xml parsing using xslt

Message #1 by "John Clarke" <john@h...> on Tue, 11 Jun 2002 15:51:22 +0100
> Folks
> I have an error with my xml/xslt :
> My question is : Is there a way to overcome the "&" in 
> "&minus;" in xml using xslt? or am I going to have to "trap" 
> for the &minus; in my perl script before it is transformed by 
> the parser. The parser effetcively sees the xml as badly 
> formed but can xslt help?

No, XSLT can only process well-formed XML input.
> the xml I need is generated via a process using htmltidy in 
> part of the process (a perl script obtaining data from a 
> database). Tidy helpfully cleans the "copy" which contains 
> the code "&#8722" and converts this to &minus; hence  the xml 
> : <html> <head> <meta name="generator" content="HTML Tidy for 
> Windows (vers 1st April 2002), see > www.w3.org"/> 
> <title>Untitled</title> </head> <body> <p><b>A 
> title &minus; some more text</b></p> some more text </body> </html>

It looks as if you are using the HTML version of tidy: why not use the
option to output XHTML, which is of course well-formed XML? 

Michael Kay
Software AG
home: Michael.H.Kay@n...
work: Michael.Kay@s... 

  Return to Index