Loading and Deleting an XSLT Style Sheet

XSLT style sheets are used to transform an XML message for rendering. The style sheets are created using an XSL editor. The xsl file can be staged in the file system or loaded into the database.

Note: The XML parser does not support nested style sheets using the xsl: import function. Define individual style sheets instead.

The ECX:XSLT File Path profile option identifies the file system directory where XSLT style sheets are staged. The engine checks the database first for the stylesheet, then if necessary, checks the file system.

Style sheets can be used by XML Gateway in one of two ways:

  1. To be applied to an XML message generated or received by Oracle XML Gateway. This is accomplished by defining the XSLT Transformation action in the message map to reference a valid style sheet. Refer to XSLT Transformation for details on how to define this action.

  2. Passed with a well-formed and valid XML message to the ECX_STANDARD.perform_xslt_transformation API to process and return a transformed XML message for further processing by the calling environment. Refer to ECX_STANDARD.perform_xslt_transformation API for details regarding this API.

Because the engine will look for the style sheet in the database or the file system, you have the option of either loading or staging the stylesheet. To prevent accidental overwrite, a style sheet should reside in only one place.

Style sheets can be loaded into the database as follows:

  1. Move <myxsl>.xsl file from the local file system to the middle tier.

  2. Execute java LoadXSLTToClob <DB username> <DB password> <Hostname>:<Port>:<SID> <myxsl.xsl> <Application_code> <Version>

    <Application_code> is the subdirectory where the XSLT style sheet is source-controlled (for example: ar/xml/xslt)

    If <Version> is not specified, the file with the highest version that matches the file name, application code, and file type is loaded into the ecx_files table. If a matching style sheet is found in the ecx_files table, the row is updated. If the specified style sheet is not found in the ecx_files table, a new row is added to the table with version number 0.

Style sheets can be deleted from the database as follows:

Execute java DeleteXSLTToClob <DB username> <DB password> <Hostname>:<Port>:SID> <myxsl.xsl> <Application_code> <Version>

<Application Code> is the name of the subdirectory where the XSLT style sheet is source-controlled (for example: ar/xml/xslt).

If version is not specified, the file with the highest version that matches the file name, application code, and file type is deleted from the ecx_files table. Execute this program multiple times to delete multiple versions of a style sheet.