xsl-list
[Top] [All Lists]

step-by-step work instructions -- recursive apply-templates to cr eate html table

2003-04-09 09:03:25
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 step...ugh...this
xml is clearly awesome...just really hard for a database junky to learn.

Snippet of xml:

<process_steps>
  <step ckbox="yes"><para>This is step 1.</para>
     <step ckbox="no"><para>This is step 1.1.</para>
                                 <para>this is the second paragraph of step
1.1</para>
     </step>
  </step>
  <step ckbox="yes"><para>This is step 2 and contains an empty <measure>
            </measure> element for user input.</para></step>

Trying to get here for output (maintaining this format important--indents
and numbering):
----------------------------------------------------------------------------
---------------------
Complete                Process Steps
----------------------------------------------------------------------------
---------------------   
input="checkbox"    1.  This is step 1.
----------------------------------------------------------------------------
---------------------
                                  1.1  This is step 1.1
                                         <p>This is the second para of 1.1.
----------------------------------------------------------------------------
----------------------
input="checkbox"    2.  This is step 2 with an input textbox for user...

etc.

I won't bother showing you ALL the codes I've tried. Perhaps someone could
give me a sample or tell me how to best proceed...just learning so please be
KIND.

I've created the basic html form with an <xsl:apply-templates/> within it,
then added two simple listitem tables for Safety items and Tools, but when
it comes to the above...I'm lost!

I believe (from all my reading of FAQ and other posts here and elsewhere)
that I need to do a series of apply-templates, but how to put them into a
table? Do all the steps go into one column but formatted for indent=.5", 1",
1.5" etc. to get the right indent? Does each step level go into the next
column and get spanned? How? Please just don't point me to DocBook since
I've REALLY tried that already but failed.

All help much appreciated.  TIA, Kathy



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



<Prev in Thread] Current Thread [Next in Thread>