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:
  #1  
Old September 12th, 2003, 04:46 AM
Paulinit Paulinit is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: London
Posts: 2 Paulinit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Display format across the page not down!

Hi all,

I am new to Xslt but fast getting the hang of things...

The trouble is I have run into a problem regarding how the results of my .xsl file are display in the html page, basically the end result I want to achieve is to format the results across the page and not down it.. e.g.

1 2 3
4 5 6
7 8 9

and not ..


1
2
3
4
5
6


Hope you can help... here is the code I have so far:



<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:template match="/">
<html>
<head>
<title>Lets test this out</title>
<style type="text/css">
.tname {font-family:Tahoma;font-size:14pt;font-weight:bold}
.tdesc {font-family:Tahoma;font-size:1pt}
.tsaletxt {font-family:Tahoma;font-size:14pt;font-weight:bold;color:gray;}
.tprice {font-family:Tahoma;font-size:18pt;font-weight:bold;color:red;text-align:center}
</style>
</head>
<body>
<xsl:apply-templates select="/Offers/Offer[MerchantCategory= 'Fashion | Lingerie | Briefs'][Manufacturer='Sloggi']">
<xsl:sort select="Manufacturer" order="ascending"/>
</xsl:apply-templates>
</body>
</html>
</xsl:template>









<xsl:template match="Offer">
<table border="1" cellpaddig="0" cellspacing="0" width="199">
<tr>
<td width="166">
<a href="{ActionURL}">
<img src="{ReferenceImageURL}" width="86" height="117" alt="{OfferName}" />
</a>
<div class="tdesc">

<xsl:value-of select="OfferName"/><br/><br/>

</div>
<div class="tprice"> Regular Price: <xsl:value-of select="RegularPrice"/><br/>
</div>
<xsl:if test="CurrentPrice < RegularPrice">
<div class="tsaletxt"> OUR SALE PRICE </div>
<xsl:apply-templates select="CurrentPrice"/>
</xsl:if>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>

Reply With Quote
  #2  
Old September 12th, 2003, 08:10 AM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,569 jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 22 h 42 m 51 sec
Reputation Power: 835
If you "float" each table "left" with CSS then they will be next to each other. The added advantage here (though may be undesirable) is that they will float until they have no room left in the containing element. So if you're using 100% of the body, a user under 800x600 would get 4 accross, but a user with 1024x768 would get 5 accross -- IOW, the tables will fill the available space and then wrap for you automagically.

If that's not a viable solution for you, you need to use one table, end the row when you reach three cells, then continue it. You can use the "mod" expression in an <xsl:if> statement to determine if you're at the end of a row. Unfortunately I don't have time to work up an example for you. Sorry.
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Display format across the page not down!


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

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT