Re: [xsl] Processing mutiple files in multiple directories individually

Subject: Re: [xsl] Processing mutiple files in multiple directories individually
From: Liam R E Quin <liam@xxxxxx>
Date: Fri, 18 Mar 2011 02:02:27 -0400
On Thu, 2011-03-17 at 17:00 -0700, Mark wrote:
> I am using XSLT 2.0.
> 
> I have several hundred XML data files stored in a number of directories each 
> with subdirectories of their own that descend to various levels. From them, 
> I need to locate 137 specific files and make editing changes to each. I 
> believe I can write the template that can determine if a specific XML file 
> requires editing or not, and if so to then apply the editing change.

If this happens often, I'd look into using XQuery with updates.

If it's a one-off, or if you want to use XSLT :-), or if it's done often
but the files are new or changed, maybe use lstoxml to make an XML
document that reflects the directory structure, and process that.

You may find it simpler to process all the files and then at the end,
outside XSLT, move the new directory hierarchy into place. That way if
something goes wrong you don't lose data.  Or, you're much less likely
to lose data :-) (especially with a journalling filesystem).

Liam

Current Thread