[xsl] using variables and attributes to build output tree

Subject: [xsl] using variables and attributes to build output tree
From: Eric Smith <Eric.Smith@xxxxxxxxxxxx>
Date: Tue, 13 Nov 2001 17:39:25 +0100

I currently use this conditional to determine whether to apply a

  <xsl:template match="sub">
      <xsl:if test=" 
    ( $output='proposal' and ( ancestor::proposal or @proposal)  ) 
    ( $output='executive' and ( ancestor::executive or @executive)  ) 
    ( $output='retail' and ( ancestor::retail or @retail)  ) 
    ( $output = 'subsidy' and ( ancestor::subsidy or @subsidy ))


This conditional allows user to create nodes with names that
relate to particular outputs.  In addition you can define an
attribute in a selected node with <sub proposal="1">.

However I now want to define attributes more flexibly, so 
I thought three extra attributes viz.

would fill all conditions we need, but these need to be able
to be lists (not just because they have an '@' for a perl array :)).

so we can then say:
<para @include='executive<some_separator>retail'>
and use xsl regex in the conditional to match any of these.

The other part of my question is how do I establish the above
conditional for all templates but only have it occur once in the xsl
(and not in each template, which is silly).

I tried with a named template but failed.
Eric Smith - currently xalan and fop on linux

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

Current Thread