Changes

Jump to navigation Jump to search
23 bytes removed ,  06:46, 29 November 2019
This [[Module Library|XQuery Module]] contains functions and variables to perform XSLT XSL transformations. By default, this module uses Java’s XSLT 1.0 Xalan implementation to transform documents. XSLT 23.0 is used instead will be enabled if Version 9.x of the [http://www.saxonica.com/ Saxon XSLT Processor] ({{Code|saxon9he.jar}}, {{Code|saxon9pe.jar}}, {{Code|saxon9ee.jar}}) is found in the classpath(see [[Startup#Distributions|Distributions]] for more details. A custom transformer can be specified by overwriting the system property {{Code|javax.xml.transform.TransformerFactory}}, as shown in the following Java example:
<pre class="brush:java">
System.setProperty( "javax.xml.transform.TransformerFactory", "org.custom.xslt.TransformerFactoryImpl"); 
Context ctx = new Context();
String result = new XQuery("xslt:transform('...', '...')").execute(ctx);
=Conventions=
 
{{Mark|Updated with Version 9.0:}}
All functions and errors in this module are assigned to the <code><nowiki>http://basex.org/modules/xslt</nowiki></code> namespace, which is statically bound to the {{Code|xslt}} prefix.<br/>
|-
| '''Summary'''
|Returns the supported XSLT version (currently: "1.0" or "23.0"). "Unknown" is returned if a custom implementation was chosen.<br />
|}
==xslt:transform==
 
{{Mark|Updated with Version 9.0:}} {{Code|$options}} argument added.
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|xslt:transform|$input as item(), $stylesheet as item()|node()}}<br />{{Func|xslt:transform|$input as item(), $stylesheet as item(), $params as map(*)?|node()}}<br />{{Func|xslt:transform|$input as item(), $stylesheet as item(), $params args as map(*)?, $options as map(*)?|node()}}
|-
| '''Summary'''
* {{Code|xs:string}}, containing the document in its string representation, or
* {{Code|node()}}, containing the document itself.
The [[Catalog Resolver|XML Catalog files]] will be considered when resolving URIs. Variables can be bound to a stylesheet via {{Code|$paramsargs}} argument can be used to bind variables to a stylesheet. Only (only strings are supported when using Saxon (XSLT 23.0and Saxon). The following {{Code|$options}} are available:* {{Code|cache}}: cache XSLT transformer (speeds up repeated transformations, but may increase increases memory consumption)
|-
| '''Error'''
==xslt:transform-text==
 
{{Mark|Updated with Version 9.0:}} {{Code|$options}} argument added.
{| width='100%'
</books>
let $style :=
<xsl:stylesheet version='23.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='xml'/>
<xsl:template match="/">
=Errors=
 
{{Mark|Updated with Version 9.0:}}
{| class="wikitable" width="100%"
=Changelog=
 
;Version 9.2
 
* Updated: Support for XML Catalog files added.
;Version 9.0
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu