Hey all,
Going to answer my own question... :) (Note: get this list as digest mode, so
won't see this and other responses til morning)
I found if I extend the string compare, in the table, for objectnumber from
positions 1-4 to 1-12, then I can separate out the following tables in the same
section. (Then 1.2.2.2.0-2. and 1.2.2.2.0-24 are different)
Andrew C. Durston
Smiths Aerospace
Electronic Systems - Grand Rapids
616.241.8715
andrew(_dot_)durston(_at_)smiths-aerospace(_dot_)com
-----Original Message-----
From: Durston, Andrew (AGRE)
Sent: Tuesday, April 20, 2004 9:36 AM
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject: RE: [xsl] Outputing tables on the fly (Was incrementing
mid-stream part 4) - [Long: XML/XSL samples included]
Andreas,
Thanks again. One quick hitch I came across, at the same point in the document
(1.2.2.xxx) there can be multiple tables imbedded (of various sizes). I have
one imbedded at objectnumber=1.2.2.2.0-2.0-1.0-1.0-1 and another one at
objectnumber=1.2.2.2.0-4.0-1.0-1.0-1 for example.
I do know that when the requirement tool (DOORS) creates a table, the first
element is always objectnumber=X.Y.Z.0-1.0-1.0-1 (a table following
objectnumber=1.5.4 would be 1.5.4.0-1.0-1.0-1 for example) and flagged as
tabletype=TableCell.
So I guess I need to modify the table-row template to process only the 1st row
of the first table encountered (now it seems to be concatenating the 1st row of
all tables encountered at that level). Do the tablenumcols and tablenumrows
variables become relevant now?
<xsl:template match="doorsobject[objectlevel > 5 and
tabletype='TableCell' and
tablecell/tablecellrow=1 and
tablecell/tablecellcol=1]">
<!-- If object level 5 or greater, and a table entry,
and first table entry, then initiate table-creation -->
<p>Found a table beginning</p>
<table border="1">
<xsl:apply-templates select=". |
following-sibling::doorsobject[
starts-with(objectnumber,substring(
current()/objectnumber,1,6)) and
objectlevel = current()/objectlevel and
tabletype=current()/tabletype and
tablecell/tablecellcol=
current()/tablecell/tablecellcol]"
mode="table-row" />
</table>
<p>
<xsl:text>end of table starting at '</xsl:text>
<xsl:value-of select="objecttext"/>
<xsl:text>'</xsl:text>
</p>
</xsl:template>
Otherwise the templates look terrific. I can modify them to handle the other
sections of the document format (and any tables encountered there) as needed
(sections other than 1.2.2... :) ).
Regards,
Andrew
Andrew C. Durston
Smiths Aerospace
Electronic Systems - Grand Rapids
616.241.8715
andrew(_dot_)durston(_at_)smiths-aerospace(_dot_)com
******************************************
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.
******************************************