Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • The first frightening realization that I had to wrap my head around is that, for all the ways I naturally think in Perl, they think in XSLT.

    Just…ponder that for a few minutes.

    Nothing bizarre about that at all. :-) I can’t claim to be a decade-of-experience expert in XSLT as I can claim to be in Perl, but I am very good with the language, and I like it a whole lot. The syntax is dreadfully verbose, but at the semantic level – its computation model – it is extremely elegant. You can

    • I may have asked this before, but is it XSLT you like or XPath? I've never managed to like XSLT, but I do like XPath. The syntax isn't always perfect, but I can't think of improvements.

      • Both. XPath isn’t dreadfully verbose; XSLT is. (It would greatly benefit from a non-XML rendition of its syntax, just like RelaxNG has both an XML and a Compact syntax.) But the basic model (recursive node visiting) is a perfect match for XSLT’s job. The apply-templates directive is basically a map with polymorphic callback using XPath-based dispatch. That’s all there is to XSLT.

        Of course, most people write for-each-heavy transforms instead, so they gain none of the elegance of this model. They would be better off writing that code in some general-purpose language. The result would still be cumbersome, but the awkwardness would at least not be exacerbated by the language having extremely limited facilities for general-purpose programming.

        (Do note that I presume EXSLT support, which largely rectifies the least tolerable aspects of the language. Bare XSLT 1.0 is no fun for any but tasks but the trivial – too many complexity management tools are missing.)