<?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 |tag, sys| -%>
<!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",
                  "consensus", "submissionType=submissiontype", "xml:lang=lang",
                  "number", "obsoletes", "updates", "seriesNo=seriesno") %>>

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

<% ps.arr("author") do |au|
   aups = KramdownRFC::authorps_from_hash(au)
 -%>
<%= KramdownRFC::person_element_from_aups("author", aups) -%>
<%   aups.warn_if_leftovers  -%>
<% end -%>

    <date <%= KramdownRFC::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 =~ /\A(to_be_removed_)?note_(.*)/ -%>

<% option = ""
       text = ""
       if $1
         if $options.v3
           option = " removeInRFC=\"true\""
         else
           text = "      <t>[This note is to be removed before publishing as an RFC.]</t>\n"
         end
       end
    -%>
    <note title="<%= $2.gsub("_", " ")%>"<%= option %>>
<%= text -%>

<%= 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") %>
<% sh = sechash.delete("contributor") -%>
<% consec = ps.has("contributor") -%>
<% if sh || consec -%>
<%   if $options.v3 -%>
    <section anchor="contributors" numbered="false" toc="include" removeInRFC="false">
        <name>Contributors</name>
<%   else -%>
    <section anchor="contributors" numbered="false" title="Contributors">
<%     warn "*** Cannot process YAML contributors under V2 rules" if consec -%>
<%   end -%>
<%= sh -%>
<% if $options.v3 && consec
     ps.arr("contributor") do |au|
       aups = KramdownRFC::authorps_from_hash(au)
   -%>
<%= KramdownRFC::person_element_from_aups("contact", aups) -%>
<%   aups.warn_if_leftovers  -%>
<%   end -%>
<% end -%>
    </section>
<% end -%>

  </back>

<% if $source -%>
<!-- ##markdown-source:
<%= $source %>
-->
<% end -%>

</rfc>
