Things XSLT can't do (2012)
dpawson.co.uk
dpawson.co.uk
* The title feels very wrong and may reduce the article content's actual value for people who use XSLT. The good scenario of this title would be: it helps angry people finding the article and if they actually read it they get enlightened. Does it happen?
* A dose of redundancy (dynamic includes for example are repeated a number of times).
* Some issues are genuine limitations, e.g. "Two column table from unsorted data", because "if you want to do further processing on it you have to convert the r-t-f to a node-set" and I've run into that. Solved since.
* Some questions are misleading because asked with a wrong approach, like an instance of the XY problem ( http://xyproblem.info/ ). E.g. "Non well formed HTML input" -> such approach looks like the user actually wants a template mechanism, and instead of that asks for pasting invalid HTML. As written in article, "XSLT is about trees, not tags"... and IMHO that's where it gets a lot of power from!
All in all, this document is interesting, though most value in it is in understanding the spirit and style of XSLT, like "Variables in XSLT have scope based on their appearance in the stylesheet not on runtime behaviour"
If after reading it you understand better what you can do with XSLT (because false paths are now marked in your head, making good paths easier to spot), then it was worth reading.
And for you that read this far: use XSLT for simple things, don't try to pack inside stylesheets issues that don't belong there. Generating ad-hoc XSLT (with whatever tool that can do that well) is fine. Also, since style sheets are XML, generating them with another "upstream" XSLT stylesheet if good, though you have to take care of namespaces. You might think you have to problems instead of one, but they are actually much more doable. KISS and "divide and conquer" principles still apply.
For example:
http://stackoverflow.com/questions/31437121/how-to-output-am...
Just setting <xsl:output method="text"/> will let you more or less output whatever you want. It doesn't care at that point if the output is valid XML. It is used regularly to convert XML to other text formats using only XSLT.
Whether unfortunate, or due to design, most/all of these are still valid.
<xsl:variable name="BorC"> <xsl:choose> <xsl:when test="/a/b/c"> <xsl:value-of select="/a/b/c"> </xsl:when> <xsl:otherwise> <xsl:value-of select="/a/b"> </xsl:otherwise> </xsl:choose> </xsl:variable>
As recently as 2008 (ahem), I implemented a website transforming XML into HTML/DOM using xsl-stylesheet instructions and it worked pretty well on IE6 and FF back then.
But XSLT's Turing-completeness, for me, kind of spelled the death for in-browser XSLT, as XSLT was becoming pointless when you already have JavaScript in the stack.
I don't even know if xsl-stylesheet still works in browsers (supposedly not when using HTML5). But XPath in the browser certainly isn't dead ([3]).
[1]: http://www.biglist.com/lists/lists.mulberrytech.com/xsl-list...
Oh ! Me too ! It was based on ATOM and PHP to recreate the files when content was updated.
I used CDuce for a significant SOAP project (http://ocsoap.forge.ocamlcore.org/) after a previous negative experience with XSLT. It (CDuce) was a mixed blessing. It was very easy to parse and transform XML, but lacked major features like being able to print debugging information. Also because CDuce couldn't process XML schemas you ended up having to rewrite the schema in CDuce language in your own code. Code example: http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=ocsoap/ocsoap....
transform bib with
<_ (a)> [(x::(Author|Title|Url)|_)*] ->
[ <book ({isbn="fake"}+a\year)> x ]
where the <...> syntax looks similar to XML. (This example copied from http://www.cduce.org/tutorial_patterns.html )While I love it, I always wonder if others might think I am crazy.
[1]: https://en.wikipedia.org/wiki/Document_Style_Semantics_and_S...
I would love to hear more about the system you work with.
Within the abstraction, each of our "Elements" has his own XSL stylesheet containing the whole transformation of it. So for developers, it's easy to navigate the code. All elements are compatible with each other.
We've a task running in the background that groups all element into a single XSL stylesheet.
Within Apache Cocoon, you can setup a transformation pipeline. The "elements" will be applied in one step, other steps take care of i18n, i10n and "custom pages"/widgets.
Our documentation is written in that setup, too. We've also setup automated tests for our ~60 custom written EXSLT functions.
Stupidly wasteful and kind of a pain for anything complex sure. But, I never found any code I could not write like this.
Cumbersome perhaps, but I've seen this used in a big system, and when properly cached and used in the right circumstances, it performs just as well as a single XSLT.
Is there anybody else here who thinks that DSSSL was a nicer language than XSLT? Mind, it couldn't do most of these things either, but it was basically functional Scheme. And I'll take Scheme over... whatever XSLT is any day.