OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [docbook-apps] [XSLT] Determining the entry column


Hello Everyone,

it has been invented... with the great help of the Andrew Welch table
normalization code found at Dawe's site:
http://www.dpawson.co.uk/xsl/sect2/N7450.html#d10392e763
Thanks for sharing.

My slighty enhanced code takes the raw table and adds the colname attribute
if necessary to all the entries. The result is then processed as ussual. As
there is always required info for the entry.colnum template, I can get what
I want. I don't think my xslt code is something amazing and ready for
production use, but it is sufficient for this particular case. If anybody
interested, I can share it somehow.

Regards,
Jan

> -----Original Message-----
> From: honyk [mailto:j.tosovsky@email.cz]
> Sent: Tuesday, August 31, 2010 10:18 PM
> To: docbook-apps@lists.oasis-open.org
> Subject: [docbook-apps] [XSLT] Determining the entry column
> 
> 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-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]