[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL design question

Subject: Re: XSL design question
From: Tom Schutzer-Weissmann <xsl@xxxxxxxxxxxxxxxx>
Date: Tue, 2 Sep 2003 19:09:28 +0000
bertie xsl
Hi Pete,
[...]
><!ELEMENT title (#PCDATA | b | i | tt | index)*>
[..]
> This won't work either:
>
> <xsl:apply-templates select="*[not(self::index)]"/>

How doesn't it work? It should, in "title" context, because it means apply 
templates to every child that isn't an index. eg

<xsl:template match="title">
	<xsl:apply-templates select="*[not(self::index)]"/>
</xsl:template>

[...]
> This, too will not work:
>
> <xsl:apply-templates select="*[not(descendant::index)]"/>
[...]
This shouldn't work (if the context node is a "title") because it means apply 
templates to all children that don't have an index descendant. 

You could use modes, just as you suggested:
<xsl:template match="title">
	<xsl:apply-templates mode="toc"/>
</xsl:template>
<xsl:template match="i|b|tt" mode="toc">
	<!-- do something -->
</xsl:template>
<xsl:template match="index" mode="toc"/> <!-- do nothing -->

Some very organised people use modes all the time, except for the first 
template that matches /.

Tom SW
--
"The facts are hideous, but we must face them" - Bertie Wooster


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


Current Thread
  • XSL design question
    • pcarey - Tue, 2 Sep 2003 13:06:37 -0400 (EDT)
      • David Carlisle - Tue, 2 Sep 2003 13:30:44 -0400 (EDT)
      • Tom Schutzer-Weissmann - Tue, 2 Sep 2003 14:11:24 -0400 (EDT) <=
      • <Possible follow-ups>
      • pcarey - Tue, 2 Sep 2003 19:09:11 -0400 (EDT)

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.