generated with GenerateXY
Generator xy.generator.2.0
This is the meta-generator that is used to define other generators.
Description
A generator specification root element
Attributes
-
(required) name
Identifies the generator. A hierarchical naming pattern is used. Levels in the hierarchy are separated by periods (.). Each word between the '.' characters are mapped to folders and sub-folders in the repository just like in the Java package naming strategy
-
(optional) documentation
The generator documentation
Elements
Description
Contains the generator input specification
Elements
Description
Contains the generator type definitions
Elements
Description
Defines a complex type element
Attributes
Elements
Description
Defines an attribute
Attributes
Description
Declares a composition with elements of a given type
Attributes
Description
Defines an assertion constraint
Attributes
Description
Defines the root elements allowed in the generator input
Elements
Description
Contains the generator output specification
Elements
Description
Contains actions that will be executed in the context of a given type
Attributes
Elements
Description
Element creation action
Attributes
-
(required) type
Name of the type to instanciate
-
(optional) attributeSettings
Specifies the templates used to evaluate the value of the created element attributes.
The Java property file format is used.
-
(optional) exportAs
This attribute value is used to filter elements that will be imported from another context during the transformation process.
The 'Import > filter' attribute value is matched against it
Elements
Description
Loops through each element in a specified sequence
Attributes
Elements
Description
Allows to guard instructions with a conditional expression
Attributes
Elements
Description
Executes contained actions if the preceding 'If' conditional expression evaluates to 'false'
Elements
Description
Executes a XSLT script that creates the XML representation of elements
Attributes
Description
Executes Java code that creates elements
Attributes
-
(required) statements
The Java statements that creates the elements.
You have access to the following variables in the statements:
- java.util.List<Model> result: The variable that holds the execution result.
You have to add your created Models to it.
Ex: result.add(myModel);
- xy.Processor.ProcessingContext context: This variable holds information about the processing context.
Ex:
. context.getNode(): the current element
. context.getModel(): the model of the current node
. context.getEngine(): the current engine
. ...
The syntax is similar to a java method body syntax (same variable declarations and assignments, method calls, loops, and conditionals).
Visit this web page for more information: http://www.beanshell.org/manual/syntax.html#Standard_Java_Syntax
Description
Imports actions from another context
Attributes
-
(required) from.expression
XPath expression that specifies the input element that generates the output elements that will be impoted
-
(optional) filter
A regular expression used to select/filter elements that must be imported.
It is matched against the '(CreateElement|Import)/@exportAs' attribute value.
Remarks:
- The Java regular expression syntax is used
- An empty value would match with empty 'exportAs' attribute value
- Unless the metacharacters ^ and $ are used as anchors, the string is considered to match the pattern if any substring matches the pattern
-
(optional) exportAs
See 'CreateElement > exportAs'.
This attribute value is used to set the 'exportAs' attribute value of elements resolved from the current 'Import' specification
Description
Allows to group instructions
Attributes
Elements
Description
A descriptive text
Attributes
Description
Contains parameterized actions that can be executed as a unique instruction elsewhere
Attributes
Elements
Description
Executes a macro
Attributes
Description
Contains the user-defined functions that can be called from any XPath expression within the generator
Elements
Description
Defines a function
Attributes