xsl-list
[Top] [All Lists]

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

2009-08-01 12:03:29
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
  fi
done
#

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
dlee(_at_)calldei(_dot_)com http://www.calldei.com
http://www.xmlsh.org
812-482-5224


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>