cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugo Burm" <>
Subject Using the extractor transformer with more than one <extract-element> type on the same page
Date Sun, 25 Aug 2002 09:56:42 GMT

I am working on an application that embeds XML definitions for a JFreeChart
chart in my XML content. (for JFreeChart see

The XML looks like:

<jfc width="500" height="400" xmlns="">
... some xml tags that define my chart....

I decided to use the "svg" approach: filtering the svg/jfc tags into a
separate pipeline.

I am using the Cocoon "extractor" transformer to filter my "jfc" fragment.
In my sitemap I modified some parameters of the extractor. E.g.:

In my "fragment-extractor.xsl" stylesheet I am catching these
"fe.fragment"'s and replacing them with an uri that is matched by the
sitemap. The svg example uses as uri: "some_virtual_map/{$id}.png". And this
png is matched by the sitemap and serialized by svg2png. I created a jfc2png
reader that matches my "some_virtual_map/{$id}.png", builds the jfreechart,
and serializes to png.

The problem: everything works OK until I want to mix svg and jfc on the same
page. The extraction process works fine, but I did not find a way to
differentiate between svg and jfc in my "fragment-extractor.xsl" stylesheet.
So I don't know when to use svg2png and when to use my jfc2png.

The problem is created by the "" class.
It knows the name of the element it is filtering, but it does not pass it
any further.
So the easiest solution seems to be to add a new attribute that passes the
name of the filtered element. Somewhere around line 350 of the
"" class.

Did I miss something? Is there a way to find out in the
"fragment-extractor.xsl" stylesheet about the element that was extracted? Is
there some other solution? Or do I indeed have to modify the java class as
desscribed above? Or use a quick hack: compile my own version of the
extractor class and use   fj.fragment instead of fe.fragment?


Hugo Burm

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message