XPath for comparing different files

Subject: XPath for comparing different files
From: "Robert Soesemann" <rsoesemann@xxxxxxxxxxx>
Date: Mon, 5 Jul 2004 13:11:50 +0200
Hello,

I am working on an xsl to create a breadcrumb trail on a page based on
an XMl-formated sitemap.
In the XML file where I want to render the breadcrumb I look for
elements like this: <breadcrumb pageid="XYZ"/>

Then I search for a <page id="XYZ" .../> node which id attribute is the
same as the "pageid" attribute of the breadcrumb.

THE PROBLEM IS: I dont' know how to compare the @id of the sitemap's
<page> node and the <breadcrumb>'s @pageid attribute in the select of
line 6. Right now the XSL is looking for @pageid in the sitemap file
instead inside the <br

Thats what my XSL looks like:
1:	...
2:	- TODO: externalize sitemap url as application-specific
parameter for breadcrumb.xsl -->
3:	xsl:variable name="sitemap-nodes"
select="document('sitemap.xml')"/>
4:
5:	xsl:template match="breadcrumb">
6:		<xsl:variable name="current-page"
select="$sitemap-nodes//page[@id = @pageid]"/> 
7:		....
^^^^^^^^^^^^^^^^^^^
 
|||||||||||||||||||

Thank for your help and best regards,

Robert S

Current Thread