[xsl] iterate over a folder and update XML using XSLT

Subject: [xsl] iterate over a folder and update XML using XSLT
From: a kusa <akusa8@xxxxxxxxx>
Date: Mon, 29 Mar 2010 16:06:18 -0500
Hi

Here is my requirement:

1) Iterate over 100 XML files in a folder.
2) Append a <para> with some content in it to each file.

I have a transformation program and I use saxon's command line to run
the transformation over the group of files.

So I run

java -jar saxon9.jar -s: <here i specify the path to the folder> -o:
<here i specify the outout dir> -xsl:<name of my xsl>

Now since each transformation is individualistic, the problem I am
having is that ever transformed xml output has the content repeated as
many times as the number of input xml files.

So, if I have 10 files in the folder, when I sued <xsl:for-each
select="collection('<path>')">, which by the way takes a long time to
transform, it appends 10 <para> elements to each xml file.

So what is the approach to iterate over folder in XSLT? Or can it be done?

Can the experts please help me understand this?

Thanks in advance.

Current Thread