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

Losing top-level parameters when moving from Xalan-J 1.2.d01

Subject: Losing top-level parameters when moving from Xalan-J 1.2.d01 to 1.2.0
From: Charles Douthart <Charles.Douthart@xxxxxxxxxxxxx>
Date: Wed, 1 Nov 2000 18:19:25 -0400 (EST)
servlet_path
I'm currently trying to upgrade our XSL components from Xalan1.2.D01 to 
Xalan1.2.0 and have encountered a problem with paramters. It appears 
that top-level paramters are no longer visible to the XSL processor.

the code that handles most of the processing is as follows:

    // Chaned to liason for Xerces 1.2.0
    XSLTProcessor processor =
org.apache.xalan.xslt.XSLTProcessorFactory.getProcessor(new
org.apache.xalan.xpath.xdom.XercesLiaison());
    XSLTInputSource xmlSource = new XSLTInputSource(doc);  // doc is an
org.w3c.dom.Document
    XSLTInputSource xslSource = new XSLTInputSource(transformName);
    
    Iterator keys = rendererProperties.keySet().iterator();
    System.out.println("XSL Processor Paramters:");
    while (keys.hasNext())
    {
        String key = (String)keys.next();
        String value = (String)rendererProperties.get(key);
        System.out.println("\t" + key + ": " + value);
        processor.setStylesheetParam(key, value);
    }

    processor.process(xmlSource, xslSource,new
XSLTResultTarget(httpResponse.getWriter()));



And the transformation is:

    <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
Note: These parameters are defined in another file and included using
<xsl:include href="stdparams.xsl"/>
        <xsl:param name = "NAVIGATION_ROOT" select = "'root'"/>
        <xsl:param name = "SERVLET_PATH" select = "'null'"/>
        <xsl:param name = "CONTEXT_PATH" select = "'null'"/>
        <xsl:variable name = "FULL_SERVLET_PATH" select =
"concat($CONTEXT_PATH,$SERVLET_PATH)"/>
        <xsl:variable name = "SERVLET_NAME" select =
"substring($SERVLET_PATH,2)"/>
        
    
        <xsl:template match="/">
    
            <HTML>
                <HEAD>
                    ... header here
                </HEAD>
                <BODY >
                    ... body here
                </BODY>
             </HTML>
            </xsl:template>
    </xsl:stylesheet>

This transformation is applied to a _very_ simple, valid document that is
constructed from an in-memory string. All ran well under D01, but after
changing to 1.2.0, I get the following output:

    XSL Processor Paramters:
        NAVIGATION_ROOT: 'undefined'
        CONTEXT_PATH: '/ctx'
        SERVLET_PATH: '/Main'
    
    
    XSL Error: pattern = 'substring($SERVLET_PATH,2)'
    VariableReference given for variable out of context or without
definition!  Name = SERVLET_PATH, source tree node: #document
    XSL Error: SAX Exception
    org.apache.xalan.xslt.XSLProcessorException: pattern =
'substring($SERVLET_PATH,2)'
    VariableReference given for variable out of context or without
definition!  Name = SERVLET_PATH
        at java.lang.Throwable.<init>(Throwable.java:96)
        at java.lang.Exception.<init>(Exception.java:44)
        at org.xml.sax.SAXException.<init>(SAXException.java:38)
        
Any idea what is happening to my parameters?


TIA,
Charles Douthart
Trifolium, inc








 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-2011 All Rights Reserved.