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

XSL/HTML styling and CSS style sheets

Subject: XSL/HTML styling and CSS style sheets
From: "Jackson Zettler" <jacksonzettler@xxxxxxxx>
Date: Thu, 4 Dec 2003 09:42:10 -0500
xsl html
Hello,

I am a newbie to XSL. ?My first XSL project is to try to turn one of my html
pages into an XML/XSL page and I am trying to figure out how to make my page
look the same way it did when it was just html.? I was kinda hoping that I
could just embed my CSS the same way I used to in the html page:

<link rel="stylesheet" type="text/css" href="/styles.css">

But this doesn?t work.

What is the best way to style my XSL page? ?I have been playing around with
templates and xsl-attributes but it seems like I should just be able to use
my old CSS?s to style the page.

Can I do this?? How do I do this?? If not what should I be doing?

I?ve included my XSL document.? As of now I?m just moving little parts of
the html page in to see what I can get working and looking the same as it
did before.

I am also having a problem with non-regular ascii characters displaying in
the browser as you can see in the data below; this is transferred to the
browser and is never translated for display.

XML:

<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="/fdm4styles/drill-down2.xsl"?>
<page>
?<product parent="8715">
??<description>Georgian Oil Color Introduction Set</description>
? <vendor>Daler-Rowney</vendor>
?</product>
?<product>
? <description>Georgian Oil Colors</description>
? <vendor>Daler-Rowney</vendor>
? <subproduct parent="501">
? ?<description>38 ml. Tubes</description>
? </subproduct>
? <subproduct parent="501">
? ?<description>225 ml. Tubes</description>
? </subproduct>
? <subproduct parent="501">
? ?<description>115 ml. Tubes</description>
? </subproduct>
?</product>
?<product parent="2004">
? <description>Georgian Oil Painting BeginnerÂ? s Set</description>
? <vendor>Daler-Rowney</vendor>
?</product>
</page>

XSL:

<xsl:stylesheet version="1.0"
??????????????? xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
??????????????? xmlns:fo ="http://www.w3.org/1999/XSL/Format">

<xsl:output method="html"/>

<xsl:template match="/">
<html> 
?<head>
? <title>TEST</title>
?</head>
?<body>
? <table border="0" width="617" cellpadding="0" cellspacing="0">
?? <tr>
??? <td>
???? <table border="1" width="100%" cellpadding="0" cellspacing="0">
? 
????? <tr> 
?????? <td align="center" colspan="2">Found Products</td> 
????? </tr> 
????? <tr><td height="10" colspan="2"></td></tr>

????? <xsl:for-each select="page/product">
????? <tr>
?????? <xsl:if test="position() mod 2 = 0">
??????? <xsl:attribute name="bgcolor">lightgrey</xsl:attribute>
?????? </xsl:if>
?? 
?????? <td width="33%"><xsl:apply-templates select="vendor"/></td> 
?????? <td><xsl:apply-templates select="description"/></td>????? 
????? </tr>
????? </xsl:for-each>

???? </table>
??? </td>
?? </tr>
? </table>
?</body>
</html>
</xsl:template>?? 
?? 
<xsl:template match="vendor">
? <xsl:value-of select="."/>
</xsl:template>

<xsl:template match="description">
?<xsl:value-of select="."/>
</xsl:template>

</xsl:stylesheet>

Jackson



 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.