View Single Post
  #5 (permalink)  
Old March 1st, 2007, 01:22 PM
kwilliams kwilliams is offline
Banned
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

Thanks for pointing that out. I reviewed the section, and applied it to my page with some success. I'm on the "About Us" page, and I want to create a link to the "Area Links" page. But my setup is only pulling some of the attributes for the "About Us" page from the Web.sitemap doc, whether or not I try to specify another id attribute. This is how I have the XSLT doc set up:

XSLT DOC:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sitemap="http://localhost:1309/phase3/Web.sitemap">
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
        <xsl:apply-templates select="*"/>
    </xsl:template>
</xsl:stylesheet>
HTML OUTPUT:
About UsThis page contains basic information about us.
(NOTE: Only the title and description attributes are displayed from the Web.sitemap doc for the About Us page)

I also tried adding another template to the page with a call for the Area Links page, like this:
[/code]...
    <xsl:template match="/">
        <xsl:apply-templates select="*"/>
    </xsl:template>
    <xsl:template match="sitemap/siteMap/siteMapNode/siteMapNode/siteMapNode[@id='arealinks']">
        <xsl:apply-templates/>
    </xsl:template>
</xsl:stylesheet>[/code]

...but I just received this error message:
Exception Details: System.Xml.XPath.XPathException: Expression must evaluate to a node-set.

I also tried this:
Code:
<xsl:apply-templates select="sitemap/siteMap/siteMapNode/siteMapNode/siteMapNode[@id='arealinks']"/>
    </xsl:template>

    <xsl:template match="/">
        <xsl:apply-templates/>
    </xsl:template>

...and again, only the two About Us attributes were shown.

If you could let me know what I'm doing wrong, it would be greatly appreciated.

KWilliams
Reply With Quote