data at the root level is invalid problem

J

jm

I get "data at the root level is invalid." I have changed security
for the IUSR_xx to be in the adminstrators (tried anonymous access);
changed all the file security I could; tried virtual directories and
file paths. I have googled and googled. Any ideas why it cannot load
this file? It is not the files, I believe, I didn't make them they
are from 4guysfromrolla. Any ideas what is causing this bug? Thanks
for any help.

http://aspnet.4guysfromrolla.com/articles/051403-1.aspx

Consider (from 4guysfromrolla.com):

<%@ Page Language="vb" autoeventwireup="false" %>
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.ODBC" %>
<%@ import Namespace="System.Web.UI.WebControls" %>
<form runat="server">
<iewc:TreeView runat="server">
<iewc:TreeNode runat="server" Text="ASP.NET Books" Expanded="True"
TreeNodeSrc="c:\www\inetpub\aspnetbooks.xml"
TreeNodeXsltSrc="c:\www\inetpub\aspbooks2treeview.xsl"
/>
</iewc:TreeView>
</form>

Here is the XML file

<?xml version="1.0" encoding="UTF-8"?>
<books>
<book price="34.95">
<title>Teach Yourself Active Server Pages 3.0 in 21 Days</title>
<authors>
<author>Mitchell</author>
<author>Atkinson</author>
</authors>
<year>1999</year>
</book>

<book price="29.95">
<title>Designing Active Server Pages</title>
<authors>
<author>Mitchell</author>
</authors>
<year>2000</year>
</book>

<book price="34.95">
<title>ASP.NET: Tips, Tutorials, and Code</title>
<authors>
<author>Mitchell</author>
<author>Mack</author>
<author>Walther</author>
<author>Seven</author>
<author>Anders</author>
<author>Nathan</author>
<author>Wahlin</author>
</authors>
<year>2001</year>
</book>

<book price="24.95">
<title>ASP Unleashed</title>
<authors>
<author>Walther</author>
</authors>
<year>1998</year>
</book>

<book price="32.45">
<title>ASP.NET Unleashed</title>
<authors>
<author>Walther</author>
</authors>
<year>2002</year>
</book>

<book price="31.95">
<title>Creating Data Driven ASP.NET Applications</title>
<authors>
<author>Seven</author>
</authors>
<year>2002</year>
</book>

<book price="29.95">
<title>ASP.NET Data Web Controls Kick Start</title>
<authors>
<author>Mitchell</author>
</authors>
<year>2003</year>
</book>

<book price="19.95">
<title>Programming ASP.NET</title>
<authors>
<author>Liberty</author>
<author>Hurwitz</author>
</authors>
<year>2002</year>
</book>
</books>


Here is the stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:template match="/books">
<TREENODES>
<xsl:for-each select="book">
<treenode>
<xsl:attribute name="text">
<xsl:value-of select="title" />
</xsl:attribute>

<treenode>
<xsl:attribute name="text">
Price - $<xsl:value-of select="@price" />
</xsl:attribute>
</treenode>

<treenode text="Authors">
<xsl:for-each select="authors/author">
<treenode>
<xsl:attribute name="text">
<xsl:value-of select="text()" />
</xsl:attribute>
</treenode>
</xsl:for-each>
</treenode>

<treenode>
<xsl:attribute name="text">
Year Published - <xsl:value-of select="year" />
</xsl:attribute>
</treenode>
</treenode>
</xsl:for-each>
</TREENODES>
</xsl:template>
</xsl:stylesheet>
 
J

jm

I found that the only reason this failed was because:

autoeventwireup="false"

was there. I removed the entire line and it worked. Setting the
value to "true" will also cause it to work.

Is this a bug or by design?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top