here is the actual stylesheet i am using:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:exsl="http://exslt.org/common" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="html"/>
<xsl:variable name="nav-menu">
<item href="/">Home</item>
<item href="/about.xhtml">About</item>
</xsl:variable>
<xsl:template match="document">
<html>
<head>
<meta charset="utf-8" />
<title><xsl:value-of select="title" /></title>
<link rel="stylesheet" type="text/css" href="site.css" />
</head>
<body>
<!-- <xsl:apply-templates select="document('nav-menu.xml')/menu"> -->
<xsl:apply-templates select="exsl:node-set($nav-menu)/item">
<xsl:with-param name="current" select="@name"/>
</xsl:apply-templates>
<xsl:apply-templates select="content" />
</body>
</html>
</xsl:template>
<xsl:template match="item">
<xsl:param name="current"/>
<xsl:choose>
<xsl:when test="@href=$current">
<a class="selected"><xsl:apply-templates/></a>
</xsl:when>
<xsl:otherwise>
<a href="{@href}"><xsl:apply-templates/></a>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="content">
<xsl:apply-templates select="@*|node()" />
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
documents look like this: <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?xml-stylesheet type="text/xsl" href="site.xsl"?>
<document name="about">
<title>About Us</title>
<content>
html content here, to be inserted without change
</content>
</document>
if i use the document() function, with nav-menu.xml looking like this: <menu>
<item href="/">Home</item>
<item href="/about.xhtml">About</item>
</menu>
then i get the menu items, but the test <xsl:when test="@href=$current"> fails