[xsl] XSL/HTML styling and CSS style sheets

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

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


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

<xsl:output method="html"/>

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

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

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

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



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

Current Thread