473,513 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

data at the root level is invalid problem

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>
Nov 18 '05 #1
1 1709
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?
jo*************@yahoo.com (jm) wrote in message news:<c6**************************@posting.google. com>...
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>

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5926
by: Korivo | last post by:
Im getting this error while trying to read a xml file that i receive from a POST heres the code: Dim MyXmlReader As XmlTextReader Dim strNodeResult As String Dim NodeType As XmlNodeType Dim...
1
1814
by: Alan Wang | last post by:
Hi there, I got this message ("The data at the root level is invalid. Line 1, position 1.") when I moved the application from my workstation to Windows 2003 web server. But the wired thing the...
2
5474
by: yxq | last post by:
Hello I want to create and delete the folder share, i found that it is ok for generic folder, but it does not work for Root directory(i.e c:\, d:\) The code...
1
1735
by: jm | last post by:
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...
9
6609
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its...
2
10017
by: =?Utf-8?B?am1ncm8=?= | last post by:
I created a web service in visual studio 2003, tested it with a sample.xml file from a vendor we are using, and it worked exactly like it should. I depoloyed it to our server, created a project...
1
4787
by: =?Utf-8?B?am1ncm8=?= | last post by:
I created a web service in visual studio 2003, tested it with a sample.xml file from a vendor we are using, and it worked exactly like it should. I deployed it to our server, created a project...
4
8154
by: johnsonkt | last post by:
hi all , when m trying to validate my xml using xsd file it gives me the following error "Data at the root level is invalid. Line 1, position 1" i tried to open the XML file using IE and there...
2
3208
by: Cirene | last post by:
My ASP.NET project builds fine (VS2008). I added a new web deployment project. When I try to build it I get: Data at the root level is invalid. Line1, position 1. (The file is web.config,...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1594
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.