You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Philip Dodds <Ph...@unity-systems.com> on 2005/04/25 21:19:35 UTC
XPathAPI setting variables
I have been trying to set variables for use on an XPathAPI.execute(...),
I realize that I can get the XPathContext and from there get the
VariableStack, however I'm not exactly sure how to use this?
I was hoping to be able to place a variable on the stack though looking
through the code this seems to be handled though use of the StylesheetRoot
returning a vector then updating the VariableStack? I'm a little lost on
why methods don't exist in the VariableStack for adding a variable.
Is there a way to set up the VariableStack to add a variable
programmatically based on the result of an XPath? In other words creating
an XObject and then giving it a QName and placing it on the stack so I can
re-use this on the XPathAPI?
Cheers
Philip
Re: XPathAPI setting variables
Posted by Henry Zongaro <zo...@ca.ibm.com>.
Hi, Philip.
"Philip Dodds" <Ph...@unity-systems.com> wrote on 2005-04-25
03:19:35 PM:
> Is there a way to set up the VariableStack to add a variable
> programmatically based on the result of an XPath? In other words
> creating an XObject and then giving it a QName and placing it on the
> stack so I can re-use this on the XPathAPI?
The XPath API of JAXP 1.3 includes an XPathVariableResolver interface
that allows one to supply the value of a variable for XPath expression
evaluation. Once there is a release of Xalan-Java that includes support
for JAXP 1.3, that should solve your problem. Do you need a solution in
the interim?
Thanks,
Henry
------------------------------------------------------------------
Henry Zongaro Xalan development
IBM SWS Toronto Lab T/L 969-6044; Phone +1 905 413-6044
mailto:zongaro@ca.ibm.com