Debian Codegraph @

examples/basics/10_jinja2_templating/templates/macros-inspire.jinja2

raw
1 {# Jinja2 Macros for INSPIRE-related elements #}
2
3 {# Macro that renders an inspireId (base:Identifier) element with optional version id #}
4 {% macro render_inspire_id(namespace, local_id, version_id=None) -%}
5 <!-- Rendered by macro render_inspire_id() -->
6 <base:Identifier>
7 <base:localId>{{ local_id }}</base:localId>
8 <base:namespace>{{ namespace }}</base:namespace>
9 {% if version_id != None %}
10 <base:versionId>{{ version }}</base:versionId>
11 {% endif %}
12 </base:Identifier>
13 {%- endmacro %}
14
15 {# Macro that renders a minimal GeographicalName #}
16 {% macro render_geographical_name(name, globals) -%}
17 <GN:GeographicalName>
18 <GN:language xsi:nil="true"/>
19 <GN:nativeness codeSpace="http://schemas.kademo.nl/inspire/codelist-1004/NativenessValue.xml">endonym</GN:nativeness>
20 <GN:nameStatus codeSpace="http://schemas.kademo.nl/inspire/codelist-1004/NameStatusValue.xml">official</GN:nameStatus>
21 <GN:sourceOfName>{{ globals.source }}</GN:sourceOfName>
22 <GN:pronunciation xsi:nil="true" nilReason="other:unpopulated"/>
23 <GN:spelling>
24 <GN:SpellingOfName>
25 <GN:text>{{ name }}</GN:text>
26 <GN:script>{{ globals.script }}</GN:script>
27 </GN:SpellingOfName>
28 </GN:spelling>
29 <GN:grammaticalGender xsi:nil="true"/>
30 <GN:grammaticalNumber xsi:nil="true"/>
31 </GN:GeographicalName>
32 {%- endmacro %}