cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugo Burm" <hu...@xs4all.nl>
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
Hello,

I am working on an application that embeds XML definitions for a JFreeChart
chart in my XML content. (for JFreeChart see www.object-refinery.com)

The XML looks like:

<jfc width="500" height="400" xmlns="http://datagram.nl/survey">
... some xml tags that define my chart....
</jfc>

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.:
<extract-element>jfc</extract-element>

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 "FragmentExtractorTransformer.java" 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
"FragmentExtractorTransformer.java" 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?

Thanks

Hugo Burm
hugob@datagram.nl


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message