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

xsl conditional: finding the right node

Subject: xsl conditional: finding the right node
From: Allin Cottrell <cottrell@xxxxxxx>
Date: Thu, 12 Feb 2004 21:21:31 -0500 (EST)
xsl conditional
Sorry if this is confused, but I'm new to xsl.

I'm processing a long list of elements (a command reference for a
computer program).  The enclosing element is "commandlist" and the
individual element is "command".

My problem is this: when I process each "command", I need to check
whether or not it has any sub-elements (arguments, options) of a sort
that would require a display table to be built.

One could explicitly write this down ("needs-table=true|false") as an
attribute of each "command", but I would rather automate it.  I'm
trying to figure out how XSL can know the answer before it reaches the
elements that would need a prior table-start -- and, of course, re-set
the answer when the next "command" comes along.

The pseudo-code for what I'm trying to implement is something like:

Find a "command" element
  Read ahead to see if a table is wanted (does this node have any
                     children of a certain sort?)
    Output basic command info, before table
    Output table-start if wanted
      Output table rows if applicable ...
    Output table-end if wanted
    Continue processing rest of command node

Next command...

-- 
Allin Cottrell
Department of Economics
Wake Forest University, NC

 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.