| 
 
Subject: setting TopLevel variables externally with XT From: "Jon Smirl" <jonsmirl@xxxxxxxxxxxx> Date: Wed, 28 Jul 1999 16:53:56 -0400  | 
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 | 
|---|
  | 
| <- Previous | Index | Next -> | 
|---|---|---|
| Need a way to hide children with ce, Kara Lee | Thread | RE: setting TopLevel variables exte, Maxime Levesque | 
| Need a way to hide children with ce, Kara Lee | Date | Re: "sorted" axis (was: Remove dupl, Sebastian Rahtz | 
| Month |