Learn how to a build a cloud-first strategyRegister Now


Xsl import

Posted on 2014-08-11
Medium Priority
Last Modified: 2014-09-07
I am trying to pick appropriate xsl based on certain condition...following is what I was trying to achieve that and was running into an error. The following might not be a way to do this but I hope I'm able to convey the idea here.


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/" xmlns:fos="java.io.FileOutputStream" xmlns:fo="http://www.w3.org/1999/XSL/Format">
            <xsl:when test="CONDITION">
                  <xsl:import href = "first.xsl"/>
                  <xsl:import href = "second.xsl"/>
Question by:jdharsha
1 Comment
LVL 36

Accepted Solution

mccarl earned 1400 total points
ID: 40254903
No you can't do that. If you check out the reference for xsl:import... http://www.w3.org/TR/xslt#import   you will see a statement that says
The xsl:import element is only allowed as a top-level element. The xsl:import element children must precede all other element children of an xsl:stylesheet element

Can you give a bit more complete example of what you are trying to achieve? ie. what functionality is in those two .xsl files that you are trying to choose between. This may allow us to better provide you with a solution to do what you want.

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month21 days, 6 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question