XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
steven matthewsSubject: Using the include statement
Author: steven matthews
Date: 28 Dec 2006 11:21 AM
HI Team,

I am trying to use the following statement to include another .xsl file called CSS.xsl in a file called view_halls.xsl.

<xsl:include href = "CSS.xsl" />

File CSS.xsl contains a typical HTML stylesheet

I cannot get it to work ! Any suggestions would be welcome.

Both files are attached ...

Steven Matthews


UnknownCSS(1).xsl
CSS styleseet

Unknownview_halls(1).xsl
XSL file

Postnext
Minollo I.Subject: Using the include statement
Author: Minollo I.
Date: 29 Dec 2006 10:25 AM
Originally Posted: 28 Dec 2006 01:12 PM
I *guess* what you want to do is to change view_hall.xsl into something like...

...
<xsl:include href = "CSS.xsl" />
<xsl:template match="/SERVICES">
<html>
<body>
<xsl:call-template name="defineStyles"/>
<xsl:variable name = "A" ><xsl:value-of select="ERROR"/></xsl:variable>
<xsl:choose>
<xsl:when test="starts-with($A,'Error')">
...

...and change CSS.xsl into something like...

...
<xsl:template name="defineStyles">
<style type="text/css">
<![CDATA[
...

That way your styles are defined in the right position, and you control when to call the template that takes care of that definition.

Postnext
steven matthewsSubject: Using the include statement
Author: steven matthews
Date: 29 Dec 2006 08:43 AM
Hi There,

Thanks for your reply.

I have implemented your suggestions but I still cannot get this to work.

File view_halls.xsl now looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href = "CSS.xsl" />
<xsl:template name="defineStyles" />
<xsl:template match="/SERVICES" >
<html>
<body>
......
...... etc

File CSS.xsl now looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name = "defineStyles">

<style type="text/css">
<![CDATA[

... CSS stylesheet here ...

]]>
</style>

</xsl:template>
</xsl:stylesheet>

The XSLT engine complains about the use of

<xsl:template name="defineStyles" />

in file 'view_halls.xsl', since there are now 2 <xsl:template.. statements.

Any suggestions welcome,


Steven Matthews



Postnext
(Deleted User) Subject: Re: Using the include statement
Author: (Deleted User)
Date: 29 Dec 2006 09:04 AM
Hi Steven,

>I have implemented your suggestions but I still cannot get this to work.
>
>File view_halls.xsl now looks like this:
>
><?xml version="1.0" encoding="ISO-8859-1"?>
><xsl:stylesheet version="1.0" xmlns:xsl="
><xsl:include href = "CSS.xsl" />
><xsl:template name="defineStyles" />

I think this line should be

<xsl:call-template name="defineStyles" />

Hope this helps,
Alberto

Posttop
steven matthewsSubject: Re: Using the include statement
Author: steven matthews
Date: 01 Jan 2007 04:04 PM
Thanks Alberto,

Everything now works !

Steven Matthews


PS I see that you too are a family man ...

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.