Discussion:
Help: Error when I try to pull data from an XML file in an ASP page.....'ASP 0185 : 8002000e'
(too old to reply)
Billy
15 years ago
Permalink
I'm getting an error when I try to pull data from an XML file in an
ASP page. I think my syntax somewhere is wrong but cant determine
where.

I get this error on the asp output page:

Response object error 'ASP 0185 : 8002000e'
Missing Default Property
/NSCEast/Bomgar/Reporting/Test.asp, line 0
A default property was not found for the object.

I'm trying to pull the data from an XML file within an ASP page to
build a validation form. I will eventually be building upon this page
to pass variables from a dynamically populated asp form page to this
asp response page for processing.

So to start, i'm trying to learn how to retrieve and write out data
from the XML file and write it to the resulting page. The ASP page
code and XML file data are shown below. Can you tell me where i'm
messing up?


XML FIle (portion of it) is here:

<?xml version="1.0" encoding="UTF-8" ?>
- <support_teams>
- <support_team id="1">
<name>FLS Bomgar Administration</name>
<issues />
</support_team>
- <support_team id="2">
<name>ITSC</name>
<issues />
</support_team>
- <support_team id="3">
<name>BES</name>
<issues />
</support_team>
........


.ASP file is here:

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Test</title>
</head>
<body>
<!-- #INCLUDE VIRTUAL="/nsceast/miscellaneous/adovbs.inc" --> <!--
Use "Virtual" rather than "File" for Virtual Path -->
<b><u><font size="4">Test</font></u></b>
<%
' sets ASP code timeout to 180 seconds (defualt is 90 secs)
Server.ScriptTimeout = 180
Dim objXML
Dim objLst
Set objXML = Server.CreateObject("MSXML2.DOMDocument")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.load("https://adpsupport2.adp.com/api/command.ns?
username=*****&password=*********&action=get_support_teams")
Set objLst = Server.CreateObject("MSXML2.DOMDocument")
Set objLst = objXML.getElementsByTagName("support_team/id")
Response.Write objLst
Set objXML = Nothing
Set objLst = Nothing
%>
</body>
</html>
Martin Honnen
15 years ago
Permalink
Post by Billy
<?xml version="1.0" encoding="UTF-8" ?>
- <support_teams>
- <support_team id="1">
<name>FLS Bomgar Administration</name>
<issues />
</support_team>
- <support_team id="2">
<name>ITSC</name>
<issues />
</support_team>
- <support_team id="3">
<name>BES</name>
<issues />
</support_team>
........
Set objLst = Server.CreateObject("MSXML2.DOMDocument")
Drop that line above, it does not make sense to create a second DOMDocument.
Post by Billy
Set objLst = objXML.getElementsByTagName("support_team/id")
Use
objXML.setProperty "SelectionLanguage", "XPath"
Set objLst = objXML.selectNodes("support_teams/support_team")
instead. The argument to selectNodes and selectSingleNode is an XPath
1.0 expression, so it helps to learn XPath 1.0 to find nodes with
selectNodes and selectSingleNode.
Post by Billy
Response.Write objLst
Use code along the following lines instead
For Each team In objList
Response.Write team.GetAttribute("id") & "; " &
team.selectSingleNode("name").text & "<br>"
Next
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
Continue reading on narkive:
Loading...