[xsl] Confused with templates and XPath

Subject: [xsl] Confused with templates and XPath
From: Jarkko.Moilanen@xxxxxx
Date: Thu, 8 Jan 2004 12:54:58 +0200
Hi,

I am trying to learn howto use FrameMaker to build XML-applications. This fact
is irrelevant here, but just mentioned it as prologie =)

I took a look at the xslt file that this software uses and I found something
that I really cant say to understand. Here are two snippets:


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

<xsl:template match="chapter/para">
	<span class="chapterpara"><xsl:value-of select="."/></span>
</xsl:template>

Doesnt the //para apply to any para in the document? Then why is there
another template for chapter/para? Is the latter one going to override the
previous template? Or is this all about the context from where these
templates are applyed or something like that?

Any comments would be appreciated.

I cant give you any sourcetree example... sorry.

Cheers,
Jarkko


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


Current Thread