XSLT: Is there a way to "inherit" canned functionality?

Posted by Ian Boyd on Stack Overflow See other posts from Stack Overflow or by Ian Boyd
Published on 2010-05-01T03:14:19Z Indexed on 2010/05/01 3:17 UTC
Read the original article Hit count: 318

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?

© Stack Overflow or respective owner

Related posts about xslt

Related posts about code-reuse