|
Re: Xpath node [message #27356 is a reply to message #27223] |
Thu, 19 July 2007 13:40 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Zsolt:
From a tag:
-----------
To evaluate the XPath expressions yourself in the tag handler (like c:get
and c:iterate), you need to use the class XPathContextExtender:
XPathContextExtender xce = XPathContextExtender.getInstance(context);
// there is a whole family of resolveXXX methods. To resolve an xpath as a
boolean, you'd use:
boolean result = xce.resolveTest(currentXPathContext(),
getAttribute("test");
From an XPath function:
------------------------
You can use the XPathUtil class to convert function arguments into the
desired primitive type (String, number, boolean).
In either case
-------------
If you are looking for a model 'node', the XPath engine returns a
org.eclipse.jet.xpath.NodeSet, which is an extension of java.util.Set (so
you can use .iterator() to traverse the set's elements). The type of the
actual object returned will depend on the 'modelLoader' you used. The
org.eclipse.jet.emf and org.eclipse.jet.emfxml loaders will return you
EObject's (or subtypes). If you use the org.eclipse.jet.resource model
loader, you will get org.eclipse.core.resources.IResource objects.
Paul
"Zsolt Paroczi" <paroczizs@ext.t-mobile.hu> wrote in message
news:970dee2d93c5bcdbb487dddde8766e40$1@www.eclipse.org...
> Hi,
>
> How can I access an Xpath node in a custom tag or in a custom Xpath
> function source code?
>
>
> Thanks forward,
> Zsolt
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02903 seconds