Re: [xsl] force </br> after x words | automate xsl |

Subject: Re: [xsl] force </br> after x words | automate xsl |
From: "David A. Lee" <dlee@xxxxxxxxxxx>
Date: Sat, 01 Aug 2009 12:02:54 -0400
Your last question
--- quote ---

Has anyone any recommendations on how i might achieve the following:

something like:

1)check directory for changed xml files

2) if changed/new xml

3) apply xslt

Is often handled in the realm of a scripting language such as bash, cmd, xmlsh, xproc etc.
I *might* be able to be handled in "pure xslt" but I certainly dont know xslt enough to suggest a way.
Maybe an xslt expert on this list could comment.
It also depends on what you mean by "changed". Changed wrt to what ? Date ? Another XML file in a different directory ?

Suppose you mean "changed in XML content from a source file in a different directory" ...
Suppose your 2 directories are /before and /after
In xmlsh for example the script might read

# xmlsh script

cd /after
for file in *.xml ; do
   if ! xcmp -x -n  /before/$file $file ; then
      xslt -f the_xslt_file.xsl < $file > /wherever_it_goes/$file

Note this test (xcmp) checks the infoset equivilence of the XML files not their exact byte equivilence. Omitting the -x will check for byte equivilence.

Similar examples could be done in other languages. But an advantage to an xml scripting language (like xmlsh or xproc) is that the script execution and the xslt execution are done in the same JVM improving performance vastly from a language that needs a subprocess to run the xslt.

David A. Lee

Current Thread