[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] setting TopLevel variables externally with XT
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|