Binding configuration
Binding
Syntax
<Binding>
<SectionModelBinding ... >
...
</SectionModelBinding>
</Binding>
Child sections
SectionModelBinding
A SectionModelBinding defines how the model should be mapped to the template.
Syntax
<SectionModelBinding
section="..."
modelXPath="..."
placeholderName="..."
variableName="..."
>
<Literals>
<Literal ... />
</Literals>
<Placeholders>
<Placeholder ... />
</Placeholders>
<SectionModelBinding ... >
...
</SectionModelBinding>
</SectionModelBinding>
Parameters
Parameter |
Description |
Default |
Remark |
section |
The name of the section as defined in the template or in the config. For each section name there can only be one binding specified. |
|
|
modelXPath |
The XPath expression which can be applied on the model to get to the XML element to bind to the section. |
|
See XPath. |
placeholderName |
The name of the placeholder of the current element. |
The same as section |
|
variableName |
The variable name which is bound to the current element within a section. |
|
This variable can be used in any XPath expression in a child element of this SectionModelBinding. When using the varibale in a XPath it must be prefixed with a $, for example the variable with name 'someVariable' can be accessed in a XPath expression using $someVariable. |
Child sections
Section |
Description |
Literal |
See Literal |
Placeholder |
See Placeholder |
SectionModelBinding |
A SectionModelBinding configuration in itself can contain a SectionModelBinding configuration. So it can be defined recursively. |
Literal
A literal configuration within a SectionModelBinding can be used to replace a literal piece of text in the template with a value from the model using a XPath expression.
Syntax
<Literal
literal="..."
modelXPath="..."
/>
Parameters
Parameter |
Description |
Default |
Remark |
literal |
The literal to find in the template. |
|
|
modelXPath |
The XPath expression which can be applied on the current element to get the value for the literal. |
|
See XPath. |
Placeholder
Syntax
<Placeholder
name="..."
modelXPath="..."
variableName="..."
/>
Parameters
Parameter |
Description |
Default |
Remark |
name |
The name of the placeholder. |
|
|
modelXPath |
The XPath expression which can be applied on the current element to get the element for the placeholder. |
|
See XPath. |
variableName |
The variable name which is bound to the node the modelXPath points to. |
|
This variable can be used in any XPath expression in a following element of the SectionModelBinding the placeholder is defined in. When using the varibale in a XPath it must be prefixed with a $, for example the variable with name 'someVariable' can be accessed in a XPath expression using $someVariable. |