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

Re: HTML Table

Subject: Re: HTML Table
From: "M. David Peterson" <conners_dad@xxxxxxx>
Date: Wed, 3 Sep 2003 02:34:03 -0600
html table onclick
am I missing something?  unless what you wrote was just a hypothetical and 
you just looked over the fact that you were using the attribute selector to 
select a nodes value...  your using '@SubA1' (etc...) to access the value of 
'SubA1' when you should just be using 'SubA1'...

I apologize for assuming that this wasn't a typo but it was fairly obvious 
so I thought I would eliminate this part of the problem first...

Let me know if you need further help...

M.


----- Original Message ----- 
From: <v.kavanagh@xxxxxxxxxxxx>
To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, September 03, 2003 2:21 AM
Subject:  HTML Table


>
>
> Hello,
>
> I'm trying to create a table from an xml file.
>
> The xml is 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>
>     <TD><xsl:value-of select="@B1"/></TD>
>     <TD><xsl:value-of select="@C1"/></TD></TR>
>   <TR>
>     <TD><xsl:value-of select="@subA1"/></TD>
>     <TD></TD>
>     <TD><xsl:value-of select="@subC1"/></TD>
>   </TR>
>   <TR>
>     <TD><xsl:value-of select="@subA2"/></TD>
>     <TD></TD>
>     <TD><xsl:value-of select="@subC1"/></TD>
>  </TR>
>  <TR>
>      <TD><xsl:value-of select="@subA3"/></TD>
>      <TD></TD>
>      <TD></TD>
>  </TR>
> </TABLE>
>
> 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"/>
>
>               </th>
>             </xsl:for-each>
>           </tr>
>         <!-- Generate a row for each sub element -->
>         <xsl:for-each select="root/data">
> <xsl:for-each select="sub">
>           <tr>
>           <xsl:choose>
>           <xsl:when test="not(node())"/>
>           <td></td>
>           </xsl:when>
>           <xsl:otherwise>
> <xsl:value-of select="@sub"/>
>               <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.
>
> Many thanks,
>
> Vince.
>
> -----------------------------------------
> Email provided by http://www.ntlhome.com/
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
> 

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


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.