Home  » XSLT Extensions

P6R's XSLT 2.0 Extensions

P6R's XSLT engine provides several very useful extensions to XSLT. XSLT is great for transforming XML into all sorts of things, but our XSLT engine does not stop there. You can use our XSLT engine to also transform JSON in the same way that you would transform XML.

The following extensions require the use of the P6R namespace: http://www.p6r.com/XSLT/extensions

<p6r:number value='' format='' lang='' />

This element is similar to the <xsl:number> element. This element is always empty. It should only appear in a sequence constructor.
 NAME         VALUE       Meaning
 value        Expression  An XPath expression that
 (required)               valuates to a sequence of
                          zero or more integers.
                          This is the number(s) to be
                          formatted.

 lang         Expression  Indicates the language to use
 (optional)               when formatting the number string.

 format       xs:string   A standard format string as used
 (optional)               in p6i18n::swprintf function
                          (e.g., %d,%f).
                          If not present, then "%d" is
                          used.
As a simple example: <p6r:number value='(1,44,33)' format='Hi there-%d-what is %d new?,%d' />

produces: 'Hi there-1-what is 44 new?,33'