RE: [xsl] MSXML - Processing non standard characters

Subject: RE: [xsl] MSXML - Processing non standard characters
From: Warren Keane <Warren@xxxxxxxxxxxxx>
Date: Wed, 1 Aug 2001 21:41:02 -0700
I wrote :
>I am trying to transform an HTTP XML document which contains special
>characters using MSXML. I receive the following error when the
>transformation occurs:
>
>XML Error loading ''
>An invalid character was found in text content.
>
>I have no control over the format of the XML document. The XML document
has
><?xml version="1.0"?>in the first line. Microsoft's site says:
Re-encode the
>XML data as proper UTF-8.
>
>I added the following to my XSL file but it still doesn't work: <?xml
>version="1.0" encoding="UTF-8" ?>
>
>Since I can't change the original XML file, how can I resolve this
problem.
>

First, thanks to those of you who responded, all suggested the XML source
document requires an encoding declaration. When I retrieve the XML document
via HTTP, save it to a file and add encoding="ISO-8859-1" to the header,
everything works fine. Without this I get the error above. I have got the
XML doc down to 800 characters with the error and determined that the
offending character is the "1/2" at column 386. Is "ISO-8859-1" the proper
encoding to remedy this situation? 

Here is the XML document:

<?xml version="1.0"?><News><StoryDate>2 August,
2001</StoryDate><FullStory><Commodity>Lean
Hogs</Commodity><BaseSymbol>LH</BaseSymbol><HeadLines>Hogs higher as warm
weather, soaring cutout values underpin trade</HeadLines><Story>Lean hog
futures ended Wednesday's session higher as ongoing cash firmness supports
trade. On the day the market maintained upside momentum forging fresh 3 ½
week highs in rollover dominated activity. Ongoing warm weather conditions
that is stemming hog growth and reducing transportation coupled with higher
pork cutout values also supported boosting cash prices on the day. Midwest
direct trade reported cash trade to be steady to $0.50 per cwt. higher on
account dwindling supplies with Thursday's trade called steady to firm. The
October contract ended the session up 15 points, at
6032.</Story></FullStory></News>

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


Current Thread