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

setting TopLevel variables externally with XT

Subject: setting TopLevel variables externally with XT
From: "Jon Smirl" <jonsmirl@xxxxxxxxxxxx>
Date: Wed, 28 Jul 1999 16:53:56 -0400
externally setting variables
I have modified SheetImpl.java of XT to support a function for setting top
level variables externally:

  public void setGlobal(String variable, String value) throws XSLException {
    Name var = nameTable.createName(variable);
    variableExprTable.put(var, ExprParser.parseVariantExpr(null, value, new
EmptyVariableSet()));
  }

To use this, my servlet loads the stylesheet when it is first started. Then
each time the servlet is executed I call
        xsl.setGlobal("ua",  userAgent) - to the set user agent string
and you can do things like <xsl:if test="$ua=string('mozilla')">

Now I would like to modify setGlobal to allow generic objects...
       public void setGlobal(String variable, Object value) throws
XSLException {

        xsl.setGlobal("response",  res) - to set $repsonse to the servlet
response variable.

I need this variable so that I can pass it to my static extension functions
but I can't figure out what to replace ExprParer.parserVariantExpr with to
handle the generic object case.  Can someone give me a clue?

Is it legal to set a top level variable to a java object and then pass it to
an extension function?
As anyone already done this for XT?

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.