cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulrich Mayring <u...@denic.de>
Subject Re: xsl matching
Date Wed, 19 Jul 2000 11:21:00 GMT
Torsten Curdt wrote:
> 
> <xsl:template match="navigation/item"/>
> <xsl:template match="menu/item"/>
> 
> ..should do it

XSLT is kind of declarative with some recursion and pattern matching, so
you may be better off thinking like this:

<xsl:template match="navigation|menu">
	<!-- do whatever -->
	<xsl:apply-templates/>
	<!-- do whatever -->
</xsl:template>

<xsl:template match="navitem|menuitem">
	<!-- do whatever -->
	<xsl:apply-templates/>
	<!-- do whatever -->
</xsl:template>

But the definitely best (and hardest) way to think XML is something like
this:

<category name="products">
<product name="Computer">
...
</product>
...
</category>

<category name="links">
<link url="http://xml.apache.org/cocoon" pretext="The homepage of the "
linktext="cocoon" posttext=" project"/>
...
</category>

<category name="documents">
<document name="Terms of Business">
...
</document>
</category>

Then you build your menu and navigation bar from this structure, which
is easily re-usable for other applications as well.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Mime
View raw message