[xsl] HTML Table

Subject: [xsl] HTML Table
From: v.kavanagh@xxxxxxxxxxxx
Date: Wed, 3 Sep 2003 8:21:37 +0000


I'm trying to create a table from an xml file.

The xml is similar to:

  <subA1 />
  <subA2 />
  <subA3 />
  <subC1 />
  <subC2 />

The table I'm trying to create is:

    <TD><xsl:value-of select="@A1"/></TD>
    <TD><xsl:value-of select="@B1"/></TD>
    <TD><xsl:value-of select="@C1"/></TD></TR>
    <TD><xsl:value-of select="@subA1"/></TD>
    <TD><xsl:value-of select="@subC1"/></TD>
    <TD><xsl:value-of select="@subA2"/></TD>
    <TD><xsl:value-of select="@subC1"/></TD>
     <TD><xsl:value-of select="@subA3"/></TD>

I have tried :

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

        <!-- Generate a row for each sub element -->
        <xsl:for-each select="root/data">
		<xsl:for-each select="sub">
          	<xsl:when test="not(node())"/>
			<xsl:value-of select="@sub"/>
              			<input type="button" onClick="alert(@sub)"></input>
I am also tring to pass the value of @sub to a script function.

Many thanks,


Email provided by http://www.ntlhome.com/

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

Current Thread