cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: Help: XPah to Jexl
Date Tue, 21 Sep 2004 06:10:32 GMT
oceatoon wrote:

>Hi everyone
>
>I am having trouble retreiving an attribute in jexl.
>In jxpath, I can retreive it like this #{./description/@maxoc}
>but ${description.maxoc} doesn't work, can someone guide me please??
>  
>

Jexl is a JavaBeans-oriented expression language. So you can't access 
attributes in an XML document using Jexl, except by using the DOM API 
(e.g. "${description.getAttribute("maxoc")}"). JXPath, on the contrary, 
traverses both DOM and JavaBeans hierarchies.

So in that particular case, using JXPath is the IMO the appropriate choice.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message