Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it proper to use css files in XSL?

Status
Not open for further replies.

danylo13

Programmer
May 23, 2007
7
CA
Hi,

I'm just wondering if it is a proper practice to link css files to XSL files. For example, I want a special formatting class for my table.
If so, how do you add it to the XSL file?
Thanks.
 
>wondering if it is a proper practice to link css files to XSL files
Not sure understand the meaning of it. If you mean using xsl to produce a link in the output document, sure you can make one with some template.
 
well the thing I wasn't sure about was that I know you use css to format html pages and xsl to format xml pages.. so if I wanted to transform a xml file to html using xsl is there some way to embed css files in there (for stuff like table borders, font, etc.)
 
Maybe something figuratively like this to clear up the reasoning.
[tt]
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="abc.css" />
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
[/tt]
You just make one link up for the html output document to reference to.
 
Amendment
Even figuratively, I should close out <head> tag.
[tt]
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="abc.css" />
[red]</head>[/red]
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top