|
Re: Passing XPath result to custom tag [message #26786 is a reply to message #26746] |
Tue, 17 July 2007 13:06 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Zsolt:
Looking at your example, I think you'd probably want your users to write:
<mj:getPackage classId="{$entityClass/@id}"/>
In which case, all you have to do is use the method getAttribute(String) in
your tag handler. I suspect you are using using
TagInfo.getAttribute(String), which returns the 'raw' unprocessed attribute
value.
If, by change, you want to evaluate the XPath expressions yourself in the
tag handler (like c:get and c:iterate do), 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");
Paul
"Zsolt Paroczi" <paroczizs@ext.t-mobile.hu> wrote in message
news:d65dfc0ce27fa1f8529a6ea18ee50795$1@www.eclipse.org...
> Hi,
>
> how can I pass an XPath result as custom tag attribute
>
> <mj:getPackage classId="$entityClass/@id"/>
>
> <mj:getPackage classId="{$entityClass/@id}"/>
>
> none of them works, in the tag sorce I get the attribute as String
> ($entityClass/@id;="{$entityClass/@id})
>
> In the tag plugin I set the attribute type xpath and tried with string
> also.
>
>
> thanks forward,
> Zsolt
>
|
|
|
Powered by
FUDForum. Page generated in 0.02587 seconds