Andreas,
Many thanks for your (and everyone's) help to date. Am including truncated
sections of the XML (it is from a requirements database tool, DOORS, which
outputs every object, which has many attributes, as an XML object
(doorsobject). even individual table cells have their own object) and one
sample XSL processing loop. The usual caveats about this probably being lousy
code (haven't coded in years and new to XSL to boot). We are taking the XML
file and generating HTML documents from it.
I have included 5 objects, the first not a table and the other 4 make a small
table... I need to go throught the loop processing paragraphs and tables as
they occur. Wasn't sure whether one can build a table cell by cell or better to
output all at once (my first thought) hence needing to gather all objects in
that particular table. Anyhoo, I am rambling, here's the XML then the XSL --
<test-plan>
<doorsobject>
<objectlevel>5</objectlevel>
<objectnumber>1.2.2.2.0-2</objectnumber>
<objecttext>Requirements text info.</objecttext>
<tabletype>TableNone</tabletype>
</doorsobject>
<doorsobject>
<objectlevel>8</objectlevel>
<objectnumber>1.2.2.2.0-2.0-1.0-1.0-1</objectnumber>
<objecttext>Cell 1-1</objecttext>
<tabletype>TableCell</tabletype>
<tablecell>
<tablecellrow>1</tablecellrow>
<tablecellcol>1</tablecellcol>
<tablenumrows>2</tablenumrows>
<tablenumcols>2</tablenumcols>
</tablecell>
</doorsobject>
<doorsobject>
<objectlevel>8</objectlevel>
<objectnumber>1.2.2.2.0-2.0-1.0-1.0-2</objectnumber>
<objecttext>Cell 1-2</objecttext>
<tabletype>TableCell</tabletype>
<tablecell>
<tablecellrow>1</tablecellrow>
<tablecellcol>2</tablecellcol>
<tablenumrows>2</tablenumrows>
<tablenumcols>2</tablenumcols>
</tablecell>
</doorsobject>
<doorsobject>
<objectlevel>8</objectlevel>
<objectnumber>1.2.2.2.0-2.0-1.0-2.0-1</objectnumber>
<objecttext>Cell 2-1</objecttext>
<tabletype>TableCell</tabletype>
<tablecell>
<tablecellrow>2</tablecellrow>
<tablecellcol>1</tablecellcol>
<tablenumrows>2</tablenumrows>
<tablenumcols>2</tablenumcols>
</tablecell>
</doorsobject>
<doorsobject>
<objectlevel>8</objectlevel>
<objectnumber>1.2.2.2.0-2.0-1.0-2.0-2</objectnumber>
<objecttext>Input Condition</objecttext>
<tabletype>TableCell</tabletype>
<tablecell>
<tablecellrow>2</tablecellrow>
<tablecellcol>2</tablecellcol>
<tablenumrows>2</tablenumrows>
<tablenumcols>2</tablenumcols>
</tablecell>
</doorsobject>
</test-plan>
<xsl:for-each select="test-plan/doorsobject">
<xsl:if test='contains(objectnumber,"1.2.2.")'>
<!-- If object level 4, then test header -->
<xsl:if test='contains(objectlevel,"4")'>
<h4>[Test case]
<xsl:value-of select="concat(objectnumber,' ')"/>
<xsl:value-of select="objectheading"/>
</h4>
</xsl:if>
<!-- If object level 5 or greater, then test paragraph or table itself
-->
<xsl:if test='objectlevel > 4'>
<!-- if not a table entry, process like a paragraph -->
<xsl:if test="contains(tabletype,'TableNone')">
<p>
[Am in loop for Test cases]
<xsl:value-of select="objecttext"/>
</p>
</xsl:if>
<!-- If a table entry, check to see if first table entry, then
process entire table, if not, ignore them -->
<xsl:if test="contains(tabletype,'TableCell')">
<xsl:if test="tablecell/tablecellrow < 2">
<xsl:if test="tablecell/tablecellcol < 2">
<p>Found a table beginning</p>
<table border="1">
<!-- the first row is for .0-1.0-1. -->
<!-- Here is where I want to output the
entire table, printing objecttext, in rows/cols -->
<!-- tablenumcols and tablenumrows
being maxs, tablecellrow and tablecellcol being positions -->
<xsl:for-each select=""> <!-- a row -->
<tr>
<xsl:for-each select=""> <!-- a
column -->
<td>
<xsl:copy-of
select="objecttext"/>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</tr>
</table>
<p>end of table for <xsl:value-of
select="objecttext"/>
</p>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:if>
</xsl:for-each>
Regards,
Andrew
Andrew C. Durston
Smiths Aerospace
Electronic Systems - Grand Rapids
616.241.8715
andrew(_dot_)durston(_at_)smiths-aerospace(_dot_)com
</table> </Pre>
<HTML>
<br>
<br>
************************************************<br>
The information contained in, or attached to, this e-mail, may contain
confidential information and is intended solely for the use of the individual
or entity to whom they are addressed and may be subject to legal privilege. If
you have received this e-mail in error you should notify the sender immediately
by reply e-mail, delete the message from your system and notify your system
manager. Please do not copy it for any purpose, or disclose its contents to
any other person. The views or opinions presented in this e-mail are solely
those of the author and do not necessarily represent those of the company. The
recipient should check this e-mail and any attachments for the presence of
viruses. The company accepts no liability for any damage caused, directly or
indirectly, by any virus transmitted in this email.<br>
************************************************<br>
</HTML>