PDA

View Full Version : XML


Ramin
7th June 2000, 02:32
Hi I am having trouble getting the XML parsed using ASP. Can not load the xml document using the load command. Any subjection?

<%
dim objXML
dim objXSL

dim sServer
dim sPasswd
dim dblPort

sServer = "server.name"
sPasswd = "password"
dblPort = 8000

Set objXML = Server.CreateObject("MSXML.DomDocument")
Set objXSL = Server.CreateObject("Microsoft.XMLDOM")


objXML.async = false
objXML.validateOnParse = false
if objXML.load("http://" & sServer & ":" & dblPort & "/admin.cgi?pass=" & sPasswd & "&mode=viewxml") then
objXSL.async = false
objXSL.load Server.MapPath("ShoutStyleWUsers.xsl")
ShoutcastXML objXML.transformNode(objXSL)
Response.Write objXML.transformNode(objXSL)
else
Set xPE = objXML.parseError
With xPE
strErrText = "Your XML Document failed to load" & _
"due the following error." & vbCrLf & _
"Error #: " & .errorCode & ": " & xPE.reason & _
"Line #: " & .Line & vbCrLf & _
"Line Position: " & .linepos & vbCrLf & _
"Position In File: " & .filepos & vbCrLf & _
"Source Text: " & .srcText & vbCrLf & _
"Document URL: " & .url
End With

Response.Write strErrText
end if

%>

Ramin
14th June 2000, 01:49
The problem I found is in the XML TAG section:

LISTENERS and SONGHISTORY

If I remove it manually it works. I am not sure what is causing the problem.
Can anyone help?

thanks

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Ramin:
Hi I am having trouble getting the XML parsed using ASP. Can not load the xml document using the load command. Any subjection?

&lt;%
dim objXML
dim objXSL

dim sServer
dim sPasswd
dim dblPort

sServer = "server.name"
sPasswd = "password"
dblPort = 8000

Set objXML = Server.CreateObject("MSXML.DomDocument")
Set objXSL = Server.CreateObject("Microsoft.XMLDOM")


objXML.async = false
objXML.validateOnParse = false
if objXML.load("http://" & sServer & ":" & dblPort & "/admin.cgi?pass=" & sPasswd & "&mode=viewxml") then
objXSL.async = false
objXSL.load Server.MapPath("ShoutStyleWUsers.xsl")
ShoutcastXML objXML.transformNode(objXSL)
Response.Write objXML.transformNode(objXSL)
else
Set xPE = objXML.parseError
With xPE
strErrText = "Your XML Document failed to load" & _
"due the following error." & vbCrLf & _
"Error #: " & .errorCode & ": " & xPE.reason & _
"Line #: " & .Line & vbCrLf & _
"Line Position: " & .linepos & vbCrLf & _
"Position In File: " & .filepos & vbCrLf & _
"Source Text: " & .srcText & vbCrLf & _
"Document URL: " & .url
End With

Response.Write strErrText
end if

%&gt;<HR></BLOCKQUOTE>

oddsock
14th June 2000, 03:44
Make sure you have the latest Shoutcast server, there were some major XML bugs in some of the earlier releases, and specifically, I think one was with the LISTENER tag...

oddsock