[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: multiple templates with same name

Subject: Re: multiple templates with same name
From: "Jon Smirl" <jonsmirl@xxxxxxxxxxxx>
Date: Wed, 11 Aug 1999 11:10:38 -0400
xsl multiple templates same name
I am finding it useless to have one XSL sheet import or include another and
then use these sheets with the embedded include/import in a larger system.
The problem stems from multiple includes of the same file. There really
needs to be a way to say: don't include/import this file if it is already
loaded.

For example
file A has a wild card match, Z,  in it
file B includes A - B is used standalone, has templates named X and Y
file C includes A - C is used standalone, has different template named X
file D needs X, Y and Z from C, B, A

You can't import C, B, A because C includes A and A has a wild card (hides
contents of B)
If you include C, B, A you have to rely on the multiple templates of the
same name error resolution

Two solutions, provide a way to say don't load if already loaded. Or create
two more wrapper files, E/F which split B/C into templates and includes.  In
my system I will need hundreds of wrapper files and I don't want to do this.

Here's the fix to make Saxon comply with the WD:

XSLCallTemplate.java
    public void validate() throws SAXException {
        checkWithinTemplate();
        usesParams = (getFirstChild("xsl:with-param") != null);
        ElementInfo stylesheet = getDocumentElement();

        Vector toplevel = stylesheet.getAllChildNodes();
// This loop needs to run the other way
//JDS old code -- for (int i=0; i<toplevel.size(); i++) {
        for (int i=toplevel.size()-1; i>=0; i--) {

Jon Smirl
jonsmirl@xxxxxxxxxxxx



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.