XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old July 14th, 2003, 01:56 PM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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.

Reply With Quote
  #2  
Old July 14th, 2003, 02:53 PM
mrusaw's Avatar
mrusaw mrusaw is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Dallas, Texas
Posts: 138 mrusaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to mrusaw Send a message via Yahoo to mrusaw
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Table Data Not Displaying


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway