Template:Constraint: Difference between revisions
Jump to navigation
Jump to search
[checked revision] | [checked revision] |
(Created page with "<includeonly>{{attr|{{{1}}}}}: {{#switch:{{{2}}}|xsd={{xsdType|{{{3}}}}}|rml={{railMLType|{{{3}}}}}}} {{#if:{{{4|}}}|{{default|{{{4}}}|{{{5}}}}}</includeonly><noinclude> ca...") |
No edit summary |
||
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
< | <includeonly><noinclude> | ||
[[category: | Collecting defaults: | ||
</noinclude>{{#if:{{{default|}}}|{{defaults|Element=[[{{PAGENAME}}]]|Attribute={{{1}}}|Value={{{default}}}}}}}<noinclude> | |||
Core: | |||
</noinclude>{{attr|{{{1}}}}}: {{#switch:{{{2}}} | |||
|xs | |||
|xsd={{xsdType|{{{3}}}}}|rml={{{3}}} ({{railMLType|{{{3}}}}})|#default=FIXME}}{{#if:{{{default|}}}|<nowiki>; </nowiki>{{default|{{{default}}}}}}}; {{{4|optional}}}</includeonly><noinclude> | |||
==Usage== | |||
This template standardizes the declaration of constraints. It became necessary to process the default values. | |||
===Parameters=== | |||
The template has 4 unnamed Parameters and a named one: | |||
# The attribute name to which the constraint applies | |||
# ''xsd'' for standard types like string and boolean resp. rml for generic {{rml}} types like tGenericRef | |||
# the type, e.g. ''string'' or ''tGenericRef'' | |||
# is the attribute ''optional'' (default) or ''required''? | |||
*'''default''': the default vaue (optional), e.g. ''TRUE'' | |||
==Examples== | |||
<pre>*{{constraint|vehicleRef|rml|tGenericRef|mandatory}}</pre> | |||
delivers | |||
*{{constraint|vehicleRef|rml|tGenericRef|mandatory}} | |||
<pre>*{{constraint|vehicleCount|rml|tCounter|default=1}}</pre> | |||
delivers | |||
*{{constraint|vehicleCount|rml|tCounter|default=1}} | |||
<pre>*{{constraint|frontGangway|xsd|boolean}}</pre> | |||
delivers | |||
*{{constraint|frontGangway|xsd|boolean}} | |||
[[category:ContentTemplate]] | |||
</noinclude> | </noinclude> |
Latest revision as of 15:41, 27 June 2022
Usage
This template standardizes the declaration of constraints. It became necessary to process the default values.
Parameters
The template has 4 unnamed Parameters and a named one:
- The attribute name to which the constraint applies
- xsd for standard types like string and boolean resp. rml for generic railML® types like tGenericRef
- the type, e.g. string or tGenericRef
- is the attribute optional (default) or required?
- default: the default vaue (optional), e.g. TRUE
Examples
*{{constraint|vehicleRef|rml|tGenericRef|mandatory}}
delivers
- vehicleRef: tGenericRef (xs:IDREF); mandatory
*{{constraint|vehicleCount|rml|tCounter|default=1}}
delivers
- vehicleCount: tCounter (xs:nonNegativeInteger); default: 1; optional
*{{constraint|frontGangway|xsd|boolean}}
delivers
- frontGangway: xs:boolean; optional