{#- -*- mode: sgml; tab-width: 1; indent-tabs-mode: nil -*-
 #
 # SPDX-License-Identifier: MIT
-#}

{%- import('macros/printElementId.xml.jinja2') as peid %}
{%- import('macros/printParam.xml.jinja2') as pp %}
{%- import('macros/printSpecialData.xml.jinja2') as psd %}

{%- macro printResponse(resp, tag_name="POS-RESPONSE") -%}
<{{tag_name}} {{-peid.printElementIdAttribs(resp)}}>
 {{ peid.printElementIdSubtags(resp)|indent(1) }}
{%- if resp.parameters %}
 <PARAMS>
{%- for param in resp.parameters -%}
  {{ pp.printParam(param)|indent(2) }}
{%- endfor %}
 </PARAMS>
{%- endif %}
 {{- psd.printSpecialDataGroups(resp.sdgs)|indent(1, first=True) }}
</{{tag_name}}>
{%- endmacro -%}
