Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Parseing XML in ASP Page

From: JohnBeschler@-----------.---------.---
To: 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

%>





transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent