Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is easier in XSLT2 but you can use the <code>(//*)[position() &amp;lt;= n]</code> idiom in XSLT 1 to iterate n times. I also fixed up your TeX a bit: <code>\bf</code> has been deprecated since latex2e released in back in 1993:-)</p> <hr> <pre><code>&lt;table xmlns="http://www.w3.org/1999/xhtml" border="1" cellspacing="0" cellpadding="0"&gt; &lt;tr&gt; &lt;td valign="top" width="68" colspan="3"&gt; &lt;p&gt;Values&lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="68"&gt; &lt;p&gt;95&lt;/p&gt; &lt;/td&gt; &lt;td valign="top" width="68"&gt; &lt;p&gt;169&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;/td&gt; &lt;td valign="top" width="68"&gt; &lt;p&gt;180&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <hr> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml"&gt; &lt;xsl:output method="text"/&gt; &lt;xsl:template match="xhtml:table[@border='1']"&gt; &lt;xsl:text&gt;\begin{center}&amp;#10;&lt;/xsl:text&gt; &lt;xsl:text&gt;\begin{tabular}{&lt;/xsl:text&gt; &lt;xsl:for-each select="xhtml:tr[1]/*"&gt; &lt;xsl:choose&gt; &lt;xsl:when test="@colspan"&gt; &lt;xsl:for-each select="(//*)[position()&amp;lt;=current()/@colspan]"&gt;c&lt;/xsl:for-each&gt; &lt;/xsl:when&gt; &lt;xsl:otherwise&gt;c&lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt; &lt;/xsl:for-each&gt; &lt;xsl:text&gt;}&amp;#10;&lt;/xsl:text&gt; &lt;xsl:text&gt;\toprule&amp;#10;&lt;/xsl:text&gt; &lt;xsl:for-each select="xhtml:tr"&gt; &lt;xsl:if test="position() != 1"&gt; &lt;xsl:text&gt;\midrule&amp;#10;&lt;/xsl:text&gt; &lt;/xsl:if&gt; &lt;xsl:if test="position() = 2"&gt; &lt;xsl:text&gt;\midrule&amp;#10;&lt;/xsl:text&gt; &lt;/xsl:if&gt; &lt;xsl:for-each select="xhtml:td|xhtml:th"&gt; &lt;xsl:if test="self::xhtml:th"&gt;\bfseries &lt;/xsl:if&gt; &lt;xsl:apply-templates /&gt; &lt;xsl:if test="position() != last()"&gt; &lt;xsl:text&gt;&amp;amp;&lt;/xsl:text&gt; &lt;/xsl:if&gt; &lt;/xsl:for-each&gt; &lt;xsl:if test="position()!=last()"&gt; \\&amp;#10;&lt;/xsl:if&gt; &lt;/xsl:for-each&gt; &lt;xsl:text&gt;\end{tabular}&amp;#10;&lt;/xsl:text&gt; &lt;xsl:text&gt;\end{center}&lt;/xsl:text&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <hr> <pre><code>\begin{center} \begin{tabular}{ccc} \toprule Values \\ \midrule \midrule 95 &amp; 169 &amp; 180 \end{tabular} \end{center} </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload