Phillip-
the solution seems to be a merge of the 2 Stylesheets into 1
e.g.

<xsl:apply-templates> and <xsl:apply-imports> tags are for
including multiple XSLs in one.

suppose you have style sheets a.xsl and b.xsl defining different
templates:

<!-- a.XSL -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="abc">
<!-- some transformation -->
</xsl:template>
</xsl:stylesheet>

<!-- b.XSL -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="xyz">
<!-- some transformation -->
</xsl:template>
</xsl:stylesheet>

both can be combined in a single stylesheet using import /
include directives:

<!-- c.XSL -->
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href=""/>
<xsl:include href=""/>
</xsl:stylesheet>

c.XSL sort of acts like an aggregation of stylesheets a.XSL and
b.XSL. so the foll statement stands:

XML(1) + XSL(1) --> XML(1)

where the single stylesheet itself is composed of multiple
stylesheets:

XSL(1) + XSL (1) + .. + XSL (1) --> XSL (1)

the big advantage is modularizing stylesheets.

the difference is 2 directives ( import/include ) is precedence
of template rules in case of conflicts. this is a big topic and
you may take a look at
http://www.arbortext.com/xsl/tutorial/foil26.html

reprised from http://forum.java.sun.com/thread.jsp?forum=34&thread=68850 by rohitd

Hope this helps,

Martin Gainty

______________________________________________

Disclaimer and confidentiality note

Everything in this e-mail and any attachments relating to the official business of Laconia Data Systems (LDS) is proprietary to the company. It is confidential, legally privileged and protected by law. LDS does not own and endorse any other content. Views and opinions are those of the sender unless c

>From: "Rhodes, Phillip C." <[EMAIL PROTECTED]>
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: setSystemId not recursive for included stylesheets?
>Date: Thu, 6 Feb 2003 16:18:06 -0500
>MIME-Version: 1.0
>Received: from apache.org ([208.185.179.12]) by mc1-f36.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Thu, 6 Feb 2003 13:18:33 -0800
>Received: (qmail 20762 invoked by uid 500); 6 Feb 2003 21:17:58 -0000
>Received: (qmail 20727 invoked from network); 6 Feb 2003 21:17:57 -0000
>Received: from noaadc-msw03.noa.alcoa.com (147.154.9.220) by daedalus.apache.org with SMTP; 6 Feb 2003 21:17:57 -0000
>Received: from noaadc-mxi03.NOA.Alcoa.com (unverified) by NOAADC-MSW03.NOA.Alcoa.com (Content Technologies SMTPRS 4.2.10) with ESMTP id <[EMAIL PROTECTED]>for <[EMAIL PROTECTED]>; Thu, 6 Feb 2003 16:18:11 -0500
>Received: by noaadc-mxi03.NOA.Alcoa.com with Internet Mail Service (5.5.2653.19)id ; Thu, 6 Feb 2003 16:18:11 -0500
>X-Message-Info: dHZMQeBBv44lPE7o4B5bAg==
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>Precedence: bulk
>list-help:
>list-unsubscribe:
>list-post:
>Delivered-To: mailing list [EMAIL PROTECTED]
>Message-ID: <[EMAIL PROTECTED]>
>X-Mailer: Internet Mail Service (5.5.2653.19)
>X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>Return-Path: [EMAIL PROTECTED]
>X-OriginalArrivalTime: 06 Feb 2003 21:18:33.0767 (UTC) FILETIME=[4E022370:01C2CE25]
>
>I am doing a transformation in jaxp, underlying it is xalan 2.4.1
>
>I have several stylesheets, all have includes that are relative to a base
>(e.g. /usr01/h3/rhodepc/d/jrun-16981/default-app/) There is an xsl
>subdirectory here.
>
>All my includes in my stylesheets begin with the path "xsl/"
>
>I have a master stylesheet, that will include one stylesheet, which in turn
>includes another stylesheet, and so on...
>
>I set the systemId on the first stylesheet, so that when it does an include
>of the first stylesheet, the stylesheet is found.
>
>However, this second stylesheet does an include (also relative). This
>include is resolved relative to the second stylesheet's location, not the
>original location of the stylesheet, hence the document root moves from
>stylesheet to stylesheet.
>
>It seems that setSystemId is not used recursively for resolving the
>stylesheets that are included...
>
>Any help and guidance would be appreciated!
>
>Here is more detail:
>java.io.FileNotFoundException:
>/usr01/h3/rhodepc/d/jrun-16981/default-app/xsl/purchasing/xsl/util/jsp/xmlui
>.xsl (No such file or directory)
>
>The file is located at
>/usr01/h3/rhodepc/d/jrun-16981/default-app/xsl/util/jsp/xmlui.xsl
>
>The include was (in the 2nd included xsl)
>
>
>
>I had set the systemid on the first stylesheet to point to
>"/usr01/h3/rhodepc/d/jrun-16981/default-app/"
>So the first stylesheet is found.
>The master stylesheet (the first one called) is located at
>/usr01/h3/rhodepc/d/jrun-16981/default-app/xsl/purchasing/ebiz
>
>Thanks very much. Fighting this all day!
>
>
>
>Phillip Rhodes


MSN 8 with e-mail virus protection service: 2 months FREE*

Reply via email to