USXSL internal component

Previous Next

The USXSL internal component lets you use XSLT to transform XML documents and extract data from an XML document. The component makes it easy to embed XSLT transformations in a USoft application. You can use it to:

Apply an XSL transformation to an XML document (USXSL.Apply).

Retrieve a value from an XML document (USXSL.Value).

Retrieve a complete node from an XML document (USXSL.Node).

Temporarily store an XML or XSL document in memory (USXSL.SetXML, USXSL.SetXSL, USXSL.SetGlobalXSL).

Mix USoft application data into an XSLT transformation.

Encoding

A different encoding is produced depending on whether the output is internal or external.

The USXSL component produces UTF-16 output encoding internally, ie., as long as the output is not written to a file on the file system or passed to a third party by way of a webservice call. This is because with UTF-16 we can easily exchange Unicode characters with controls and other Windows-related interfaces. UTF-16 is also the encoding recommended by Microsoft.

Correspondingly, in this case, the USXSL component produces the attribute encoding="UTF-16" in the XML declaration at the top of the output document. You cannot change this behaviour. It applies regardless of what is the value of the encoding attribute of the <xsl:output> instruction in the XSL stylesheet (if such an attribute is present).

By default, the USXSL component produces UTF-8 output encoding externally, ie., when the result is written to a file on the file system, as is the case when you call USXSL.Apply2File, or is passed to a third party by way of a webservice call. This is because UTF-8 is a common default in these cases. You can obtain a different external output encoding by specifying it as the encoding attribute of the <xsl:output> instruction in the XSL stylesheet, for example:

<xsl:output encoding="UTF-16"/>

or

<xsl:output encoding="ISO-8859-1"/>

 

Methods

The USXSL internal component has the following methods:

USXSL.Apply

USXSL.Apply2File

USXSL.Node

USXSL.SetGlobalXsl

USXSL.SetXml

USXSL.SetXsl

USXSL.Value

 

See also

XML and the Rules Engine