[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XPath to find first cell in first row of table

Subject: XPath to find first cell in first row of table
From: "Mark Giffin m1879@xxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Sep 2016 01:14:53 -0000
 XPath to find first cell in first row of table
I have an XML table like below from which I am constructing a roughly matching XSL-FO table, and I need to insert something extra only in the first cell of the first row, as indicated:

   <table>
     <title>My title</title>
     <tgroup cols="3">
       <colspec colname="C1" />
       <colspec colname="C2" />
       <colspec colname="C3" />
       <thead>
         <row>
           <entry> text </entry>
           <entry> text </entry>
           <entry> text </entry>
         </row>
       </thead>
       <tbody>
         <row>
           <entry> <!-- insert something extra here only --> text </entry>
           <entry> text </entry>
           <entry> text </entry>
         </row>
         <row>
           <entry> text </entry>
           <entry> text </entry>
           <entry> text </entry>
         </row>
       </tbody>
     </tgroup>
   </table>

There are templates matching each element: table, tbody, row, entry, etc. In the <entry> template, how might I check if the current entry is the first one in the first row? Or is there a better way?

<xsl:template match="entry">
<xsl:if test="MAGICAL XPATH that tells if it's the first cell in the first row">
<fo:block> insert special things </fo:block>
</xsl:if>
<fo:block xsl:use-attribute-sets="entry">
...
</fo:block>
</xsl:template>


Thanks,
Mark

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.