XSLT

From Friend2Friend Wiki

(Redirected from XSL)
Jump to: navigation, search

XSLT is a W3C standard language for transforming XML documents, and v1.0 been a recommendation for since 1999. EXSLT, which extends the capabilities of XSLT, has been widely implemented, and is used by this project. W3C abandoned v1.1 was abandoned in favour of v2.0, which is a recommendation, but not yet widely implemented.

XSLT programs are themselves XML documents, and are called stylesheets, since they have with <xsl:stylesheet> as the root node. Stylesheets are a mixture of elements in the xsl namespace (which are interpreted) and others (which are treated as literals). They always require a well-formed XML document (a DOM Document) as input, and usually generate well-balanced XML as output (can be a fragment).

XML->XML Transform

Perhaps because of its unusual role as an XML transformation language, some find XSLT has a steep learning curve. Wikipedia mentions the problem that XSL requires learning of XPath, a relatively simple but expressive language used for navigating around XML documents. Most of the xsl elements have an attribute, e.g. "select", which contains an XPath expression that calculates a function of the input document.

Contents

Relevance to F2F

F2F is a core technology used by F2F; most of the module resources rely on it:

  • Displays use XSLT to process f2f:displayreqs
  • Filters use XSLT to process f2f:messages
  • Hooks use XSLT to process the contents of the invoking f2f:hookreq
  • Services use XSLT to process f2f:servicereqs

XSL Extensions

As well as standard XSLT, F2F stylesheets have the following extra options:

File Extensions

For clarity, the XSL Transforms in this project have different two file extensions:

  • .XSLT (Serverside transforms)
  • .XSL (Clientside transforms)

References

Personal tools