Prev | Next |
XSL Transforms
Model, Author and Execute XSLT Transforms and Stylesheets with XML Documents
Enterprise Architect provides facilities for modeling and executing XSL Transformations. XSLT is a technology that can be used to convert XML input documents into other types of document. Stylesheets are the XSL components used to transform the content. Facilities include:
- Specialized diagram and toolbox for modeling XSLT transformations
- Specialized editor for Stylesheet authoring, debugging and execution.
- XML document validation
- XML Schema validation
You model a transformation using the XML Transform diagram. On this diagram you can create xml documents and stylesheets, link them to a transformation (Activity) and then execute or debug the transformation. Inputs to the XSL Transform model are the XSLT and XML File Artifacts, which can be selected from the toolbox. These artifacts are most commonly created by dragging appropriate xml and xsl files on to the diagram. Output from the Transformation is described using the Output Artifact. The progress and success/failure of the transformation is shown on the 'XSLT' tab of the System Output window.
Create the XML Transform Diagram
Step |
Action |
See also |
---|---|---|
1 |
In the Browser window, right-click on the appropriate Package and select the 'Add Diagram' option. |
Artifact Elements in the XML Transformation Toolbox
Artifact |
Description |
---|---|
XML Transform |
The model reference for the transformation, providing inputs and optional outputs. Used to run or debug the transformation. Inputs: XML File, XSLT Outputs: Output Artifact (Optional) |
2 |
In the 'New Diagram' dialog, type an appropriate diagram name in the 'Name' field (if necessary) and click on 'Extended' in the 'Select From' list and 'XML Transform' in the 'Diagram Types' list. Click on the . The new diagram opens, with the Diagram Toolbox showing the 'XML Transformation' page. |
XSLT |
Identifies the stylesheet to execute. Inputs: N/A Outputs: N/A |
XML File |
Identifies the input document to transform. Inputs: N/A Outputs: N/A |
XSD |
Identifies the schema that can be used, optionally, to automatically perform XML validation on the output document. Inputs: Output Artifact, XML File, (or optional both) Outputs: N/A |
Output Artifact |
Use this Artifact to define the output of an XSLT operation. The Artifact provides the file path to use when output is created by the transform. To select or name the output file, double-click on the Artifact to display its properties and enter the file path under the 'Files' tab. To make use of the Artifact, draw a trace connector to it from the transform element. |
Manually Validate documents
Using Enterprise Architect, you can perform XML validation both of documents to be transformed and of XSLT stylesheets.
To run the validation, right-click in the XML document or stylesheet in the XSL Debugger and select 'XML Validation'. A prompt displays to confirm if you are validating against a document type definition or an XML Schema.
- For a document type definition, simply click on the ; the validation proceeds
- For an XML schema, select the appropriate radio button to identify if the validation grammar is defined within the document or elsewhere; if elsewhere, enter the namespace and URL or file path for the grammar
If errors are found during a debugging run, they will be output to the Debug window (press to display this window).
If errors are found during a normal validation run, they will be output to the 'XSL' tab of the System Output window (press and select 'System Output' if this window does not display automatically). To locate the error in the document, double-click on the error message.
XSLT Processor and Version
The XSL Processor used in these features is built from the Apache Xalan Project (C++ version 1.11)