Обзор EXSLT

Содержание

EXSLT is a community initiative to provide extensions to XSLT.

Модули

  • Common — EXSLT - Common covers common, basic extension elements and functions.
  • Math — EXSLT - Math covers extension elements and functions that provide facilities to do with maths.
  • Sets — EXSLT - Sets covers those extension elements and functions that provide facilities to do with set manipulation.
  • Functions — EXSLT - Functions are those extension elements and functions that allow users to define their own functions for use in expressions and patterns in XSLT.
  • Dates and Times — EXSLT - Dates and Times covers date and time-related extension elements and functions.
  • Strings — EXSLT - Strings covers extension elements and functions that provide facilities to do with string manipulation.
  • Regular Expressions — EXSLT - Regular Expressions covers extension elements and functions that provide facilities to do with regular expressions.
  • Dynamic — EXSLT - Dynamic covers extension elements and functions that deal with the dynamic evaluation of strings containing XPath expressions.
  • Random — EXSLT - Random covers extension elements and functions that provide facilities to do with randomness.

Defining Extension Namespaces

The first step to using the extensions described in EXSLT is to define the relevant namespace for the EXSLT module. You should declare the namespace on the xsl:stylesheet element in your stylesheet.

You can find the namespace that you need to define on the page describing the module for the functions that you want to use. Generally, the namespaces are named in a standard way, though:

http://exslt.org/module-name

For example, you can define the namespace for the Math module with:

<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:math="http://exslt.org/math">
...
</xsl:stylesheet>

You can use the extension-element-prefixes attribute to prevent the extension namespaces from being output in the result tree:

<xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:math="http://exslt.org/math"
      extension-element-prefixes="math">
...
</xsl:stylesheet>


11 июня 2015 г.

http://exslt.org/