|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] java extension element and xsl variable problem
Hi list
I've been fooling around with XSLT for the last two weeks and I hit a brick wall yesterday. I'm trying to create a java extension element using xalan which takes an xsl variable as a parameter. <configurator:setProperty key="lang" value="$Language"/> However I just keep on receiving the literal string "$Language" as my value attribute public Object setProperty( XSLProcessorContext context, ElemExtensionCall extElem) { try { System.out.println(extElem.getAttribute("key")); System.out.println(extElem.getAttribute("value")); } return null; } Formerly I was using an extension function with an XPath string from a select="$variable" and this worked fine. <xsl:variable name="chapter_number" select="position() + configurator:getProperty($Whatever)"/> This worked just fine and my function revieved the value of $Whatever and not the literal string "$Whatever" However the function doesn't return anything and being obliged to insert an xsl:variable or xsl:value-of or any other senseless xsl:blahblah is just annoying and basically creates redundant variables. i.e .. NOT CLEAN My problem hinges around evaluating a variable. In an old snippet I found one could simply call getVariableOrParam on the root StyleSheet element however the xalan processor uses newer standards with XPath etc. I'm not too sure here. I don't have a lot of xslt exp. It doesn't seem to be a trivial task. I've also tried sending subelements <extension:element blahblahblha> <value> <xsl:value-of select"$var"/> <value> /<extension:element> and parsing all childNodes. However when I call getNodeValue I just get an Exception.
p.s I'm using the ant 1.6.2 stylesheet task... under windows XP sp3 -- ______________________________________________________________ / \ & Keith Lynch Mail $ klynch [BT] genigraph.fr & & & & GENIGRAPH URL $ http://www.genigraph.fr & & 104, rue Castagnary Tel $ +33 1 45 33 64 63 & & F-75015 PARIS - FRANCE Fax $ +33 1 45 33 89 63 & \ / //////////////////////////////////////////////////////////////
|
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
|

Cart








