Question : how to handle  Encoding Format ,XML Parsing Error: not well-formed?

Error is "XML Parsing Error: not well-formed" if its utf-8 encoding is choosen

Is der any other character like this which cause problems since i dont have control , whether am retriving all suitable character which doesnt harm the tag since my db holds even Word document content which has numerous symbols.
Why other encoding like utf-8 exists how can i choose encoding which works for all .

Yes, ISO-8859-1 which doesnot causes this error , so is it the best one for encoding someway am not able to understand encoding stuff ?

Note : Xml files are created using ASP Files from db . which is not a issue .

i want to know ,
how to handle this ?
what are the illegal character which doesnot support xml ? Like SQL apostrophe Causes error similarly is der anything in XML which shld be handled?
which encoding is the best that suit all ?

Am curious to know kinda bugs in  xml ?


1:
2:
3:
4:
5:
ASP Code
<%
'I copied pasted the charcter which caused that error ??
Response.write("Character Making Issues How to handle these — "&" This is not minus symbol something else")
%>
Attachments:
 
Save it as .XML file
 

Answer : how to handle  Encoding Format ,XML Parsing Error: not well-formed?

Set oXML = Server.CreateObject("MSXML2.DomDocument.6.0")
oXML.async = False: oXML.resolveExternals = False
Set oRoot = oXML.createElement("root")
oXML.appendChild oRoot

Do While Not Rs.Eof
    Set oNode = oXML.createElement("heydon")
    Set oSubNode = oXML.createElement("test")
    oSubNode.text = rs(0)
    oNode.AppendChild(oSubNode)
    Set oSubNode = oXML.createElement("test")
    oSubNode.text = rs(1)
    oNode.AppendChild(oSubNode)
    oRoot.AppendChild(oNode)

    oRS.MoveNext
Loop


Random Solutions  
 
programming4us programming4us