Tema: asp -> xml
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/08/2004, 09:12
choroy
 
Fecha de Ingreso: mayo-2002
Mensajes: 197
Antigüedad: 23 años
Puntos: 0
Mira aqui te pongo una pagina que tengo yo en asp para crear una xml, espero que te sirva de ayuda.

Código:
<%Response.ContentType = "text/xml"%>

<?xml version="1.0" encoding="ISO-8859-1"?>

<channel> 

<%

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "db.foros"
sqltxt="select * from foros where codigof="&nforo

set rs=createobject("ADODB.Recordset")
rs.open sqltxt,conn

codigof=rs("codigof")
nombredelforo=rs("foro")
comentariodelforo=rs("comentario")
comentariodelforo=Replace(comentariodelforo,"<BR>","<br>")
comentariodelforo=Replace(comentariodelforo,"<br>","<br/>")

%>

<title><%=nombredelforo%></title> 
<link>http://www.miweb.net/noticiastemadeforo.asp?nforo=<%=nforo%></link> 
<language>es</language> 
<description><% = comentariodelforo%></description><%
rs.close
n=0
%><%
sqltxt2="select * from preguntas where foro="&nforo&" order by ultima desc"
rs.open sqltxt2,conn,3,1

do while not rs.eof
n=n+1
temapregunta=rs("temapregunta")
temapregunta=Replace(temapregunta,"<BR>","<br>")
temapregunta=Replace(temapregunta,"<br>","<br/>")

%>


<item> 
<link>http://www.miweb.net/noticiasmensajesaforo.asp?numero=<%=rs("numero")%>&amp;nforo=<%=nforo%></link><title><%=rs("tematitulo")%></title><description><% =temapregunta %></description></item><%rs.movenext
loop
rs.close
Set RS = Nothing
Conn.Close
Set Conn = Nothing
%></channel>