Thread: web.sitemap
View Single Post
  #2 (permalink)  
Old June 13th, 2008, 08:27 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

As the error message explains (which is also explained in the book) you can only have one root element. In your case, Home is the single root element, so you can't add Test About as a second root element. Move Test About into the Home element and the error goes away:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/" title="Home" description="Home">
        <siteMapNode url="~/Default.aspx" title="Home" description="Go to the homepage" />
        <siteMapNode url="~/Reviews/Default.aspx" title="Reviews" description="Rewievs published on this site">
            <siteMapNode url="~/Reviews/AllByGenre.aspx" title="By Genre" description="All Rewievs Grouped by Genre" />
            <siteMapNode url="~/Reviews/All.aspx" title="All Reviews" description="All Rewievs" />
        </siteMapNode>
        <siteMapNode url="~/About/Default.aspx" title="About" description="About this site">
            <siteMapNode url="~/About/Contact.aspx" title="Contact Us" description="Contact Us" />
            <siteMapNode url="~/About/AboutUs.aspx" title="About Us" description="About Us" />
        </siteMapNode>
        <siteMapNode url="~/Login.aspx" title="Login" description="Log in to this web site" />
        <siteMapNode url="~/TestAbout/Default.aspx" title="Test About" description="About this site">
            <siteMapNode url="~/TestAbout/Contact.aspx" title="Test Contact Us" description="Contact Us" />
            <siteMapNode url="~/TestAbout/AboutUs.aspx" title="Test About Us" description="About Us" />
        </siteMapNode>
    </siteMapNode>
</siteMap>

Hope this helps,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote