View Single Post
  #1 (permalink)  
Old March 1st, 2007, 11:27 AM
kwilliams kwilliams is offline
Points: 1,561, Level: 16
Points: 1,561, Level: 16 Points: 1,561, Level: 16 Points: 1,561, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jul 2005
Location: , , .
Posts: 317
Thanks: 0
Thanked 0 Times in 0 Posts
Default Calling Web.Sitemap from XSLT

I have a site that uses the Master Page method in ASP.NET, and it contains a Web.sitemap doc that contains all of the navigation for the site. The Web.sitemap doc is basically an XML doc, so I was hoping that I could pull data from it using the XSLT document method, like this:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="" >
  <siteMapNode url="~/default.aspx" title="Home Page" id="default">
    <siteMapNode url="~/aboutus/aboutus.aspx" title="About Us" description="This page contains basic information about us." id="aboutus" />
XSLT doc:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>

<xsl:variable name="websitemap" select="document('http://localhost:1309/phase3/Web.sitemap')" />
    <xsl:template match="/">
        Link: <xsl:value-of select="$websitemap/siteMap/siteMapNode/siteMapNode[@id='aboutus']" /><br />
...but it's not working. Is this setup possible? If so, what am I doing wrong? Thanks for any help.

Reply With Quote