Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/05/2004, 02:07
juanpastor
 
Fecha de Ingreso: septiembre-2003
Mensajes: 19
Antigüedad: 20 años, 8 meses
Puntos: 0
Leer XML desde ASP

Hola a todos,
Estoy queriendo leer un XML desde ASP y no lo consigo ni a la de tres. Me dice qie el file XML no existe. ¿Sabe alguien por qué?

Gracias de antemano

config.xml
Error: config.xml does not exist

El asp es el siguiente:

<html>

<body>
<%
'find xml file path
dim strFilename,strXMLFile
strFilename = "config.xml"
strXMLFile=server.mapPath(strFilename)
' standard "create xml object" code
Set oXML = server.createObject("Microsoft.XMLDOM")
oXML.async=False
' check file exists
response.write(strFilename)
bitFileExists = oXML.load("config.xml")
if not bitFileExists then
response.Write("<h1>Error: " & strFilename & " does not exist</h1>")
response.End
end if
if oXML.parseError.errorCode <> 0 then
response.Write("There is a parsing error on your file (" & strFilename & ") " & oXML.parseError.reason & "<p>")
response.Write("Line: " & oXML.parseError.line & " Position: " & oXML.parseError.linepos)
response.end
end if
Set lstElements = oXML.getElementsByTagName("item")
for each tmpElement in lstElements
response.Write("<p>Name: " & tmpElement.childnodes(0).text & "<br>")
'response.Write(" Email:" & tmpElement.childnodes(1).text)

next



%>

</body></html>