PC Review


Reply
Thread Tools Rate Thread

data at the root level is invalid

 
 
jm
Guest
Posts: n/a
 
      27th Feb 2004
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>
 
Reply With Quote
 
 
 
 
Cor
Guest
Posts: n/a
 
      28th Feb 2004
Hi Jm,

I real thing that you have much more change on an answer in the newsgroup

Aspnet
<news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet>

Web interface:

<http://communities2.microsoft.com/co...s/?dg=microsof
t.public.dotnet.framework.aspnet>

Although maybe others see, I saw no VB language in your code.

I hope this helps a little bit?

Cor
> 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>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Data at the root level is invalid. Line 1 Position1 =?Utf-8?B?WE1MIG5ld2JpZTogVXJnZW50IHBscyBoZWxwIQ== Microsoft VB .NET 0 10th Mar 2006 07:31 PM
data at root level is invalid sonu Microsoft Dot NET 0 25th Jan 2006 05:00 AM
The data at the root level is invalid. Line 1, position 1 Alan Wang Microsoft ASP .NET 1 5th Aug 2005 10:56 PM
XML err: there is invalid data at the root level, line 1,position =?Utf-8?B?TmVhbA==?= Microsoft Dot NET 0 15th Apr 2005 12:54 PM
data at the root level is invalid problem jm Microsoft ASP .NET 1 1st Mar 2004 09:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:22 AM.