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

RE: step-by-step work instructions -- recursiveapply-t

Subject: RE: step-by-step work instructions -- recursiveapply-templ ates to cr eate html table
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Date: Wed, 9 Apr 2003 14:39:55 -0400
work instructions
Americo,

This is really nice...once I figure out how to get the text in the steps and
include the other para subelements...

For my learning purposes...would you mind explaining what these two lines
do?

   <xsl:variable name="space" select="(count(ancestor::step) * 13 + 1) *
7"/>

   <xsl:if test="not(ancestor::step)">

Thanks again.

Kathy

-----Original Message-----
From: Américo Albuquerque [mailto:aalbuquerque@xxxxxxxxxxxxxxxx]
Sent: Wednesday, April 09, 2003 1:36 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  step-by-step work instructions -- recursive
apply-templates to cr eate html table


Hi.

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Kathy Burke
> Sent: Wednesday, April 09, 2003 5:03 PM
> To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'
> Subject:  step-by-step work instructions -- recursive 
> apply-templates to cr eate html table
> 
> 
> I've been asking for help with this on dev forum so please 
> forgive me if this is a cross-post. No one seems to want to 
> help me on this one...? I've tried looking at doc book for 
> examples, but SO complicated I can't figure it out. I've also 
> read this FAQ and other posts ...very enlightening but my XML 
> "light" hasn't quite gone on yet!
> 
> I'm trying to create a table for work instructions: up to 5 
> nested <step> elements with sub elements sometimes included 
> (measure, href, etc.) I've tried combinations of 
> choose/when/if etc. but either I get the numbering correct 
> (which needs to be outline format 1., 1.1, 1.1.1, 1.1.1.1, or
> 1.1.1.1.1) or it also numbers the multiple para's within a 

You can do this with <xsl:number level="multiple" count="step"
format="1.1"/>


You could try this and change it to your needs:

 <xsl:template match="process_steps">
 <table border="0">
  <xsl:apply-templates/>
 </table>
 </xsl:template>
 
 <xsl:template match="step">
  <xsl:variable name="space" select="(count(ancestor::step) * 13 + 1) * 7"/>
  <tr>
   <td width="140" valign="top">
    <xsl:apply-templates select="@ckbox[.='yes']"/>
   </td>
   <td valign="top">
    <table width="100%" border="0">
     <tr>
      <td valign="top" width="{$space}">
       <table border="0">
        <tr>
         <td width="{$space}">&#160;</td>
         <td>
         <xsl:number level="multiple" count="step" format="1.1"/>
         <xsl:if test="not(ancestor::step)"><xsl:text>.</xsl:text></xsl:if>
         <xsl:text>&#9;</xsl:text>
        </td>
       </tr>
      </table>
      </td>
      <td>
       <xsl:apply-templates select="*[not(self::step)]"/>
      </td>
     </tr>
    </table>
   </td>
  </tr>
  <xsl:apply-templates select="step"/>
 </xsl:template>
 
 <xsl:template match="@ckbox">
  <input type="checkbox">
   <xsl:if test=".='yes'"><xsl:attribute
name="checked">checked</xsl:attribute></xsl:if>
  </input>
 </xsl:template>
 
 <xsl:template match="para">
  <p>
   <xsl:apply-templates/>
  </p>
 </xsl:template>
 
 <xsl:template match="measure">
  <!-- you could also use a textarea instead -->
  <input type="text" value="{.}"/>
 </xsl:template>





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



 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.