In addition to customizing existing generators, Xomega allows you to create your own XSLT-based generators and add them to your project, so that they could be run manually or automatically as part of the build process. Depending on the complexity of your generator, you may need to have a good knowledge of the XSLT 2.0 technology, including the standard XPath functions. You can also leverage some of the internal reusable custom functions and templates that support other Xomega generators, which you can see examples of by studying the other generators, or you can build your own functions and templates from scratch.
Here are the steps involved in developing your own generator. Note, that they require the Full edition of Xomega.Net as well as potentially availability of the source code for other generators.
- Create a new XSL script for your generator. Set that version attribute of the stylesheet element to 2.0.
- You can import the format.xsl Xomega script for a set of common helpful functions and templates for formatting names, etc.
- You can alternatively import the common.xsl Xomega script for an additional set of common helpful functions and templates for working with Xomega model elements.
- You can also import other more specific Xomega shared scripts, such as aspnet_common.xsl, wpf_common.xsl, db_shcema.xsl, etc., which automatically include the previous common scripts.
- Develop the logic of your generator.
- Add your generator to your Xomega model project.
- Debug your generator against your model to eliminate any errors.
- Start using the generator to generate your code or other artifacts either once or continually, if your generator is rerunnable.