upper ascii in XML

  • Thread starter Thread starter Arne
  • Start date Start date
A

Arne

What is the proper way to inserting uppe ascii into an xml node
<![CDATA[<firstName>â</firstName>]]>
causes an error in IE 8
 
Arne said:
What is the proper way to inserting uppe ascii into an xml node
<![CDATA[<firstName>â</firstName>]]>
causes an error in IE 8

XML builds on and supports Unicode so I don't see why you would get a
problem if you use such characters in a properly encoded UTF-8 or UTF-16
document. You could even use other encodings that IE or the XML parser
you want to use supports as long as you have an XML declaration
declaring that encoding.

If you still need help then please state exactly which error you get and
if that XML document is online please post a URL.
If you use code to insert "into an xml node" then please show us the
exact code.
 
An invalid character was found in text content. Error processing resource
'http://ndpsw2kdw1:3333/resourcelocator/contact/s...

<firstName>

<?xml version="1.0" ?>
<contacts customerNumber="1130577">
<contact id="159" contactType="SALES REP">
<businessPhone>321-242-2055</businessPhone>
<cellPhone></cellPhone>
<homePhone></homePhone>
<emailAddress>[email protected]</emailAddress>
<fullName>Bob Comparato</fullName>
<firstName>â</firstName>
<middleInitial></middleInitial>
<lastName></lastName>
<address address1="1316 BERRI PATCH PL STE 6" address2="" address3=""
address4="" city="MELBOURNE" stateCode="FL" postalCode="32935-5523" />

<collateralitem filename=""/>
</contact>
</contacts>

Unfortunately my database is not designed with unicode support.
That is why I am couting on upper ASCII.


--
Certified Geek, Professional Data Dude
(Doing classic ASP to get paid, and WPF for fun.)


Martin Honnen said:
Arne said:
What is the proper way to inserting uppe ascii into an xml node
<![CDATA[<firstName>â</firstName>]]>
causes an error in IE 8

XML builds on and supports Unicode so I don't see why you would get a
problem if you use such characters in a properly encoded UTF-8 or UTF-16
document. You could even use other encodings that IE or the XML parser
you want to use supports as long as you have an XML declaration
declaring that encoding.

If you still need help then please state exactly which error you get and
if that XML document is online please post a URL.
If you use code to insert "into an xml node" then please show us the
exact code.
 
Arne said:
An invalid character was found in text content. Error processing resource
'http://ndpsw2kdw1:3333/resourcelocator/contact/s...

<firstName>

<?xml version="1.0" ?>
<contacts customerNumber="1130577">
<contact id="159" contactType="SALES REP">
<businessPhone>321-242-2055</businessPhone>
<cellPhone></cellPhone>
<homePhone></homePhone>
<emailAddress>[email protected]</emailAddress>
<fullName>Bob Comparato</fullName>
<firstName>â</firstName>
<middleInitial></middleInitial>
<lastName></lastName>
<address address1="1316 BERRI PATCH PL STE 6" address2="" address3=""
address4="" city="MELBOURNE" stateCode="FL" postalCode="32935-5523" />

<collateralitem filename=""/>
</contact>
</contacts>

It is not possible to tell from a newsgroup posting how that file is
encoded. Make sure it is UTF-8 encoded or UTF-16 encoded (and has a BOM)
or make sure the file has an XML declaration with the encoding e.g.
<?xml version="1.0" encoding="ISO-8859-1"?>
where ISO-8859-1 is just an example, I don't know the encoding.
 
encoding="ISO-8859-1" seems have taken care of my problem.
Upper ascii are now displayed
Thanks.
 
Back
Top