XSLT: Is there a way to "inherit" canned functionality?
- by Ian Boyd
i am once again having to cobble together a bit of XSLT into order to turn generated XML into (rather than simply generating HTML).
i'm having huge deja-vu this time again. i'm once again having to solve again basic problems, e.g.:
how to convert characters into valid html entity references
how to preserve whitespace/carriage returns when converting to html
how to convert to HTML as opposed to xhtml
how to convert dates from xml format into presentable format
how to tear apart strings with substring
This is all stuff that i've solved many times before. But every time i come back to XSLT i have to start from scratch, re-inventing the wheel every time.
If it were a programming language i would have a library of canned functions and procedures i can call. i would have subroutines to perform the commonly repeated tasks. i would inherit from a base class that already implements the ugly boilerplate stuff.
Is there any way in XSLT to grow, expand and improve the ecosystem with canned code?