commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@activemath.org>
Subject Re: [jelly] Taglib best practices for nested elements?
Date Thu, 23 Jan 2003 23:43:59 GMT

> parse its body into some DOM model or turn the XML events into some 
> kind of Java objects or other kind of data structure"
> How can I do this? How could I implement my specious 
> JellyUtils.tagToDom4jElement() method? Tag.getBody() returns a Script, 
> from which I haven't figured out how to get a dom4j (or other)

Well, look at the definition of XMLOutput (that sole parameter of all 
doTag methods). This is basically a SAX DocumentHandler and it is free 
to your tag to invoke its body with a different XMLOutput (you have to 
invoke it with something!).

You should not try to interfere with the parsing itself: actually a 
script, can, in principle, run several times and only be parsed once. 
Moreover, interfering with the parsing itself would mean the following 
very sad fact: you would not be able to use any of the jelly facilities 
in there, like jexl-expressions, <core:forEach> and this kind of thing: 
they are run by the tags themselves and only the output should interest 
you.

Paul


Mime
View raw message