Changes

Jump to navigation Jump to search
72 bytes removed ,  18:38, 1 December 2023
m
Text replacement - "syntaxhighlight" to "pre"
By default, this module uses Java’s XSLT 1.0 Xalan implementation to transform documents. XSLT 3.0 is used if the [https://www.saxonica.com/ Saxon XSLT Processor] is found in the class path (e.g. by placing the library files in the [[Startup#Full Distributions|{{Code|lib/custom}} directory]]). A specific transformer can be specified by assigning a classpath to the system property {{Code|javax.xml.transform.TransformerFactory}} with the [https://docs.oracle.com/en/java/javase/11/tools/java.html -D flag] on the command line, or directly in Java:
<syntaxhighlight pre lang="java">
System.setProperty(
"javax.xml.transform.TransformerFactory",
return xslt:transform($in, $style)</pre>
'''Result:'''
<syntaxhighlight pre lang="xml">
<html>
<body>
'''basic.xslt'''
<syntaxhighlight pre lang="xml">
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:template match="/">123</xsl:template>
'''Result:'''
<syntaxhighlight pre lang="xml">123</pre>
'''Example 3: XSL transformation with variable assignment'''
'''variable.xsl'''
<syntaxhighlight pre lang="xslt">
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
'''Result:'''
<syntaxhighlight pre lang="xml">
<v>1</v>
<v>1</v>
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu