Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] force
after x words | automate xsl |

From: "David A. Lee" <dlee@-------.--->
To: xsl-list@-----.------------.---
Date: 8/1/2009 4:03:00 PM
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@c...  
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@l...>
--~--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent