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
Tadd StuartSubject: Conditional Imports
Author: Tadd Stuart
Date: 24 Jan 2007 10:23 AM
Is there a way to conditionally control the importing of child stylesheets? Here is the master stylesheet with what I would like to do.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="ClassEligibility.xsl"/>
<xsl:import href="GeneralHeader.xsl"/>
<xsl:import href="GeneralPolicy.xsl"/>
<xsl:import href="ProposedRates.xsl"/>
<xsl:import href="Demographics.xsl"/>
<xsl:import href="StandardProvisions.xsl"/>
-- if (some condition is true)
<xsl:import href="ManualRates.xsl"/>
<xsl:import href="DiscountedRates.xsl"/>
-- end if

<xsl:output method="html"/>

<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
<xsl:value-of select="Root/Heading/RequestName"/>&#xA0;
<xsl:value-of select="Root/Heading/CreateDate"/>&#xA0;
<xsl:value-of select="Root/Heading/CreateTime"/></title>
<link href="style/Output.css" type="text/css" rel="stylesheet"/>
</head>
<body oncontextmenu="return false">
<xsl:apply-templates/>
</body>
</html>
</xsl:template>

<!-- Overrides to the Default Sections -->
</xsl:stylesheet>

Posttop
Tony LavinioSubject: Conditional Imports
Author: Tony Lavinio
Date: 25 Jan 2007 01:05 PM
No. Imports are resolved at compile time, not runtime.

 
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.