[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Man Page Transform and 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|