forEach="/record | /record/mediaBlock" is likely to have problem .
This causes inconsistencies anyway because this is supposed to give
callbacks with same data.
you can definitely write a transformer which gives out multiple rows
if a record contains /record/mediaBlock. the return value of a
transformer can be a Map<String, Object> or a List<Map<String,
Object>>. In the second case it can create multiple rows for each
incoming row
--Noble
On Thu, Feb 12, 2009 at 6:44 PM, Fergus McMenemie <fer...@twig.me.uk> wrote:
> Hello,
>
> I am having bother with forEach. I have XML source documents containing
> many embedded images within mediaBlock elements. Each image has a an
> associated caption. I want to implement a separate image search function
> which searches the captions and brings back the associated image.
>
> <entity name="x"
> dataSource="myfilereader"
> processor="XPathEntityProcessor"
> url="${jc.fileAbsolutePath}"
> stream="false"
> forEach="/record | /record/mediaBlock"
> >
>
> <field column="vurl"
> xpath="/record/mediaBlock/mediaObject/@vurl" />
> <field column="imgCpation"
> xpath="/record/mediaBlock/caption" />
>
> Is is OK to have an xpath expression within forEach which is a child
> of another of the forEach xpath expressions?
>
> Or.. is there a better way of doing this?
>
> Regards
> --
>
> ===============================================================
> Fergus McMenemie Email:fer...@twig.me.uk
> Techmore Ltd Phone:(UK) 07721 376021
>
> Unix/Mac/Intranets Analyst Programmer
> ===============================================================
>
--
--Noble Paul