[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] include css in xsl


Subject: Re: [xsl] include css in xsl
From: "TP" <tpass001@xxxxxxxxxxx>
Date: Wed, 19 Mar 2003 10:55:03 -0600

Thanks Passin and Blix (interesting name)

This is the xsl below
==================================================
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:lxslt="http://xml.apache.org/xslt"
    xmlns:counter="MyCounter"
    extension-element-prefixes="counter"
    version="1.0">

<xsl:output method = "html" />
 <xsl:template match="message">
<html>
   <head>
   <link rel="stylesheet" href="..\css\style.css" type="text/css"
media="screen"/>
  </head>
<body>
  etc...
</body>
</html>
</xsl:template>
</xsl:stylesheet>
==================================================

the filesystem is as
WEB-INF
-- classes
-- lib
-- xslt
---- this.xsl
-- css
---- style.css

This is a subset of the entire stylesheets. The reason I am saying that is
because my stylesheets use templates and include/import other stylesheets
which are getting resolved properly. I use the implement URIResolver in my
servlet so that the files are picked up from the appropriate folder.

You know those errors which you think are nothing but take a long time to
resolve but end up being something small. this cud be one of them.

I appreciate the help.

Thanks.

TP.
----- Original Message ----- 
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, March 19, 2003 10:23 AM
Subject: RE: [xsl] include css in xsl


> [ I have copied this question over to the right thread.  Please respond
> to this thread]
>
> It sounds as if you are expecting something to happen that is not going
> to happen.  the html code you show below is apparently in an html file
> (the output of your transformation, I imagine?).  At this point, when
> you load the file into a browser, no xslt transformation is going to be
> invoked.  On the other hand, the css stylesheet should be applied to the
> page, via the "link" element.
>
> If that is not happening, probably the path to the css file is wrong, or
> the css file is not valid css.  Perhaps the external css file contains
> xml instead of css (it should not have a "style" element, for example)?
>
> You have to decide whether your xslt stylesheet is going to insert the
> __css text__ from an xml file into your html output document, or whether
> it is going to insert a reference to a css file, as you have it below.
> You cannot succees with a mix and match approach.
>
> Cheers,
>
> Tom P
>
> > > [ TP]
> > > > I wrote this in the head of the xsl
> > > > ----------------------------------------------------------------
> > > > <head>
> > > > <link  rel="stylesheet" href="style.css" type="text/css"/>
> > > > </head>
> > > > ----------------------------------------------------------------
> > > > It did not pick it up..... any ideas.....
> > > >
> > >
> > > What do you mean?  What do you mean by "the head of the xsl"?
> >
> > This is the code that apears in "View source"
> >
> > <html>
> > <head>
> > <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
> > <title>Test</title>
> > <link media="screen" type="text/css" href="../css/style.css"
> > rel="stylesheet">
> > </head>
> > <body>
> > etc....
> >
> > I dont belive that the xsl is picking up the css file when it
> > renders the
> > html.
> >
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>

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



Current Thread
Keywords