<?xml version="1.0" encoding="<%=ps[:coding]||"UTF-8"%>"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version <%=
    Gem.loaded_specs["kramdown-rfc2629"].version rescue nil %> -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<% ps.arr("bibxml") do |bib|
   tag, sys = bibtagsys(bib) -%>
<!ENTITY <%= tag %> SYSTEM "<%= sys %>">
<% end -%>
<% ps.arr("entity", false) do |en, ev| -%>
<!ENTITY <%=en%> "<%=ev%>">
<% end -%>
]>

<% ps.arr("pi", false) do |pi, val| -%>
<?rfc <%=pi%>="<%= {true => "yes", false => "no", nil => "yes"}[val] || val %>"?>
<% end -%>

<rfc <%= ps.attrs("ipr", "docName=docname", "category=cat",
                  "number", "obsoletes", "updates", "seriesNo=seriesno") %>>

  <front>
    <%= ps.ele("title", ps.attr("abbrev=titleabbrev")) %>

<% ps.arr("author") do |au|
   aups = authorps_from_hash(au)
 -%>
    <author <%=aups.attrs("initials", "surname", "fullname=name", "role")%>>
      <%= aups.ele("organization=org", aups.attr("abbrev=orgabbrev"), "") %>
      <address>
<% postal = %w{street city region code country}.select{|gi| aups.has(gi)}
   if postal != [] -%>
        <postal>
<%   postal.each do |gi| -%>
          <%= aups.ele(gi) %>
<%   end -%>
        </postal>
<% end -%>
<% %w{phone facsimile email uri}.select{|gi| aups.has(gi)}.each do |gi| -%>
        <%= aups.ele(gi) %>
<% end -%>
      </address>
    </author>
<%   aups.warn_if_leftovers  -%>
<% end -%>

    <date <%= dateattrs(ps[:date]||Date.today) %>/>

    <%= ps.ele("area") %>
    <%= ps.ele("workgroup=wg") %>
    <%= ps.ele("keyword=kw") %>

    <abstract>

<%= sechash.delete("abstract") %>

    </abstract>

<% sechash.keys.each do |k| -%>
<%   if k =~ /\Anote_(.*)/ -%>

    <note title="<%= $1.gsub("_", " ")%>">

<%= sechash.delete(k) -%>

    </note>

<% end -%>
<% end -%>

  </front>

  <middle>

<%= sechash.delete("middle") %>

  </middle>

  <back>

<% if sh = sechash.delete("normative") -%>
    <references title='Normative References'>

<%= sh %>

    </references>
<% end -%>

<% if sh = sechash.delete("informative") -%>
    <references title='Informative References'>

<%= sh %>

    </references>
<% end -%>

<%= sechash.delete("back") %>

  </back>
</rfc>
