XSLT Tools for XSD to CAM

The tools provided here allow you to extract and ingest various components from inside XSD schema and automatically generate the equivalent CAM template components.

They are designed to save you time if you have an existing XSD schema for your XML instances and want to apply those same rules in your CAM templates.

The tools are provided as a ZIP file with a readme instructions. The tools have been tested with Saxon 9.0 xslt processor in OxygenXML and Stylus Studio - but should run with other tools such as XMLSpy as well - or the Saxon 9.0 command line version.

The tools are also integrated in the jCAM Eclipse editor for CAM - available from here.

A tutorial for using these tools is available here.

There is a schema expander tool for XSD include or import statements so if your XSD uses these you will need to run that first to produce an expanded result to use for the main generation process.

To download the ZIP file with the XSD 2 CAM utilities in it - click here.

Example of generated CAM template

This link shows you an example of the CAM rules generated from the OASIS EDXL schema. The original XSD is 291K while the equivalent CAM template is 90K.

EDXL example generated template

Example of generated XML instance

This link shows you an example of the XML created by the instance generator. This will produce zero errors when validated with the above CAM template. The generator is designed to help you create a conformance test suite to use with your CAM templates. The source XSLT for the instance generator is here. This generator uses the internal CXF format of the CAM template from the jCAM editor (can be exported from inside jCAM editor).

Valid EDXL test instance generated by XSD2CAM generator tool

Example of EDXL rules report from jCAM editor

The link here shows an example of the rules report output from jCAM editor from the generated CAM template. It shows how the CAM template provides documentation of the content handling rules from inside your XSD schema in a simple tabular report format that can then be visually inspected and verified.

EDXL rules report

XSLT for converting XSD documentation to CAM annotation details

Source code


<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:as="http://www.oasis-open.org/committees/cam" xmlns:camed="http://jcam.org.uk/editor" exclude-result-prefixes="xs xsd" version="1.0">

<!-- Provided "as is" License: Creative Commons - http://creativecommons.org/licenses/by-sa/3.0/

<!--

-->

<xsl:template match="*">

</xsl:template>

</xsl:stylesheet>


XSD_and_CAM (last edited 2009-08-12 18:02:27 by localhost)