RE: [xsl] Including inc files in xsl

Subject: RE: [xsl] Including inc files in xsl
From: "SANWAL, ABHISHEK (HP-Houston)" <abhishek.sanwal@xxxxxx>
Date: Tue, 27 Jan 2004 17:08:57 -0600
The following is how I have embedded non-xml data into the XSL files
such that they have them in the result output.

e.g. Embedding the data in styles.css into the result

Hope that helps.

****************************

<!-- This DOCTYPE declaration ENTITY "stylescss" serves the following
purposes:
- allows the CSS file to be independent of the XSLs before compilation
- allows the CSS styles to be embedded into the output HTML on the fly
(instead of being linked)
-->

<!DOCTYPE xsl:stylesheet [
<!ENTITY stylescss SYSTEM "styles.css">
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="Document">
<html>
<head>

<xsl:comment>Embed the Cascading Style Sheet (CSS) data from
styles.css</xsl:comment>
<!-- Embed the Cascading Style Sheet (CSS) data from styles.css -->

<style type="text/css">
<xsl:comment>
&stylescss;
</xsl:comment>
</style>

</head>
<body bgcolor="#FFFFFF">
<!-- Apply templates and g

 

____________________________________________________________

Abhishek Sanwal
HP - Houston Campus

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of David
Carlisle
Sent: Tuesday, January 27, 2004 3:33 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Including inc files in xsl



> I tried both the ways 
> 
> <!--#include virtual="myinclude.inc"-->

This is just a comment in the stylesheet so has no effect on the result.
 
>  and
>  
>  <xsl:comment>#include
>  virtual="myinclude.inc"</xsl:comment>
> 
> it did not work for me.
> 

what do you mean by didn't work?
It should create the comment
<!--#include virtual="myinclude.inc"-->
in the result tree, which was your stated requirement.
It will not of course include the file, that would be the job of your
server side inclusion system (ASP or whatever you are\using)

David

-- 
http://www.dcarlisle.demon.co.uk/matthew

 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