|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
Table Data Not Displaying
My table data is not displaying when i render the page and the resulting html i snot what i expect (it seems to be looping through one too many times.).
XML: Code:
<table border="1"> <tr> <th/>KIND<th/> <th/>TYPE<th/> </tr> <tr> <td/>Police motorcycle unit<td/> <td/>*<td/> </tr> <tr> <td/>Fire engine Company<td/> <td/>1<td/> </tr> <tr> <td/>Medical team<td/> <td/>*<td/> </tr> <tr> <td/>Helicopter<td/> <td/>2<td/> </tr> <tr> <td/>Search dogs<td/> <td/>2<td/> </tr> </table> XSL: Code:
<xsl:template match="table">
<table cellspacing="0" cellpadding="0" border="{@border}">
<xsl:for-each select="tr">
<tr>
<xsl:apply-templates select="th"/>
</tr>
</xsl:for-each>
</table>
</xsl:template>
<xsl:template match="th">
<th align="{@align}" valign="{@valign}" colspan="{@colspan}" rowspan="{@rowspan}">
<xsl:apply-templates/>
</th>
</xsl:template>
<xsl:template match="td">
<td align="{@align}" valign="{@valign}" colspan="{@colspan}" rowspan="{@rowspan}">
<xsl:apply-templates/>
</td>
</xsl:template>
__________________
mr... mike.rusaw@realpage.com RalPage, Inc. "I have made this letter longer than usual, only because I have not had the time to make it shorter." - Blaise Paschal Last edited by mrusaw : July 14th, 2003 at 04:51 PM. |
|
#2
|
||||
|
||||
|
Sorry i am an idiot and copied and pasted malformed elements. Thanks... Long day already.
Also, I tried the <xsl:copy-of> but it only writes to my html page the data and not all the data and html formatting: Code:
Copy outputs: KINDTYPEPolice motorcycle unit*Fire engine Company1Medical team*Helicopter2Search dogs2 Code:
My xsl outputs: <table cellspacing="0" cellpadding="0" border="1"> <tr> <th align="" valign="" colspan="" rowspan="">KIND</th> <th align="" valign="" colspan="" rowspan="">TYPE</th> </tr> <tr> <td align="" valign="" colspan="" rowspan="">Police motorcycle unit</td> <td align="" valign="" colspan="" rowspan="">*</td> </tr> <tr> <td align="" valign="" colspan="" rowspan="">Fire engine Company</td> <td align="" valign="" colspan="" rowspan="">1</td> </tr> <tr> <td align="" valign="" colspan="" rowspan="">Medical team</td> <td align="" valign="" colspan="" rowspan="">*</td> </tr> <tr> <td align="" valign="" colspan="" rowspan="">Helicopter</td> <td align="" valign="" colspan="" rowspan="">2</td> </tr> <tr> <td align="" valign="" colspan="" rowspan="">Search dogs</td> <td align="" valign="" colspan="" rowspan="">2</td> </tr> </table> ***If you know of an easier or more efficient way to do this please let me know! Last edited by mrusaw : July 14th, 2003 at 03:14 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Table Data Not Displaying |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|