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

using variables and attributes to build output tree

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

I currently use this conditional to determine whether to apply a
template:


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

    <fo:block>
    ...
    <apply-templates/>
    ...


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.
@include
@exclusive
@reject

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

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.