Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/08/2006, 10:47
Emerald
 
Fecha de Ingreso: mayo-2006
Mensajes: 243
Antigüedad: 19 años
Puntos: 0
Exclamación Error al usar Microsoft.XMLDOM con ASP

Hola!

Soy nueva en cuestion de usar XML con ASP.
Tengo el siguiente código que dependiendo del contenido en dos XML crear una tabla en html con datos:
Código:
Dim numero_seccion_seleccionada
dim nombre_archivo

Set xmlDoc2 = Server.CreateObject("Microsoft.XMLDOM")
xmlDoc2.async = false
xmlDoc2.setProperty "ServerHTTPRequest", True
xmlDoc2.validateOnParse = False
xmlDoc2.resolveExternals = False

xmlDoc2.load("http://www.mipagina.com.mx/rss/sec.xml")

%>
<% If xmlDoc2.parseError.errorCode <> 0 Then %>
	<%= xmlDoc2.parseError.errorCode %>
	<br>
	<%= xmlDoc2.parseError.reason %>
	<br>
	<%= xmlDoc2.parseError.line %>
	<br>
<% Else 
	set seccion_seleccionada = xmlDoc2.getElementsByTagName("seleccionado")
	set nombres_rss = xmlDoc2.getElementsByTagName("nombreRSS")
End If %>
<%
	numero_seccion_seleccionada=seccion_seleccionada.item(0).firstChild.nodeValue
	nombre_archivo=nombres_rss.item(numero_seccion_seleccionada).firstChild.nodeValue 
	nombre_archivo=nombre_archivo & ".xml"
	
	dim xmlTitle
	dim xmlLink
	dim title
	dim link
	Set xmlDoc2 = Server.CreateObject("Microsoft.XMLDOM")
	xmlDoc2.async = false	
	xmlDoc2.setProperty "ServerHTTPRequest", True
	xmlDoc2.validateOnParse = False
	xmlDoc2.resolveExternals = False
	xmlDoc2.load("http://www.mipagina.com.mx/rss/"+nombre_archivo)													
%>
<% If xmlDoc2.parseError.errorCode <> 0 Then %>
	<%= xmlDoc2.parseError.errorCode %>
	<br>
	<%= xmlDoc2.parseError.reason %>
	<br>
	<%= xmlDoc2.parseError.line %>
	<br>
<% Else 
	set xmlTitle = xmlDoc2.getElementsByTagName("item/title")
	set xmlLink = xmlDoc2.getElementsByTagName("item/link")
End If 

%>

<!--- Mancheta TitularesNot&iacute;cias --->
<table width="138" border="0" cellspacing="0" cellpadding="0" valign="TOP" ID="Table1">
<tr><td width="1" rowspan="3" class="mchor">&nbsp;</td>
	<td width="138" height="1" class="mchor"><img width=1 height=1 /></td>
	<td rowspan="3" class="mchor">&nbsp;</td></tr>
<tr><td class="mch2">&nbsp;Titulares</td></tr>
<tr><td height="1" class="mchor"><img width=1 height=1 /></td></tr>
</table>

<!--- Imagen--->
<table width="138" border="0" cellspacing="0" cellpadding="0" valign="TOP" ID="Table2">
<tr>
<td rowspan="2" class="tblor">&nbsp;</td>
	<td class="tbl">

		
<table width="136" border="0" cellspacing="4" cellpadding="0" ID="Table3">
<tr><td height=1 class=spc colspan=2>&nbsp;</td></tr>
<%  For n = 0 To xmlTitle.length-1 
		title = xmlTitle.item(n).firstChild.nodeValue
		link=xmlLink.item(n).firstChild.nodeValue
%>
	<tr><td width="10" valign="top" class=nar align=right>&nbsp;&raquo;&nbsp;</td>
	<td class="tx2"><a href="<%= link %>" class="tx2"><%= title %></a></td>
	</tr>
<% Next %>
</table>
	</td>
	<td rowspan="1" class="tblor">&nbsp;</td>
	</tr>
	<tr><td height="1" class="tblor"><img width=1 height=1 /></td>
	</tr>
	<tr><td class="spc" height=14>&nbsp;</td>
	
	</tr>
</table>
Pero me marca el siguiente error:

-2147012889
System error: -2147012889.
0

Microsoft VBScript runtime error '800a01a8'

Object required: 'seccion_seleccionada'

/stage/asp/titulares.asp, line 29

la línea 29 es la siguiente:

Código:
numero_seccion_seleccionada=seccion_seleccionada.item(0).firstChild.nodeValue
Agradezco su ayuda

Última edición por Emerald; 10/08/2006 a las 11:51