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

java extension element and xsl variable problem

Subject: java extension element and xsl variable problem
From: Keith Lynch <klynch@xxxxxxxxxxxx>
Date: Fri, 18 Feb 2005 16:24:10 +0100
xsl variable java
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.


Any help or pointers would be greatly appreciated TIA Keith Lynch

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 &
\ /
//////////////////////////////////////////////////////////////


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.