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