name mode size
Salty-XML-Transformer 040000
.gitignore 100644 27B
LICENSE 100644 34.52kB 100644 3.99kB
# Salty XML Transformer Version 1.2.1 A crude but effective-enough way to use (or try to use) any XSLT sheet to transform any XML file or VUE concept map file. . Note, April 11, 2017. Version 1.2.1. A small error was fixed. Note, April 3, 2017. Version 1.2. Now it's possible to give Salty arguments to pass as parameters to XSLT. Note, March 28, 2017. Version 1.1. Found a crude workaround for the problem of Unicode characters like 🗁 getting messed up when transforming VUE maps. Now that seems to work nicely. However, things still don't work so well with plain, non-VUE XML files, unless those XML files contain Unicode entities instead of actual Unicode characters. Not sure yet exactly what's going wrong or how to fix it. . Named "Salty" because the name XSLT reminds me of salt, and because I didn't have the energy or patience to try to make something more perfect and less crude. ("Crude", "coarse", and "vulgar" are some of the less-frequently-used meanings of the word "salty".) I also didn't feel like fiddling with Markdown, so this Readme also isn't as nicely-formatted as I would like. . Can be run either from the command line, or on a web server, though this was not designed with security in mind, so I don't recommend using it on any web server connected to the internet. . Works with PHP 5.6.13 and hopefully other versions. Also, I made most of this in Lighthouse 64 Puppy Linux 6.02 Beta 2, and so far have made no effort to make sure it works properly with other GNU/Linuxes. . Requires the XSLT processor Saxon/C: . Here's my blog post about how to make Saxon/C into a PHP extension when using Lucid Puppy Linux 5.2.8 version 004. (I eventually also added some notes related to Lighthouse 64 Puppy Linux 6.02 Beta 2.) . Also uses the standard GNU/Linux tool "sed". . Some of the Saxon-related code is slightly modified code from the PHP demo scripts included with Saxon/C. ---- Command line arguments: Arg 1: A path to an XML file or VUE map to be transformed. Arg 2: A path to an XSLT sheet which will be used on the file pointed out by Arg 1. . Optional Arg 3: Set to "y" or "yes" or "revuize" (all equivalent) to set "should_convert_output_back_to_vue_format" to true. Makes Salty run the included Salty-related Perl script "unrelocvuecomments" (whose longer name is "Undo Moving a VUE Map's Top Comment Lines Into a CDATA Section") on the XSLT output. . Optional Arg 4: A path to the file where output should go. Must be inside whatever path is in the Dest_Folder constant. By default, that path is: "/root/Web-Server/Salty-XML-Transformer-Output/" Relative paths are assumed to be in there. (Except if the path contains dots that lead out of that folder.) . Optional Arg 5: Set to "y" or "yes" or "mojifix" (all equivalent) to set "should_try_to_convert_trashed_unicode_to_entities" to true. Makes Salty run the included Salty-related Perl script "somehow-fix-unicode-garbage-in-Salty-XML-Transformer-output" on the XSLT output. (Moji is short for mojibake, "the name for incorrect, unreadable characters shown when computer software fails to show text correctly.") . All args beyond Arg 5 are assumed to be parameters that should be passed into the XSLT sheet being used. If a parameter's value should be interpreted as an Xpath statement, put ":xpath" after the parameter's name. Example: time:xpath=current-dateTime() . Everything else is assumed to be something other than an Xpath. By default, Salty converts non-Xpath parameters to XdmValues using Saxon's createAtomicValue function. ---- Getvars (when run in web mode) "xml" = Arg 1 above "xslt" = Arg 2 above "revuize" = Arg 3 above "dest" = Arg 4 above "mojifix" = Arg 5 above Any other name = Assumed to be a parameter for XSLT.