Hello Everyone,

I am investigating possibilities of the DB tables export into the given
proprietary format. Now I am stuck with the demand to specify the location
for every table entry in the form column:row.

My test data follows:

   <table frame="none">
      <title>table</title>
        <tgroup cols="3">
          <colspec colname="c1" colnum="1"/>
          <colspec colname="c2" colnum="2"/>
          <colspec colname="c3" colnum="3"/>
          <tbody>
            <row>
              <entry>0:0</entry>
              <entry>1:0</entry>
              <entry morerows="1">2:0</entry>
            </row>
            <row>
              <entry namest="c1" nameend="c2">0:1</entry>
            </row>
            <row>
              <entry>0:2</entry>
              <entry>1:2</entry>
              <entry>2:2</entry>
            </row>
          </tbody>
        </tgroup>
      </table>

This location should match the info in the content of every entry. While the
row number is quite easy to get, retrieving the column number has turned out
to be quite tricky.

I am using the following code with some external calls
(../common/tables.xsl):

<xsl:template match="entry">
  <xsl:variable name="location">
    <!-- column number -->
    <xsl:call-template name="entry.colnum"/>
    <xsl:text>:</xsl:text>
    <!-- row number -->
    <xsl:value-of select="count(../preceding-sibling::row)"/>
  </xsl:variable>
</xsl:template>

The problem is, that entry.colnum template returns the correct values only
when there are sufficient data in the original table (namest and colname
attributes).
With morerows (aka rowspan) it is quite tricky to calculate the given column
number and that task seems to be too complex. Isn't there any overlooked
template in the DB distribution which can handle this and to return the
correct number? ;-)

Is there better place where to discuss these low-level things?

Thanks in advance for any hints.

Regards,
Jan



---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

Reply via email to