[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Outputing tables on the fly (Was incrementing mid-stream part 4) - [Long: XML/XSL samples included]


Subject: RE: [xsl] Outputing tables on the fly (Was incrementing mid-stream part 4) - [Long: XML/XSL samples included]
From: "Durston, Andrew (AGRE)" <andrew.durston@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Apr 2004 07:35:43 -0600

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 &gt; 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 &apos;</xsl:text>
    <xsl:value-of select="objecttext"/>
    <xsl:text>&apos;</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.durston@xxxxxxxxxxxxxxxxxxxx

******************************************
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.
******************************************


Current Thread