Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Parseing XML in ASP Page Parseing XML in ASP PageTo: NULL Date: 11/1/2005 5:05:00 AM I've searched the MSDN library and I can;t find an answer to this question:
How do I parse an XML file within an ASP page?
We just purchased a google mini and it returns its results in XML. I need to
capture those results and parse them so that I can strip out pages that the
user does not have security access to.
I have tried using the WinHTTP service, and that allows me to capture the
output of the google min; however, when I try to parse that using MSXML, I
get an error: Switch from current encoding to specified encoding not
supported.
The encoding from the google mini is "<?xml version="1.0"
encoding="ISO-8859-1" standalone="no" ?> "
Here is the actual code from my page that loads the output from the google
mini:
<%
Dim xmlDoc
Set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.3.0")
Dim root
Dim oNodeList
Dim Item
xmlDoc.async = false
xmlDoc.load("C:\Temp\google.xml")
if xmlDoc.parseError.errorCode <> 0 Then
Dim myErr
Set myErr = xmlDoc.parseError
Response.Write "You have error " + myErr.reason
Else
root = xmlDoc.documentElement
oNodeList = root.childNodes
for i = 0 to oNodeList.length
Item = oNodeList.item(i)
Response.Write Item.xml
Next
End If
%>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
