Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 24.0
Otp

The XSLT adapter (<<XSLTAdapter>>) enables the transformation of XML documents into XHTML documents or to other XML documents. The E2E Builder supports the import of XSLT scripts or XSLT script archives into the UML model. XSLT scripts can be called in the UML model with the XSLT adapter. The XSLT processor chosen in the component diagram executes the transformation as defined for the XSLT adapter in the activity diagram.

Refer to the example model referenced below, which shows how to transform an XML document into an HTML document.

Multiexcerpt include
MultiExcerptNamexslt
nopaneltrue
PageWithExcerptINTERNAL:_examples_BRIDGE

Parameter

Refer to the example model referenced below, which shows how to transform an XML document into an HTML document.

Multiexcerpt include
MultiExcerptNamexslt_param

...

h1.Script

Refer to the example model referenced below, which shows how to transform an XML document into an HTML document.

...

nopaneltrue
PageWithExcerptINTERNAL:_examples_BRIDGE

...

Logging with XSLT

It is possible to write logs into the E2E Bridge using XSLT. While the syntax for the two XSLT processors Saxon and Xalan is slightly different, the procedure is the same: First, the prefix must be declared. Second, the logging is executed.

Four methods are available for both loggers. The methods correspond to the Bridge Server Log Levels:

MethodBridge Server Log Level
errorError
warningWarning
infoInfo
debugDebug

Examples

In the examples below, the syntax for the two XSLT processors Saxon and Xalan is shown using the method logger:info.

Logging with Saxon

Code Block
languagexml
linenumberstrue
<?xml version="1.0"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
               xmlns:logger="java:ch.e2e.bridge.server.xslt.XSLTSaxonLogger"
               extension-element-prefixes="bridgeLog">
 
	<xsl:template match="/">
		<xsl:value-of select="logger:info('XSLT_01', 'Starting script mySaxonScript.xsl')"/>
	</xsl:template>
 
</xsl:transform>

Logging with Xalan

Code Block
languagexml
linenumberstrue
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                xmlns:xalan="http://xml.apache.org/xalan"
                xmlns:logger="BridgeLogger"
                extension-element-prefixes="logger">

	<xalan:component prefix="logger" elements="debug info warning error">
		<xalan:script lang="javaclass" src="xalan://ch.e2e.bridge.server.xslt.XSLTXalanLogger"/>
	</xalan:component>

	<xsl:template match="/">
		<logger:info code="XSLT_01" message="Starting script myXalanScript.xsl"/>
	</xsl:template>

</xsl:stylesheet>
Panel
titleOn this Page:
Table of Contents