Foros del Web » Programación para mayores de 30 ;) » .NET »

Una Ayudita con este error please...

Estas en el tema de Una Ayudita con este error please... en el foro de .NET en Foros del Web. No se puede mostrar la página XML No se puede ver la entrada XML con la hoja de estilo . Corrija el error y haga ...
  #1 (permalink)  
Antiguo 19/01/2005, 20:52
Avatar de univercity  
Fecha de Ingreso: noviembre-2002
Mensajes: 681
Antigüedad: 21 años, 6 meses
Puntos: 0
Una Ayudita con este error please...

No se puede mostrar la página XML
No se puede ver la entrada XML con la hoja de estilo . Corrija el error y haga clic en el botón Actualizar, o inténtelo de nuevo más tarde.


--------------------------------------------------------------------------------

El documento XML debe tener un elemento de nivel superior. Error al procesar el recurso

ese, ese el error que me muestra...

este otro es el codigo completo...




<%@ Page language="c#" ContentType="text/xml" AutoEventWireup="false" Codebehind="otro.aspx" %>
<%@ Import Namespace="System.Data" %>
<%@ import Namespace="System.Data.OleDb" %>

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
// Connect to the Database
OleDbConnection myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("../bdwine/articulos.mdb"));
// Retrieve the SQL query results and bind it to the Repeater
string SQL_QUERY = "SELECT TOP 5 " +
"FROM tabla1 ORDER BY id DESC";
OleDbCommand myCommand = new OleDbCommand(SQL_QUERY, myConnection);

// bind the results to the Repeater
myConnection.Open();
rptRSS.DataSource = myCommand.ExecuteReader();
rptRSS.DataBind();
myConnection.Close();
}


protected string FormatForXML(object input)
{
string data = input.ToString(); // cast the input to a string

// replace those characters disallowed in XML documents
data = data.Replace("&", "&amp;");
data = data.Replace("\"", "&quot;");
data = data.Replace("'", "&apos;");
data = data.Replace("<", "&lt;");
data = data.Replace(">", "&gt;");

return data;
}

</script>

<asp:Repeater id="rptRSS" runat="server">
<HeaderTemplate>
<rss version="2.0">
<channel>
<title>ASP.NET News!</title>
<link>http://www.ASPNETNews.com/Headlines/</link>
<description>
This is the syndication feed for ASPNETNews.com.
</description>
</HeaderTemplate>

<ItemTemplate>
<item>
<title><%# FormatForXML(DataBinder.Eval(Container.DataItem,"T itulo")) %></title>
<description>
<%# FormatForXML(DataBinder.Eval(Container.DataItem,"C opete")) %>
</description>
<link>
http://www.ASPNETNews.com/Story.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "id") %>
</link>
<author><%# FormatForXML(DataBinder.Eval(Container.DataItem,"f oto")) %></author>
<pubDate>
<%# String.Format("{0:R}",
DataBinder.Eval(Container.DataItem, "fecha")) %>
</pubDate>
</item>
</ItemTemplate>

<FooterTemplate>
</channel>
</rss>
</FooterTemplate>
</asp:Repeater>
__________________
"Lo importante es nunca dejar de hacerse preguntas"
Albert Einstein
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:10.