TheBernmeister
Programmer
I'm using Apache FOP, embedded in a Java desktop application, to create PDFs from a data XML file and an XSLT file.
Say the data XML file is a list of items of the form
<items>
<item>apple</item>
<item>apples</item>
<item>orange</item>
<item>water melon</item>
...
</items>
I want to be able to tell the XSLT to only process specific nodes (say "apple" and "orange"). Note that each item will have an unique name - no repeats, but some names could contain the names of other nodes (such as apples contains apple).
In the Java code which kicks off the PDF render, I create a java.util.ArrayList and pass that to the transformer using setParameter( "theList", theList ). In the XSLT, when I use <xsl:value-of select="$theList" />, I'll get in the output [apple, orange].
However, what I would need is to take the array and iterate over it, calling a template for each matching item. Is this possible?
Also, given that "apples" contains "apple", using to something like the contains/matches functions would not work. The example data XML is simplified - in reality the items would not necessarily be in English and could contain punctuation, such as "My Item - 1.5, and more"...meaning that using the ',' to (somehow) tokenise would not work either.
Any ideas?
Thanks in advance,
Bernard.
Say the data XML file is a list of items of the form
<items>
<item>apple</item>
<item>apples</item>
<item>orange</item>
<item>water melon</item>
...
</items>
I want to be able to tell the XSLT to only process specific nodes (say "apple" and "orange"). Note that each item will have an unique name - no repeats, but some names could contain the names of other nodes (such as apples contains apple).
In the Java code which kicks off the PDF render, I create a java.util.ArrayList and pass that to the transformer using setParameter( "theList", theList ). In the XSLT, when I use <xsl:value-of select="$theList" />, I'll get in the output [apple, orange].
However, what I would need is to take the array and iterate over it, calling a template for each matching item. Is this possible?
Also, given that "apples" contains "apple", using to something like the contains/matches functions would not work. The example data XML is simplified - in reality the items would not necessarily be in English and could contain punctuation, such as "My Item - 1.5, and more"...meaning that using the ',' to (somehow) tokenise would not work either.
Any ideas?
Thanks in advance,
Bernard.