(Classic ASP) Decode HTML Entities found in XML
Demonstrates how to decode HTML entities found in XML.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' Load an XML file containing the following:
' <?xml version="1.0" encoding="UTF-8"?>
' <output>Französische</output>
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Xml")
set xml = Server.CreateObject("Chilkat.Xml")
success = xml.LoadXmlFile("qa_data/xml/hasHtmlEntity.xml")
' Get non-decoded content, then get decoded content.
' Result is Französische
Response.Write "<pre>" & Server.HTMLEncode( xml.Content) & "</pre>"
' Result is Französische
strDecoded = xml.DecodeEntities(xml.Content)
Response.Write "<pre>" & Server.HTMLEncode( strDecoded) & "</pre>"
%>
</body>
</html>
|