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

Re: Man Page Transform and Modes

Subject: Re: Man Page Transform and Modes
From: Michael B Allen <mba2000@xxxxxxxxxx>
Date: Wed, 5 Apr 2006 20:45:30 -0400
man modes
On Wed, 5 Apr 2006 19:24:44 -0500
"Jon Gorman" <jonathan.gorman@xxxxxxxxx> wrote:

> So did using the mutliple modes not work (the other of my two suggestions?)?

Modes work. In fact, I'm now certain that using modes is the correct
technique because SYNOPSIS, DESCRIPTION, RETURNS, etc are really just
different views of the same data (data about functions).

The problem is simply that you cannot define templates that should work
with multiple modes so you end up duplicating many potentially large
templates all over the place.

> ie
> <xsl:template match="daElement" mode="foo bar"
> 
> to match modes foo and bar?  Now that I think about it, it's probably
> only in XSLT 2.0 to do this.  I also think there's a mode like #all
> that matches all.

This is exactly what I need. But both yield an error with my current
processor:

  man.xsl:205:57: Error! Illegal value: description section used for
  QNAME attribute: mode Cause: java.lang.IllegalArgumentException:
  Localname in QNAME should be a valid NCName

I guess I'm not 2.0 yet :-/

> Also, you could always do a named template within.  Doesn't reduce
> clutter completely but helps.
> ie
> 
> <xsl:template match="foo" mode="hi">
> <xsl:call-template name="foo"...

Bingo! That works great:

  <xsl:template match="text()" mode="description">
      <xsl:call-template name="text"/>
  </xsl:template>
  <xsl:template match="text()" mode="returns">
      <xsl:call-template name="text"/>
  </xsl:template>

It's not as clean as the 2.0 way but I'm not duplicating templates all
over the place.

Thanks,
Mike

Current Thread

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.