Possibly tangential:
It doesn't cure or ameliorate the semantic difficulties but I have an alternative syntax for xslt that reduces the "noise" introduced by the xml syntax. I've used it to write similar functional xsltxt. For example the compose-flist.xsl stylesheet can be written as shown below
stylesheet "1.0"
namespace "xalan" "http://xml.apache.org/xalan"
tpl .name "compose-flist" ("pFunList":"/..", "pArg1")
choose
when "not($pFunList)"
copy-of "$pArg1"
otherwise
var "vrtfFunRest"
call "compose-flist" ("pFunList":"$pFunList[position() > 1]",
"pArg1":"$pArg1")
apply .select "$pFunList[1]"
("pArg1":"xalan:nodeset($vrtfFunRest)/node()")
An implementation (java) is at savannah.gnu.org/projects/xsltxt that can convert from xsl to "xsltxt" and back. It can also directly work with the javax.xml.transform package to produce stylesheets from "xsltxt" representations.
Any and all comments would be appreciated.
|