[xsl] xsl: display only a specified node...

Subject: [xsl] xsl: display only a specified node...
From: Jan Krattiger <jan.krattiger@xxxxxxxx>
Date: Mon, 14 Oct 2002 15:29:13 +0200
hi folks

i'm not able to find a solution for that...and my xsl knowledge isn't that
good, so here's the situation:

<sequence stype="ondemand" broadcastID="00">
	<mark ID="m0001" name="testh" time="0:00:00">
			<chapter lang="en" text="test1"/>
	<mark ID="m0002" name="" time="0:00:20" />
	<mark ID="m0003" time="0:00:40" />
	<mark ID="m0004" time="0:01:00" />
	<mark ID="m0005" time="0:01:20">
			<chapter lang="en" text="test2"/>

this xml is used for the data itself and to build up a tree menu structure
like this (that works w/o problems):
       tree menu frame			details frame
---------------------------	-------------------------
|sequence                 |   |                       |
| - mark 0:00:00 (m0001)  |   |                       |
|    - index              |   |                       |
| - mark 0:00:20 (m0002)  |   |                       |
| - mark 0:00:40 (m0003)  |   |                       |
| - mark 0:01:00 (m0004)  |   |                       |
| - mark 0:01:20 (m0005)  |   |                       |
|    - index              |   |                       |
---------------------------   -------------------------


i click on sequence, and on the details frame the stype and broadcastID
attributes are shown (that works w/o problems).
i click on any mark, and the mark info (id / name / time)  is shown in the
details frame. (that works w/o problems)
i click on index under mark (m0001) and ONLY the index, that's belong to
m0001 should be displayed, but i get both...
the one from m0001 and m0005. here's the xsl:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
<xsl:param name="page"/>   i get this from a asp script, so i know which
"tree element" was clicked 
<xsl:param name="markid"/> i get this from a asp script, so i know which
mark was clicked 
<xsl:template match="/">
		<xsl:apply-templates />
<xsl:template match="sequence">
	<xsl:if test="$page = 'sequence'">
			<xsl:value-of select="@broadcastID" />
	<xsl:apply-templates />
<xsl:template match="mark">
	<xsl:if test="$page = 'mark'">
		<xsl:if test="@ID=$markid">
				<xsl:value-of select="@name" />
	<xsl:apply-templates />
<xsl:template match="index">
	<xsl:if test="$page = 'index'">
<xsl:template match="chapter">
		<xsl:value-of select="@text"/>

the problem is that i can't really "identify" the index... so i can't check
which one the xsl should display
it should only show the info that belongs to the clicked tree-element. and
not all the childs from all the marks
as here in the bad example.

and as always please excuse my poor english...

thanks a lot

Jan M. Krattiger

Software Developer

Unit.Net AG
Thurgauerstrasse 54
CH - 8050 Zurich

Email:   jan.krattiger@xxxxxxxx       
Web:     http://unit.net

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread