RE: [xsl] HTML Table

Subject: RE: [xsl] HTML Table
From: Jarno.Elovirta@xxxxxxxxx
Date: Wed, 3 Sep 2003 11:42:55 +0300
Hi,

> I'm trying to create a table from an xml file.
> 
> The xml is similar to:

Why can't you show us what the XML source is really like, instead of something similar to?
 
> <A1>
>   <subA1 />
>   <subA2 />
>   <subA3 />
> </A1>
> <B1>
> </B1>
> <C1>
>   <subC1 />
>   <subC2 />
> </C1>
> 
> The table I'm trying to create is:
> 
> <TABLE>
>   <TR>
>     <TD><xsl:value-of select="@A1"/></TD>

Are you trying to generate a result tree, that has elements in XSLT namespace in it?

> I have tried :
> 
>         <table border="1" cellspacing="0">
>           <!--table header cells -->
>           <tr>
>             <tr>Load</tr>
>             <xsl:for-each select="root/data">
>               <th>
>                 <xsl:value-of select="@Ref"/>

Well, this doesn't look like anything remotely similar to the XML source you have above. Could you show a simplified XML source, the desired output, and the stylesheet you have so far?

>               			<input type="button" 
> onClick="alert(@sub)"></input>
> 	      </xsl:otherwise>
>           </xsl:choose>
>           </tr>
>           </xsl:for-each>
>       </table>
>     
> I am also tring to pass the value of @sub to a script function.

You want AVTs for that, see <http://www.w3.org/TR/xslt#attribute-value-templates>.

Cheers,

Jarno 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread