Each Cartridge descriptor (andromda-cartridge.xml) must comply with the following XSD Schema:
<xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema"elementFormDefault="qualified"> <xs:elementname="cartridge"> <xs:complexType> <xs:sequence> <xs:elementref="templateEngine"minOccurs="0"maxOccurs="1"/> <xs:elementref="templateObject"minOccurs="0"maxOccurs="unbounded"/><!-- these are references to properties that are expected to be supplied by the calling client through a <namespace/> element. When the property name and its value are supplied in the build file for example, that property is then supplied to the template. --><xs:elementref="property"minOccurs="0"maxOccurs="unbounded"/><!-- a resource defines any non template resource included in the cartridge, these can include things such as files, images, etc, that are copied to a given outlet, resources are NOT processed by a template engine --><xs:elementref="resource"minOccurs="0"maxOccurs="unbounded"/><!-- these define the templates a cartridge contains, these are processed by an AndroMDA template engine --><xs:elementref="template"minOccurs="1"maxOccurs="unbounded"/> </xs:sequence> <xs:attributename="name"type="xs:string"use="optional"/> </xs:complexType> <xs:uniquename="uniquePropertyReference"> <xs:selectorxpath="property"/> <xs:fieldxpath="@reference"/> </xs:unique> </xs:element> <xs:elementname="property"> <xs:complexType><!-- defines a reference to a <property/> element defined within a namespace element in your build file --><xs:attributename="reference"use="required"/> </xs:complexType> </xs:element><!-- this is the grouping of all modelElements supported within a template --><xs:elementname="modelElements"> <xs:complexType> <xs:sequence><!-- You can define as many modelElements as you want --><xs:elementref="modelElement"minOccurs="1"maxOccurs="unbounded"/> </xs:sequence><!-- the default variable name to use for any modelElements define in your <template/> element, this will be used if no variable attribute is defined at the <modelElement/> element --><xs:attributename="variable"type="xs:string"use="optional"/> </xs:complexType> </xs:element> <xs:elementname="modelElement"> <xs:complexType> <xs:sequence><!-- types allow you to group model elements by type of metafacade and by a metafacade's properties --><xs:elementname="type"minOccurs="0"maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:elementname="property"minOccurs="0"maxOccurs="unbounded"> <xs:complexTypemixed="true"><!-- This defines the name of the type's property --><xs:attributename="name"use="required"/> </xs:complexType> </xs:element> </xs:sequence><!-- Specifies the type's name --><xs:attributename="name"use="required"/> </xs:complexType> </xs:element> </xs:sequence><!-- a stereotype name from the model that will be processed (i.e. entity, enumeration, etc.) --><xs:attributename="stereotype"use="optional"/><!-- defines the variable name that should be placed into the template engine context, for all model elements having the modelElement with the stereotype attribute, if this is not defined, then the variable from the enclosing <modelElements/> element will be used. --><xs:attributename="variable"use="optional"/> </xs:complexType> <xs:uniquename="uniquePropertyName"> <xs:selectorxpath="property"/> <xs:fieldxpath="@name"/> </xs:unique> </xs:element> <xs:complexTypename="resourceType"><!-- the resource to process --><xs:attributename="path"type="xs:string"use="required"/><!-- the pattern to use for defining output --><xs:attributename="outputPattern"type="xs:string"use="required"/> <xs:attributename="outlet"type="xs:string"use="required"/><!-- true/false on whether we should overwrite results of previous run --><xs:attributename="overwrite"type="xs:boolean"use="required"/> </xs:complexType> <xs:elementname="resource"type="resourceType"/> <xs:elementname="template"> <xs:complexType> <xs:complexContent> <xs:extensionbase="resourceType"><!-- You can have as many modelElements as you want for a template or you don't even need to add model elements to your template --><xs:sequence> <xs:elementref="modelElements"minOccurs="0"maxOccurs="1"/> </xs:sequence><!-- true/false on whether we should allow generation of empty files--><xs:attributename="generateEmptyFiles"type="xs:boolean"/><!-- if this flag is set to true, then all model elments processed by the template will be output to one template as collection of model elements (instead of on a per model element per file basis) --><xs:attributename="outputToSingleFile"type="xs:boolean"use="optional"/><!-- This only makes sense when outputToSingleFile is true. If this flag is set to true, then the file will be output regardless of whether or not there are no elements found in the collected model elements, if false then the file will not be output --><xs:attributename="outputOnEmptyElements"type="xs:boolean"use="optional"/> </xs:extension> </xs:complexContent> </xs:complexType> </xs:element> <xs:elementname="templateObject"> <xs:complexType> <xs:sequence> <xs:elementref="property"minOccurs="0"maxOccurs="unbounded"/> </xs:sequence><!-- the name of the templateObject (this is the scripting variable name made available to the template being processed) --><xs:attributename="name"type="xs:string"use="required"/><!-- the class of the templateObject (must have a default constructor) --><xs:attributename="className"type="xs:string"use="required"/> </xs:complexType> <xs:uniquename="uniqueTemplateObjectPropertyReference"> <xs:selectorxpath="property"/> <xs:fieldxpath="@reference"/> </xs:unique> </xs:element><!-- Defines a macro library that can be used with commonly used scripting engine macros --><xs:elementname="macrolibrary"> <xs:complexType> <xs:attributename="name"type="xs:string"use="required"/> </xs:complexType> </xs:element><!-- you configure the template engine through here --><xs:elementname="templateEngine"> <xs:complexType> <xs:sequence> <xs:elementref="macrolibrary"minOccurs="0"maxOccurs="unbounded"/> </xs:sequence><!-- the class of the TemplateEngine implementation (must have a default constructor) --><xs:attributename="className"type="xs:string"use="optional"/> </xs:complexType> </xs:element> </xs:schema>