
19/08/2009, 18:24
|
| | Fecha de Ingreso: agosto-2009
Mensajes: 3
Antigüedad: 15 años, 8 meses Puntos: 0 | |
Problema con un bucle Estoy intentando procesar un fichero xml pero no consigo solucionar un problema con el bucle de repetición. Al transformarlo en html me aparece sólo el primer elemento pero luego no lee a partir del segundo (quiero que me aparezcan ocho). El código es éste:
<%
Option Explicit
Response.Buffer = True
Dim xml, i
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load ("friends_timeline.xml")
For i = 1 to 8
Dim profile_image_url, name1, text, created_at
profile_image_url = xml.documentElement.childNodes(1).childNodes(9).ch ildNodes(5).text
name1 = xml.documentElement.childNodes(1).childNodes(9).ch ildNodes(1).text
text = xml.documentElement.childNodes(1).childNodes(2).te xt
created_at = xml.documentElement.childNodes(i).childNodes(0).te xt
Set xml = Nothing
%>
<html>
<head>
<title>TWITTER</title>
</head>
<body>
<table width="300" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><img src="<%= profile_image_url %>" ALIGN="LEFT"> <font face="Arial, Helvetica, sans-serif" size="2"> <strong> <%= name1 %> </strong><br>
<%= text %><br>
<% response.write i %>
<font color="#666666" size="1"><%= created_at %>
</div>
</font></font></td>
</tr>
</table>
<%Next %>
<p> </p>
</body>
</html>
¿Alguien me puede ayudar?
El código del fichero XML es el que da twitter, es decir, tiene esta estructura:
<statuses type="array">
<status>
<created_at>Wed Aug 19 21:59:18 +0000 2009</created_at>
<id>3414061222</id>
<text>Orlando is crowded</text>
<source>web</source>
<truncated>false</truncated>
<in_reply_to_status_id/>
<in_reply_to_user_id/>
<favorited>false</favorited>
<in_reply_to_screen_name/>
<user>...
y dentro de user diversos nodos interiores. |