473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

data at the root level is invalid

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 20 '05 #1
1 1726
Cor
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>

Nov 20 '05 #2

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

Similar topics

3
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
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...
1
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
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...
9
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...

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.