W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2002

converting from HTML to WML

From: mariam aziz <mariam_louis_aziz@yahoo.com>
Date: Mon, 6 May 2002 14:57:45 -0700 (PDT)
Message-ID: <20020506215745.12252.qmail@web14104.mail.yahoo.com>
To: html-tidy@w3.org

Dear sir
iam still have the problem of coverting table from HTML to WML 
without presenting it as table by border
i arriver to an idea but i face some problems in implemening it 
by XSL the idea is
get the max of length of strings in the previous column of <td> 
then get the string length of previos td in same row
so calculate space as max-length of prev td in same column+1

so space between first td and second td in first row calculated as
max(1,2,3) (length of a,length of ab,length of abc) which is 3
length of prev td which is length of a which is 1 so final requires space is
the result will be

a   xyz
ab  xyzm
abc xyzx

what i implement is getting max string length of prev col
but problem is getting the length of prev td in same col
and how can i loop by the result value to generate no of spaces equal to result no

code which i write
 <xsl:template match="tr">

 <xsl:template match="td">

  <xsl:variable name="po">
  <xsl:value-of select="position()"/>

<xsl:variable name="o">
<xsl:value-of select="position() div 2"/>
<xsl:if test="$o!='1'">
<xsl:variable name="oy">
<xsl:value-of select="position()"/>

<!-- i have problem here><xsl:variable name="len"><xsl:value-of select="string-length(//tr[position()=$o]/td[position()=$o - 1])"/></xsl:variable>

<xsl:variable name="op">
<xsl:for-each select="//tr/td[position()=$o - 1]">
<xsl:sort select="string-length(.)" order="descending" data-type="number"/>
<xsl:value-of select="string-length(.)"/>

<xsl:variable name="max">
<xsl:value-of select="substring-before($op,'~')"/>

<xsl:variable name="final">
<xsl:value-of select="$max+1-$len"/>

<! another problem how to loop with final value to get spaces>
<xsl:if test="$final>'0'">
<xsl:apply-templates select="td" mode="s"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$final - 1"/>


wait for your reply
please help me

Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
Received on Monday, 6 May 2002 17:57:46 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:38:51 UTC