// in body €_3DcbHfTP2t of emit_xhtml function €_8IYFtn8, after the debug start
// arguments of emit_xhtml: [v_html o_emitctx o_strbuf v_depth]
// locals of emit_xhtml: {o_comp o_conn o_html v_comp v_resapp v_resemit o_spacing v_clos v_emitnode v_emitopen}
// numbers of emit_xhtml: {i_depth ii leni}

/// that was never added, up to commit 5c78727ecfb881045e2037 on Jan 18
/// we really want to emit XHTML5 ; should also look into MathML & mathjax.org


,nval checklenione $[^cond ($[^when (
  *unequal_int(leni 1)
  $[^fail (*make_node (!failure_bad_rank !emit_xhtml v_html o_emitctx o_strbuf *taggedint(i_depth)
  )) !:comment "fail-bad-rank emit_xhtml v_html o_emitctx o_strbuf depth"]
) !:comment "when leni != 1 fail //emit_xhtml"]
) !:comment "if leni != 1 fail //emit xhtml"]

// replace the €_2Pz8uFijO empty cond placeholder on v_html // emit_xhtml
//
,put _3DcbHfTP2te_8Zw8Uhy9eU6 4

$[^cond (

$[^when (*is_stringv (v_html)
  $[^out (o_strbuf *html_enc(*bytstring(v_html))) !:comment "emit html-encoded v_html string"]
 ) !:comment "when v_html is string"]

$[^when (*is_intv (v_html)
  $[^out (o_strbuf *int(*val_to_int(v_html))) !:comment "emit integer v_html"]
 ) !:comment "when v_html is int"]

$[^when (*is_null (v_html)
 $[^no_op () !:comment "no_op for null"]
 $[^return !none]
) !:comment "when v_html is null noop"]

$[^when (*is_doublev (v_html)
  $[^out (o_strbuf *double_plain(*val_to_double(v_html))) !:comment "emit double v_html"]
 ) !:comment "when v_html is double"]


$[^when (*is_objectv(v_html)
 $[^assign (o_html *val_to_object(v_html)) !:comment "o_html := v_html"]
 $[^objswitch (o_html // €_8lmPaSnQ7v
 $[^when (newline
  $[^out (o_strbuf *newline()) !:comment "emit-newline"]
  ) !:comment "when newline"]
 $[^when (nlsp
  $[^out (o_strbuf *nlsp()) !:comment "emit-nl/sp"]
  ) !:comment "when nlsp"]
 $[^when (space
  $[^out (o_strbuf *space()) !:comment "emit-space"]
  ) !:comment "when space"]
 $[^when (none
  $[^run (#{/*no-op when none emit_xhtml*/}#)
     !:comment "no-op when none //emit_xhtml"]
  )  !:comment "when none //emit_xhtml"]

 /// else
 $[^lockobj (o_html

   $[^run ( #{/*debug emit_xhtml object o_html o_emitctx o_strbuf depth*/
   DBGPRINTF_BM("emit_xhtml object €%.9s o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
   "$stmtid",
   objectdbg_BM($o_html),
   objectdbg1_BM($o_emitctx),
   objectdbg2_BM($o_strbuf),
   objstrbufferlengthpayl_BM($o_strbuf),
   (long int) ($i_depth));
   }# ) !:comment "debug emit_xhtml object o_html o_emitctx o_strbuf depth"]

   $[^cond (

   /// we did introduce some html_void_element_object
   /// for HTML elements like <br /> or <hr />
   
   //////////////////////////////////
   $[^when (*objectisinstance (o_html !html_void_element_object)
   /// emitxtml_void_html_element == _0FRLxSGQlZ0_0qrrUZlEeKp
   $[^assign(v_resemit *apply (! _0FRLxSGQlZ0_0qrrUZlEeKp  o_html o_emitctx o_strbuf *taggedint(i_depth)))
    !:comment "v_resemit := emitxhtml_void_element (o_html o_emitctx o_strbuf depth) // emit_xhtml"]

   $[^run ( #{/*debug emit_xhtml after emitxhtml_void_element v_resemit o_html o_emitctx o_strbuf depth*/
   DBGPRINTF_BM("emit_xhtml after emitxhtml_void_element €%.9s v_resemit=%s o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
   "$stmtid",
   OUTSTRVALUE_BM($v_resemit),
   objectdbg_BM($o_html),
   objectdbg1_BM($o_emitctx),
   objectdbg2_BM($o_strbuf),
   objstrbufferlengthpayl_BM($o_strbuf),
   (long int) ($i_depth));
   }# ) !:comment "debug emit_xhtml after emitxhtml_void_element v_resemit o_html o_emitctx o_strbuf depth"]

   $[^cond (
     $[^when (*is_null (v_resemit)
       $[^fail (*make_node (! failure_miss ! _0FRLxSGQlZ0_0qrrUZlEeKp !emit_xhtml o_html o_emitctx o_strbuf *taggedint(i_depth) ))
         !:comment "fail-miss emitxhtml_void_element emit_xhtml o_html o_emitctx o_strbuf depth"]
       ) !:comment "when v_resemit is null, fail / emit_xhtml after emitxhtml_void_element"]
   ) !:comment "if v_resemit is null, fail / emit_xhtml after emitxhtml_void_element"]

   $[^return (v_resemit) !:comment "return v_resemit // emit_xhtml after emitxhtml_void_element"]
   
   ) !:comment "when o_html is a html_void_element_object"]


   ////////////////////////////////
   $[^when (*objectisinstance (o_html !html_element_object)
   /// emitxhtml_element == _5NH940lCHYJ_3nuRm3flnzc
   $[^assign(v_resemit *apply (! _5NH940lCHYJ_3nuRm3flnzc  o_html o_emitctx o_strbuf *taggedint(i_depth)))
    !:comment "v_resemit := emitxhtml_element (o_html o_emitctx o_strbuf depth) // emit_xhtml"]
   $[^run ( #{/*debug emit_xhtml after emitxhtml_element v_resemit o_html o_emitctx o_strbuf depth*/
   DBGPRINTF_BM("emit_xhtml after emitxhtml_element €%.9s v_resemit=%s o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
   "$stmtid",
   OUTSTRVALUE_BM($v_resemit),
   objectdbg_BM($o_html),
   objectdbg1_BM($o_emitctx),
   objectdbg2_BM($o_strbuf),
   objstrbufferlengthpayl_BM($o_strbuf),
   (long int) ($i_depth));
   }# ) !:comment "debug emit_xhtml after emitxhtml_element v_resemit o_html o_emitctx o_strbuf depth"]

   $[^cond (
     $[^when (*is_null (v_resemit)
       $[^fail(*make_node (!failure_miss !_5NH940lCHYJ_3nuRm3flnzc !emit_xhtml o_html o_emitctx o_strbuf *taggedint(i_depth)))
         !:comment "fail-miss emitxhtml_element emit_xhtml o_html o_emitctx o_strbuf depth"]
       ) !:comment "when v_resemit is null, fail / emit_xhtml after emitxhtml_element"]
   ) !:comment "if v_resemit is null, fail / emit_xhtml after emitxhtml_element"]
   
   $[^return (v_resemit) !:comment "return v_resemit // emit_xhtml after emitxhtml_element"]

   ) !:comment "when o_html is a html_element_object"]

   ////////////////////////////////
   $[^when (*objectisinstance (o_html !html_active_object)
      $[^assign (v_resemit *send (o_html !emit_xhtml  o_emitctx o_strbuf *taggedint(i_depth)))
    !:comment "v_resemit := o_html.emit_xhtml(o_emitctx o_strbuf depth) // emit_xhtml"]
   $[^run ( #{/*debug emit_xhtml sent to html_active_object v_resemit o_html o_emitctx o_strbuf depth*/
   DBGPRINTF_BM("emit_xhtml sent to html_active_object €%.9s v_resemit=%s o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
   "$stmtid",
   OUTSTRVALUE_BM($v_resemit),
   objectdbg_BM($o_html),
   objectdbg1_BM($o_emitctx),
   objectdbg2_BM($o_strbuf),
   objstrbufferlengthpayl_BM($o_strbuf),
   (long int) ($i_depth));
   }# ) !:comment "debug emit_xhtml sent to html_active_object v_resemit o_html o_emitctx o_strbuf depth"]

   $[^cond (
     $[^when (*is_null (v_resemit)
       $[^fail(*make_node (!failure_miss !emit_xhtml !html_active_object  o_html o_emitctx o_strbuf *taggedint(i_depth)))
         !:comment "fail-miss emit_xhtml html_active_object o_html o_emitctx o_strbuf depth"]
       ) !:comment "when v_resemit is null, fail / emit_xhtml for html_active_object"]
   ) !:comment "if v_resemit is null, fail / emit_xhtml for html_active_object"]
   
   $[^return (v_resemit) !:comment "return v_resemit // emit_xhtml for html_active_object"]
    ) !:comment "when o_html is a html_active_object"]
    
   ////////////////////////////////
   $[^when (*objectisinstance (o_html !html_sequence_object)
     $[^assign (o_spacing *as_object (*send (o_html !html_spacing o_emitctx *taggedint(i_depth))))
      !:comment "o_spacing := o_html.html_spacing(o_emitctx depth) // emit_xhtml for html_sequence_object"]

     $[^assign (leni *objnbcomps(o_html)) !:comment "leni := objnbcomps(o_html) // emit_xhtml for html_sequence_object"]
     $[^run ( #{/*debug emit_xhtml html_sequence_object o_html leni o_spacing o_emitctx o_strbuf depth*/
     DBGPRINTF_BM("emit_xhtml html_sequence_object  €%.9s o_html=%s leni#%ld o_spacing=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
     "$stmtid",
     objectdbg_BM($o_html),
     (long int) ($leni),
     objectdbg1_BM($o_spacing),
     objectdbg2_BM($o_emitctx),
     objectdbg3_BM($o_strbuf),
     objstrbufferlengthpayl_BM($o_strbuf),
     (long int) ($i_depth));
     }# ) !:comment "debug emit_xhtml html_sequence_object o_html leni o_spacing o_emitctx o_strbuf depth"]

     /// for each component, emit_xhtml it with depth+1..
     $[^for_up (ii leni
       $[^cond (
         $[^when (
           *and_then (*greater_int (ii 0) o_spacing)
           $[^objswitch (o_spacing
             $[^when (space
               $[^out (o_strbuf *space()) !:comment "emit-space/ emit_xhtml html_sequence_object"]
             ) !:comment "when o_spacing is space // emit_xhtml html_sequence_object"]
             $[^when (newline
               $[^out (o_strbuf *newline()) !:comment "emit-newline/ emit_xhtml html_sequence_object"]
             ) !:comment "when o_spacing is newline // emit_xhtml html_sequence_object"]
             $[^when (nlsp
               $[^out (o_strbuf *nlsp()) !:comment "emit-nl/sp/ emit_xhtml html_sequence_object"]
             ) !:comment "when o_spacing is nlsp // emit_xhtml html_sequence_object"]
           ) !:comment "objswitch o_spacing  // emit_xhtml for html_sequence_object"]
         ) !:comment "when ii>0 && o_spacing // emit_xhtml for html_sequence_object"]
       ) !:comment "if ii>0 && o_spacing use it // emit_xhtml for html_sequence_object"]
       
       $[^assign (v_comp *objgetcomp(o_html ii)) !:comment "v_comp := o_html[ii] // emit_xhtml for html_sequence_object"]
     $[^run ( #{/*debug emit_xhtml html_sequence_object ii v_comp o_html o_emitctx o_strbuf depth*/
     DBGPRINTF_BM("emit_xhtml html_sequence_object €%.9s ii#%ld v_comp=%s o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
     "$stmtid",
     (long int) ($ii),
     OUTSTRVALUE_BM($v_comp),
     objectdbg_BM($o_html),
     objectdbg1_BM($o_emitctx),
     objectdbg2_BM($o_strbuf),
     objstrbufferlengthpayl_BM($o_strbuf),
     (long int) ($i_depth));
     }# ) !:comment "debug emit_xhtml html_sequence_object ii v_comp o_html o_emitctx o_strbuf depth"]
     
      $[^assign(v_resemit *apply (!emit_xhtml v_comp o_emitctx o_strbuf *taggedint(*add_int(i_depth 1))))
         !:comment "v_resemit := emit_xhtml (v_comp o_emitctx o_strbuf depth+1) // emit_xhtml for html_sequence_object"]
   $[^run ( #{/*debug emit_xhtml for html_sequence_object v_resemit v_comp ii o_html o_emitctx o_strbuf depth*/
   DBGPRINTF_BM("emit_xhtml for html_sequence_object €%.9s v_resemit=%s v_comp=%s ii#%ld o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
   "$stmtid",
   OUTSTRVALUE_BM($v_resemit),
   OUTSTRVALUE_BM($v_comp),
   (long int) ($ii),
   objectdbg_BM($o_html),
   objectdbg1_BM($o_emitctx),
   objectdbg2_BM($o_strbuf),
   objstrbufferlengthpayl_BM($o_strbuf),
   (long int) ($i_depth));
   }# ) !:comment "debug emit_xhtml for html_sequence_object v_resemit v_comp ii o_html o_emitctx o_strbuf depth"]

   $[^cond (
     $[^when (*is_null (v_resemit)
       $[^fail(*make_node (!failure_miss !emit_xhtml !html_sequence_object v_comp *taggedint(ii) o_html o_emitctx o_strbuf *taggedint(i_depth)))
         !:comment "fail-miss emit_xhtml html_sequence_object v_comp ii o_html o_emitctx o_strbuf depth"]
       ) !:comment "when v_resemit is null, fail / emit_xhtml after emitxhtml_element"]
   ) !:comment "if v_resemit is null, fail / emit_xhtml after emitxhtml_element"]
    
     ) !:comment "for ii upto leni // emit_xhtml for html_sequence_object"]
     
   $[^return (v_resemit) !:comment "return o_html // emit_xhtml for html_sequence_object"]

   ) !:comment "when o_html is a html_sequence_object"]
   

   ////////////////
   /// otherwise, get the emit_xhtml slot of that object into v_clos....
   $[^assign (v_clos *objgetattr(o_html !emit_xhtml)) !:comment "v_clos := objgetattr(o_html emit_xhtml) / emit_xhtml"]

   $[^cond (
     $[^when (v_clos
     $[^run ( #{/*emit_xhtml ordinary v_clos o_html o_emitctx o_strbuf depth*/
       DBGPRINTF_BM("emit_xhtml €%.9s ordinary v_clos=%s o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
        "$stmtid",
        OUTSTRVALUE_BM($v_clos),
        objectdbg_BM($o_html),  objectdbg1_BM($o_emitctx),
        objectdbg2_BM($o_strbuf),  objstrbufferlengthpayl_BM($o_strbuf),
        (long int) ($i_depth));
   }# ) !:comment "debug emit_xhtml ordinary v_clos o_html o_emitctx o_strbuf depth"]
      $[^assign(v_resemit *apply (v_clos o_html o_emitctx o_strbuf *taggedint(*add_int(i_depth 1))))
         !:comment "v_resemit := v_clos (o_html o_emitctx o_strbuf depth+1) // emit_xhtml for ordinary with v_clos"]
     $[^run ( #{/*emit_xhtml ordinary v_resemit o_html o_emitctx o_strbuf depth*/
       DBGPRINTF_BM("emit_xhtml €%.9s ordinary v_resemit=%s o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
        "$stmtid",
        OUTSTRVALUE_BM($v_resemit),
        objectdbg_BM($o_html),  objectdbg1_BM($o_emitctx),
        objectdbg2_BM($o_strbuf),   objstrbufferlengthpayl_BM($o_strbuf),
        (long int) ($i_depth));
   }# ) !:comment "debug emit_xhtml ordinary v_resemit o_html o_emitctx o_strbuf depth"]
   $[^cond (
     $[^when (*is_null (v_resemit)
       $[^fail(*make_node (!failure_miss !emit_xhtml v_clos o_html o_emitctx o_strbuf *taggedint(i_depth)))
         !:comment "fail-miss emit_xhtml v_clos o_html o_emitctx o_strbuf depth"]
       ) !:comment "when v_resemit is null, fail / emit_xhtml ordinary with v_clos"]
   ) !:comment "if v_resemit is null, fail / emit_xhtml after emitxhtml_element"]
     ) !:comment "when v_clos exists from o_html.emit_xhtml in emit_xhtml"]

     $[^out (o_strbuf *object(o_html)) !:comment "else emit object o_html // emit_xhtml"]
   ) !:comment "else .... cond if v_clos in emit_xhtml for ordinary object o_html"]


   ) !:comment "cond on o_html ... in emit_xhtml"]
 ) !:comment "otherwise lock o_html ... in emit_xhtml"]
 
 ) !:comment "objswitch o_html ... in emit_xhtml"]

) !:comment "when v_html is an object... in emit_xhtml"]

///////
$[^when (*isnode (v_html)  // this when is €_0TcBev05JBd
 $[^assign (o_conn *nodeconn(v_html)) !:comment "o_conn := nodeconn(v_html)"]
     $[^run ( #{/*emit_xhtml node v_html o_conn o_emitctx o_strbuf depth*/
       DBGPRINTF_BM("emit_xhtml €%.9s node v_html=%s o_conn=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
        "$stmtid",
        OUTSTRVALUE_BM($v_html),
        objectdbg_BM($o_conn),  objectdbg1_BM($o_emitctx),
        objectdbg2_BM($o_strbuf),   objstrbufferlengthpayl_BM($o_strbuf),
        (long int) ($i_depth));
   }# ) !:comment "debug emit_xhtml node v_html o_conn o_emitctx o_strbuf depth"]
   $[^assign (leni *nodewidth(v_comp)) !:comment "leni := nodewidth(v_comp) // emit_xhtml node"]
   /// should handle {buffer c_enc comment hexa html_enc id int object octa raw_string sequence utf8_enc}
   $[^objswitch // this objswitch is €_4ySLl7UU6H
     (o_conn
      $[^when (buffer
        $:checklenione
        $[^assign (o_comp *val_to_object (*nodenthson(v_comp 0)))
           !:comment "o_comp := v_comp[0] as object /emit_xhtml"]
        $[^out (o_strbuf *html_enc(*objstrbufferbytespayl(o_comp)))
           !:comment "emit html_enc(objstrbufferbytespayl(o_comp)) // emit_xhtml node !buffer"]
       ) !:comment "when o_conn is buffer // emit_xhtml node"]
      $[^when (c_enc
        $:checklenione
        $[^out (o_strbuf *c_enc(*bytstring(*nodenthson(v_comp 0))))
           !:comment "emit c_enc(bytstring(v_comp[0])) // emit_xhtml node !c_enc"]
       ) !:comment "when o_conn is c_enc // emit_xhtml node"]
      $[^when (comment
        $:checklenione
        $[^out (o_strbuf "<!--" *html_enc(*bytstring(*nodenthson(v_comp 0)))
                "-->")
           !:comment "emit '<!--' html_enc(v_comp[0]) '-->' // emit_xhtml node !buffer"]
       ) !:comment "when o_conn is comment // emit_xhtml node"]
      $[^when (hexa
        $:checklenione
        $[^out (o_strbuf *hexa (*val_to_int(*nodenthson(v_comp 0))))
           !:comment "emit v_comp[0] in hexa // emit_xhtml node !hexa"]
       ) !:comment "when o_conn is hexa // emit_xhtml node"]
      $[^when (html_enc // double HTML encoding, rarely useful
        $:checklenione
       ) !:comment "when o_conn is html_enc // emit_xhtml node"]
      $[^when (id
        $:checklenione
        $[^out (o_strbuf *id (*as_object(*nodenthson(v_comp 0))))
          !:comment "emit v_comp[0] as an object id"]
       ) !:comment "when o_conn is id // emit_xhtml node"]
      $[^when (int
        $:checklenione
        $[^out (o_strbuf *int (*val_to_int(*nodenthson(v_comp 0))))
           !:comment "emit v_comp[0] in decimal // emit_xhtml node !int"]
       ) !:comment "when o_conn is int // emit_xhtml node"]
      $[^when (object
        $[^out (o_strbuf *object (*as_object(*nodenthson(v_comp 0))))
          !:comment "emit v_comp[0] as an object"]
       ) !:comment "when o_conn is object // emit_xhtml node"]
      $[^when (name
        $[^out (o_strbuf *name (*as_object(*nodenthson(v_comp 0))))
          !:comment "emit v_comp[0] as an object name"]
       ) !:comment "when o_conn is name // emit_xhtml node"]
      $[^when (octa
        $:checklenione
        $[^out (o_strbuf *octa (*val_to_int(*nodenthson(v_comp 0))))
           !:comment "emit v_comp[0] in octal // emit_xhtml node !octa"]
       ) !:comment "when o_conn is octa // emit_xhtml node"]
      $[^when (raw_string
        $:checklenione
        $[^out (o_strbuf *string(*bytstring(*nodenthson(v_comp 0))))
          !:comment "emit v_comp[0] as raw string // emit_xhtml node !raw_string"]
       ) !:comment "when o_conn is raw_string // emit_xhtml node"]
       ///
       $[^when (double_plain
        $:checklenione
        $[^out (o_strbuf *double_plain(*val_to_double(*nodenthson(v_comp 0))))
          !:comment "emit v_comp[0] as plain double // emit_xhtml node !double_plain"]
       ) !:comment "when o_conn is double_plain // emit_xhtml node"]
       $[^when (double_float
        $:checklenione
        $[^out (o_strbuf *double_float(*val_to_double(*nodenthson(v_comp 0))))
          !:comment "emit v_comp[0] as a precise double // emit_xhtml node !double_float"]
       ) !:comment "when o_conn is double_float // emit_xhtml node"]
       $[^when (local_time
        $:checklenione
        $[^out (o_strbuf *local_time(*val_to_double(*nodenthson(v_comp 0))))
          !:comment "emit v_comp[0] as a precise double // emit_xhtml node !local_time"]
       ) !:comment "when o_conn is local_time // emit_xhtml node"]
       ///
      $[^when (utf8_enc
        $:checklenione
       ) !:comment "when o_conn is utf8_enc // emit_xhtml node"]
       ///
      $[^when (sequence   // €_18MTh926l
        $[^assign (leni *nodewidth(v_html)) // €_3ZIKPBvKOT
             !:comment "leni := nodewidth(v_html)// emit_xhtml node {sequence, space, newline}"]
        $[^for_up (ii leni
           $[^assign (v_comp *nodenthson(v_html ii))
            !:comment "v_comp := v_html[ii]"]
           $[^run (#{/*debug emit_xhtml node-sequence v_html ii v_comp o_emitctx o_strbuf depth*/
           DBGPRINTF_BM("debug emit_xhtml node-sequence €%.9s v_html=%s ii#%ld v_comp=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
           "$stmtid",
           OUTSTRVALUE_BM($v_html),
           (long int) ($ii),
           OUTSTRVALUE_BM($v_comp),
           objectdbg_BM($o_emitctx),
           objectdbg1_BM($o_strbuf),
           objstrbufferlengthpayl_BM($o_strbuf),
           (long int) ($i_depth));}#
           ) !:comment "debug emit_xhtml node-sequence v_html ii v_comp o_emitctx o_strbuf depth"]
        $[^assign(v_resemit *apply (!emit_xhtml v_comp o_emitctx o_strbuf *taggedint(*add_int(i_depth 1))))
           !:comment "v_resemit := emit_xhtml (v_comp o_emitctx o_strbuf depth+1) // emit_xhtml node-sequence"]
         $[^run ( #{/*debug emit_xhtml node-sequence v_resemit v_comp ii o_html o_emitctx o_strbuf depth*/
            DBGPRINTF_BM("emit_xhtml node-sequence €%.9s v_resemit=%s v_comp=%s ii#%ld o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
          "$stmtid",
          OUTSTRVALUE_BM($v_resemit),
          OUTSTRVALUE_BM($v_comp),
          (long int) ($ii),
          objectdbg_BM($o_html),
          objectdbg1_BM($o_emitctx),
          objectdbg2_BM($o_strbuf),
          objstrbufferlengthpayl_BM($o_strbuf),
          (long int) ($i_depth));
         }# ) !:comment "debug emit_xhtml node-sequence v_resemit v_comp ii o_html o_emitctx o_strbuf depth"]

            $[^cond (
              $[^when (*is_null (v_resemit)
                $[^fail(*make_node (!failure_miss !emit_xhtml !sequence v_comp *taggedint(ii) o_html o_emitctx o_strbuf *taggedint(i_depth)))
                  !:comment "fail-miss emit_xhtml sequence v_comp ii o_html o_emitctx o_strbuf depth"]
                ) !:comment "when v_resemit is null, fail / emit_xhtml node-sequence"]
            ) !:comment "if v_resemit is null, fail / emit_xhtml node-sequence"]
         ) !:comment "for ii upto leni ... //emit xhtml node-sequence"]
       ) !:comment "when o_conn is sequence // emit_xhtml node"]
      ///
      $[^when (space      // €_4xEPE1lbF in objswitch €_4ySLl7UU6H
        $[^assign (leni *nodewidth(v_html)) // €_3ZIKPBvKOT
             !:comment "leni := nodewidth(v_html)// emit_xhtml node {sequence, space, newline}"]
        $[^for_up (ii leni
           $[^assign (v_comp *nodenthson(v_html ii))
            !:comment "v_comp := v_html[ii]"]
           $[^run (#{/*debug emit_xhtml node-space v_html ii v_comp o_emitctx o_strbuf depth*/
           DBGPRINTF_BM("debug emit_xhtml node-space €%.9s v_html=%s ii#%ld v_comp=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
           "$stmtid",
           OUTSTRVALUE_BM($v_html),
           (long int) ($ii),
           OUTSTRVALUE_BM($v_comp),
           objectdbg_BM($o_emitctx),
           objectdbg1_BM($o_strbuf),
           objstrbufferlengthpayl_BM($o_strbuf),
           (long int) ($i_depth));}#
           ) !:comment "debug emit_xhtml node-space v_html ii v_comp o_emitctx o_strbuf depth"]
           ///
            $[^cond (
              $[^when (
                *greater_int (ii 0)
                    $[^out (o_strbuf *space()) !:comment "emit_xhtml node-space"]
            ) !:comment "if ii>0 // emit_xhtml node-space "]
	    ) !:comment "emit_xhtml node-space emit space in between"]
        ///
        $[^assign(v_resemit *apply (!emit_xhtml v_comp o_emitctx o_strbuf *taggedint(*add_int(i_depth 1))))
           !:comment "v_resemit := emit_xhtml (v_comp o_emitctx o_strbuf depth+1) // emit_xhtml node-space"]
         $[^run ( #{/*debug emit_xhtml node-space v_resemit v_comp ii o_html o_emitctx o_strbuf depth*/
            DBGPRINTF_BM("emit_xhtml node-space €%.9s v_resemit=%s v_comp=%s ii#%ld o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
          "$stmtid",
          OUTSTRVALUE_BM($v_resemit),
          OUTSTRVALUE_BM($v_comp),
          (long int) ($ii),
          objectdbg_BM($o_html),
          objectdbg1_BM($o_emitctx),
          objectdbg2_BM($o_strbuf),
          objstrbufferlengthpayl_BM($o_strbuf),
          (long int) ($i_depth));
         }# ) !:comment "debug emit_xhtml node-space v_resemit v_comp ii o_html o_emitctx o_strbuf depth"]
            $[^cond (
              $[^when (*is_null (v_resemit)
                $[^fail(*make_node (!failure_miss !emit_xhtml !space v_comp *taggedint(ii) o_html o_emitctx o_strbuf *taggedint(i_depth)))
                  !:comment "fail-miss emit_xhtml space v_comp ii o_html o_emitctx o_strbuf depth"]
                ) !:comment "when v_resemit is null, fail / emit_xhtml node-space"]
            ) !:comment "if v_resemit is null, fail / emit_xhtml node-space"]
         ) !:comment "for ii upto leni ... //emit xhtml node-space"]
       ) !:comment "when o_conn is space // emit_xhtml node"]
      ///====
      $[^when (newline    // €_2pklfVqX1 in objswitch €_4ySLl7UU6H
        $[^assign (leni *nodewidth(v_html)) // €_3ZIKPBvKOT
             !:comment "leni := nodewidth(v_html)// emit_xhtml node {sequence, space, newline}"]
        $[^for_up (ii leni
           $[^assign (v_comp *nodenthson(v_html ii))
            !:comment "v_comp := v_html[ii]"]
           $[^run (#{/*debug emit_xhtml node-newline v_html ii v_comp o_emitctx o_strbuf depth*/
           DBGPRINTF_BM("debug emit_xhtml node-newline €%.9s v_html=%s ii#%ld v_comp=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
           "$stmtid",
           OUTSTRVALUE_BM($v_html),
           (long int) ($ii),
           OUTSTRVALUE_BM($v_comp),
           objectdbg_BM($o_emitctx),
           objectdbg1_BM($o_strbuf),
           objstrbufferlengthpayl_BM($o_strbuf),
           (long int) ($i_depth));}#
           ) !:comment "debug emit_xhtml node-newline v_html ii v_comp o_emitctx o_strbuf depth"]
           ///
            $[^cond (
              $[^when (
                *greater_int (ii 0)
                    $[^out (o_strbuf *newline()) !:comment "emit_xhtml node-newline"]
            ) !:comment "if ii>0 // emit_xhtml node-newline "]
	    ) !:comment "emit_xhtml node-newline emit newline in between"]
        ///
        $[^assign(v_resemit *apply (!emit_xhtml v_comp o_emitctx o_strbuf *taggedint(*add_int(i_depth 1))))
           !:comment "v_resemit := emit_xhtml (v_comp o_emitctx o_strbuf depth+1) // emit_xhtml node-newline"]
         $[^run ( #{/*debug emit_xhtml node-newline v_resemit v_comp ii o_html o_emitctx o_strbuf depth*/
            DBGPRINTF_BM("emit_xhtml node-newline €%.9s v_resemit=%s v_comp=%s ii#%ld o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
          "$stmtid",
          OUTSTRVALUE_BM($v_resemit),
          OUTSTRVALUE_BM($v_comp),
          (long int) ($ii),
          objectdbg_BM($o_html),
          objectdbg1_BM($o_emitctx),
          objectdbg2_BM($o_strbuf),
          objstrbufferlengthpayl_BM($o_strbuf),
          (long int) ($i_depth));
         }# ) !:comment "debug emit_xhtml node-newline v_resemit v_comp ii o_html o_emitctx o_strbuf depth"]
            $[^cond (
              $[^when (*is_null (v_resemit)
                $[^fail(*make_node (!failure_miss !emit_xhtml !newline v_comp *taggedint(ii) o_html o_emitctx o_strbuf *taggedint(i_depth)))
                  !:comment "fail-miss emit_xhtml newline v_comp ii o_html o_emitctx o_strbuf depth"]
                ) !:comment "when v_resemit is null, fail / emit_xhtml node-newline"]
            ) !:comment "if v_resemit is null, fail / emit_xhtml node-newline"]
         ) !:comment "for ii upto leni ... //emit xhtml node-newline"]
       ) !:comment "when o_conn is newline // emit_xhtml node"]
      ///====
      $[^when (nlsp    // €_0SFfKhzb4p in objswitch €_4ySLl7UU6H
        $[^assign (leni *nodewidth(v_html)) // €_3ZIKPBvKOT
             !:comment "leni := nodewidth(v_html)// emit_xhtml node {sequence, space, newline, nlsp}"]
        $[^for_up (ii leni
           $[^assign (v_comp *nodenthson(v_html ii))
            !:comment "v_comp := v_html[ii]"]
           $[^run (#{/*debug emit_xhtml node-nlsp v_html ii v_comp o_emitctx o_strbuf depth*/
           DBGPRINTF_BM("debug emit_xhtml node-nlsp €%.9s v_html=%s ii#%ld v_comp=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
           "$stmtid",
           OUTSTRVALUE_BM($v_html),
           (long int) ($ii),
           OUTSTRVALUE_BM($v_comp),
           objectdbg_BM($o_emitctx),
           objectdbg1_BM($o_strbuf),
           objstrbufferlengthpayl_BM($o_strbuf),
           (long int) ($i_depth));}#
           ) !:comment "debug emit_xhtml node-nlsp v_html ii v_comp o_emitctx o_strbuf depth"]
           ///
            $[^cond (
              $[^when (
                *greater_int (ii 0)
                    $[^out (o_strbuf *nlsp()) !:comment "emit_xhtml node-nlsp"]
            ) !:comment "if ii>0 // emit_xhtml node-nlsp "]
	    ) !:comment "emit_xhtml node-nlsp emit nlsp in between"]
        ///
        $[^assign(v_resemit *apply (!emit_xhtml v_comp o_emitctx o_strbuf *taggedint(*add_int(i_depth 1))))
           !:comment "v_resemit := emit_xhtml (v_comp o_emitctx o_strbuf depth+1) // emit_xhtml node-nlsp"]
         $[^run ( #{/*debug emit_xhtml node-nlsp v_resemit v_comp ii o_html o_emitctx o_strbuf depth*/
            DBGPRINTF_BM("emit_xhtml node-nlsp €%.9s v_resemit=%s v_comp=%s ii#%ld o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
          "$stmtid",
          OUTSTRVALUE_BM($v_resemit),
          OUTSTRVALUE_BM($v_comp),
          (long int) ($ii),
          objectdbg_BM($o_html),
          objectdbg1_BM($o_emitctx),
          objectdbg2_BM($o_strbuf),
          objstrbufferlengthpayl_BM($o_strbuf),
          (long int) ($i_depth));
         }# ) !:comment "debug emit_xhtml node-nlsp v_resemit v_comp ii o_html o_emitctx o_strbuf depth"]
            $[^cond (
              $[^when (*is_null (v_resemit)
                $[^fail(*make_node (!failure_miss !emit_xhtml !nlsp v_comp *taggedint(ii) o_html o_emitctx o_strbuf *taggedint(i_depth)))
                  !:comment "fail-miss emit_xhtml nlsp v_comp ii o_html o_emitctx o_strbuf depth"]
                ) !:comment "when v_resemit is null, fail / emit_xhtml node-nlsp"]
            ) !:comment "if v_resemit is null, fail / emit_xhtml node-nlsp"]
         ) !:comment "for ii upto leni ... //emit xhtml node-nlsp"]
       ) !:comment "when o_conn is nlsp // emit_xhtml node"]
      ///====
      // $[^when (and_then
      // ) !:comment "when o_conn is and_then // emit_xhtml node"]
      // $[^when (or_else
      // ) !:comment "when o_conn is or_else // emit_xhtml node"] 
       // else of objswitch o_conn €_4ySLl7UU6H
      $[^assign(v_emitnode *objgetattr(o_conn !emit_xhtml_node)) !:comment "Else: v_emitnode := o_conn.emit_xhtml_node /emit_xhtml_node node else.."]
      $[^assign(v_emitopen *objgetattr(o_conn !emit_xhtml_connective_open)) !:comment "v_emitopen := o_conn.emit_xhtml_connective_open /emit_xhtml_open node else.."]
      $[^run (#{/*debug emit_xhtml node else o_conn v_emitnode v_emitopen v_html o_emitctx o_strbuf depth*/
      DBGPRINTF_BM("emit_xhtml node else €%.9s o_conn=%s v_emitnode=%s v_emitopen=%s v_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
      "$stmtid",
      objectdbg_BM($o_conn),
      OUTSTRVALUE_BM($v_emitnode),
      OUTSTRVALUE_BM($v_emitopen),
      OUTSTRVALUE_BM($v_html),
      objectdbg1_BM($o_emitctx),
      objectdbg2_BM($o_strbuf),
      objstrbufferlengthpayl_BM($o_strbuf),
      (long int)($i_depth));}# )
      !:comment "debug emit_xhtml node else o_conn v_emitnode v_emitopen v_html o_emitctx o_strbuf depth /emit_xhtml node else.."]
      ///still else ... objswitch o_conn €_4ySLl7UU6H
      $[^cond ( 
        $[^when (*and_then (v_emitnode v_emitopen)
        $[^fail(*make_node(!failure_both o_conn v_html o_emitctx o_strbuf *taggedint(i_depth)))
         !:comment "fail-both emit_xhtml_node & emit_xhtml_open in o_conn  v_html o_emitctx o_strbuf depth /emit_xhtml node else"]
         ) !:comment "when both v_emitnode & v_emitopen fail... / emit_xhtml node else.."]
        //////-----
        $[^when (*isclosure(v_emitnode)
          $[^assign (v_resemit *apply(v_emitnode o_conn o_emitctx o_strbuf *taggedint(*add_int(i_depth 1)) v_html))
           !:comment "v_resemit := v_emitnode(v_html  o_emitctx o_strbuf depth+1) /emit_xhtml node with conn having emit_xhtml_node"]
        $[^run (#{/*debug emit_xhtml v_resemit o_conn v_emitnode o_emitctx o_strbuf depth v_html*/
          DBGPRINTF_BM("emit_xhtml node else €%.9s v_resemit=%s o_conn=%s v_emitnode=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld v_html=%s",
          "$stmtid",
          OUTSTRVALUE_BM($v_resemit),
          objectdbg_BM($o_conn),
          OUTSTRVALUE_BM($v_emitnode),
          objectdbg1_BM($o_emitctx),
          objectdbg2_BM($o_strbuf),
          objstrbufferlengthpayl_BM($o_strbuf),
          (long int)($i_depth),
          OUTSTRVALUE_BM($v_html));}# )
          !:comment "debug emit_xhtml node else v_resemit o_conn v_emitnode o_emitctx o_strbuf depth  v_html /emit_xhtml node with conn having emit_xhtml_node"]
        $[^cond (
           $[^when (*is_null(v_resemit)
              $[^fail(*make_node(!failure_miss !emit_xhtml_node v_html o_emitctx o_strbuf *taggedint(i_depth)))
                  !:comment "fail-miss emit_xhtml_node  v_html o_emitctx o_strbuf depth /emit_xhtml other node"]
                ) !:comment "when v_resemit is null fail-miss /emit_xhtml other node"]
          ) !:comment "check v_resemit /emit_xhtml emit_xhtml_node  node else.."]
          $[^return (v_resemit) !:comment "return v_resemit /emit_xhtml emit_xhtml_node node else.."]
         ) !:comment "when v_emitnode is a closure //emit_xhtml emit_xhtml_node node else.."]
        //////-----
        $[^when (*isclosure(v_emitopen)
          $[^assign (v_resemit *apply(v_emitopen o_conn o_emitctx o_strbuf *taggedint(*add_int(i_depth 1)) v_html))
           !:comment "v_resemit := v_emitopen(o_conn o_emitctx o_strbuf depth+1 v_html) /emit_xhtml node with conn having emit_xhtml_connective_open"]
        $[^run (#{/*debug emit_xhtml v_resemit o_conn v_emitopen o_emitctx o_strbuf depth v_html*/
          DBGPRINTF_BM("emit_xhtml node else €%.9s v_resemit=%s o_conn=%s v_emitnode=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld v_html=%s",
          "$stmtid",
          OUTSTRVALUE_BM($v_resemit),
          objectdbg_BM($o_conn),
          OUTSTRVALUE_BM($v_emitnode),
          objectdbg1_BM($o_emitctx),
          objectdbg2_BM($o_strbuf),
          objstrbufferlengthpayl_BM($o_strbuf),
          (long int)($i_depth),
          OUTSTRVALUE_BM($v_html));}# )
          !:comment "debug emit_xhtml v_resemit o_conn v_emitopen o_emitctx o_strbuf depth v_html"]
         $[^assign (v_str __) !:comment "v_str := __ /emit_xhtml_connective_open / emit_xhtml node else.."]
         $[^cond (
             $[^when (*is_stringv(v_resemit)
               $[^assign (v_str v_resemit) !:comment "v_str := v_resemit; after emit_xhtml_connective_open / emit_xhtml node else.."]
               ) !:comment "when v_resemit is string after emit_xhtml_connective_open / emit_xhtml node else.."]
             $[^fail (*make_node (!failure_type_error !emit_xhtml_connective_open v_resemit o_conn v_emitopen
                      o_emitctx o_strbuf *taggedint(i_depth) v_html))
                 !:comment "else fail-type emit_xhtml_connective_open v_resemit o_conn v_emitopen  o_emitctx o_strbuf depth v_html"]
           ) !:comment "check that v_resemit is string / after emit_xhtml_connective_open emit_xhtml node else.."]
         $[^assign (leni *nodewidth(v_html)) 
             !:comment "leni := nodewith (v_html) / emit_xhtml_connective_open emit_xhtml node else.."]
         $[^assign (o_spacing *as_object (*objgetattr (o_conn !html_spacing)))
             !:comment "o_spacing := o_conn.html_spacing / emit_xhtml_connective_open emit_xhtml node else.."]
         $[^for_up (ii leni
          $[^cond (
            $[^when (
              *and_then (*greater_int (ii 0) o_spacing)
              $[^objswitch (o_spacing
                $[^when (space
                  $[^out (o_strbuf *space()) !:comment "emit-space/ emit_xhtml for emit_xhtml_connective_open emit_xhtml node else.."]
                ) !:comment "when o_spacing is space // emit_xhtml for emit_xhtml_connective_open emit_xhtml node else.."]
                $[^when (newline
                  $[^out (o_strbuf *newline()) !:comment "emit-newline/ emit_xhtml emit_xhtml_connective_open"]
                ) !:comment "when o_spacing is newline // emit_xhtml for emit_xhtml_connective_open emit_xhtml node else.."]
                $[^when (nlsp
                  $[^out (o_strbuf *nlsp()) !:comment "emit-nl/sp/ emit_xhtml emit_xhtml_connective_open"]
                ) !:comment "when o_spacing is nlsp // emit_xhtml emit_xhtml_connective_open"]
              ) !:comment "objswitch o_spacing  // emit_xhtml emit_xhtml_connective_open"]
            ) !:comment "when ii>0 && o_spacing // emit_xhtml emit_xhtml_connective_open"]
          ) !:comment "if ii>0 && o_spacing use it // emit_xhtml emit_xhtml_connective_open"]
             $[^assign (v_comp *nodenthson(v_html ii))
                !:comment "v_comp := v_html[ii] / emit_xhtml_connective_open emit_xhtml node else.."]
        $[^run (#{/*debug emit_xhtml emit_xhtml_connective_open forup v_comp ii o_conn o_emitctx o_strbuf depth v_html*/
          DBGPRINTF_BM("emit_xhtml emit_xhtml_connective_open forup €%.9s v_comp=%s ii#%ld o_conn=%s v_emitnode=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld v_html=%s",
          "$stmtid",
          OUTSTRVALUE_BM($v_comp),
          (long int) ($ii),
          objectdbg_BM($o_conn),
          OUTSTRVALUE_BM($v_emitnode),
          objectdbg1_BM($o_emitctx),
          objectdbg2_BM($o_strbuf),
          objstrbufferlengthpayl_BM($o_strbuf),
          (long int)($i_depth),
          OUTSTRVALUE_BM($v_html));}# )
          !:comment "debug emit_xhtml emit_xhtml_connective_open forup v_comp ii o_conn o_emitctx o_strbuf depth v_html"]
          /// 
          $[^assign(v_resemit *apply (!emit_xhtml v_comp o_emitctx o_strbuf *taggedint(*add_int(i_depth 1))))
                  !:comment "v_resemit := emit_xhtml (v_comp o_emitctx o_strbuf depth+1) // emit_xhtml v_comp loop emit_xhtml_connective_open"]
           $[^run ( #{/*debug emit_xhtml for loop emit_xhtml_connective_open v_resemit v_comp ii o_html o_emitctx o_strbuf depth*/
   DBGPRINTF_BM("emit_xhtml for loop emit_xhtml_connective_open €%.9s v_resemit=%s v_comp=%s ii#%ld o_html=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld",
   "$stmtid",
   OUTSTRVALUE_BM($v_resemit),
   OUTSTRVALUE_BM($v_comp),
   (long int) ($ii),
   objectdbg_BM($o_html),
   objectdbg1_BM($o_emitctx),
   objectdbg2_BM($o_strbuf),
   objstrbufferlengthpayl_BM($o_strbuf),
   (long int) ($i_depth));
   }# ) !:comment "debug emit_xhtml for loop emit_xhtml_connective_open v_resemit v_comp ii o_html o_emitctx o_strbuf depth"]
   
   $[^cond (
     $[^when (*is_null (v_resemit)
       $[^fail(*make_node (!failure_miss !emit_xhtml_connective_open  v_comp *taggedint(ii) o_html o_emitctx o_strbuf *taggedint(i_depth)))
         !:comment "fail-miss emit_xhtml emit_xhtml_connective_open v_comp ii o_html o_emitctx o_strbuf depth"]
       ) !:comment "when v_resemit is null, fail / emit_xhtml after emit_xhtml_connective_open"]
   ) !:comment "if v_resemit is null, fail / emit_xhtml after emitxhtml_element"]
            ) !:comment "for-up ii to leni / emit_xhtml_connective_open emit_xhtml node else.."]
            $[^out (o_strbuf "</" *string(*bytestring(v_str)) ">") !:comment "emit </$v_str> /emit_xhtml node else.."]
          ) !:comment "when v_emitopen is closure /emit_xhtml node else.."]
          ////-----
      ) !:comment "cond on v_emitnode & v_emitopen /emit_xhtml node else.."]
    ) !:comment "objswitch o_conn // emit_xhtml node"] // end  €_4ySLl7UU6H
    $[^return (o_conn) 
    !:comment "return o_conn /when v_html is a node in emit_xhtml"]
 ] // end when v_html is a node

 $[^when (*isclosure(v_html)
  $[^run(#{/*debug closure v_html o_emitctx o_strbug depth*/
  }#) !:comment "debug closure v_html o_emitctx o_strbuf depth /emit_xhtml"]
  $[^assign (v_resemit *apply(v_html o_emitctx o_strbuf *taggedint(*add_int(i_depth 1))))
   !:comment "v_resemit := v_html(o_emitctx o_strbuf depth+1)"]
  $[^run(#{/*debug after-closure v_resemit v_html o_emitctx o_strbug depth*/
  }#) !:comment "debug after-closure v_resemit v_html o_emitctx o_strbuf depth /emit_xhtml"]
  $[^cond (
     $[^when (*isclosure(v_resemit)
        $[^fail(*make_node(!failure_type_error !closure v_resemit v_html o_emitctx o_strbuf *taggedint(i_depth)))
         !:comment "fail-type_error closure v_resemit v_html o_emitctx o_strbuf depth /emit_xhtml"]
         ) !:comment "when v_resemit is closure fail-type_error /emit_xhtml closure"]
     $[^when (*is_null(v_resemit)
        $[^fail(*make_node(!failure_miss !closure v_html o_emitctx o_strbuf *taggedint(i_depth)))
         !:comment "fail-miss closure  v_html o_emitctx o_strbuf depth /emit_xhtml"]
         ) !:comment "when v_resemit is null fail-miss /emit_xhtml closure"]
     ) !:comment "check v_resemit not closure or null after apply /emit_xhtml closure"]
  $[^assign (v_comp v_resemit) !:comment "v_comp := v_resemit /emit_xhtml closure"]
  $[^assign (v_resemit *apply(!emit_xhtml v_comp o_emitctx o_strbuf *taggedint (*add_int(i_depth 1))))
   !:comment "v_resemit := emit_xhtml(v_comp o_emitctx o_strbuf depth+1"]
  $[^run(#{/*debug closure after emit_xhtml v_resemit v_comp o_emitctx o_strbuf depth*/
  DBGPRINTF_BM("closure after emit_xhtml €%.9s v_resemit=%s v_comp=%s o_emitctx=%s o_strbuf=%s/L%u depth#%ld /emit_xhtml_node",
   "$stmtid",
   OUTSTRVALUE_BM($v_resemit),
   OUTSTRVALUE_BM($v_comp),
   objectdbg_BM($o_emitctx),
   objectdbg1_BM($o_strbuf),
   objstrbufferlengthpayl_BM($o_strbuf),
   (long int) ($i_depth));
  }#) !:comment "debug closure after emit_xhtml v_resemit v_comp o_emitctx o_strbug depth /emit_xhtml"]
  $[^cond (
     $[^when (*is_null(v_resemit)
        $[^fail(*make_node(!failure_miss !emit_xhtml v_comp v_html o_emitctx o_strbuf *taggedint(i_depth)))
         !:comment "fail-miss emit_xhtml v_comp  v_html o_emitctx o_strbuf depth /emit_xhtml"]
         ) !:comment "when v_resemit is null fail-miss /emit_xhtml closure second"]
     ) !:comment "check v_resemit not null after second emit_xhtml /emit_xhtml closure"]
  $[^return (v_resemit) !:comment "return v_resemit /emit_xhtml closure"]
   
  ) !:comment "when v_html is closure /emit_xhtml"] // endwhen €_2zIx3cm1V

//////
 $[^fail (*make_node (!failure_type_error !emit_xhtml v_html o_emitctx o_strbuf *taggedint(i_depth)))
  !:comment "else fail-typeerror emit_xhtml v_html o_emitctx o_strbuf depth"]
  
) !:comment "cond on v_html in emit_xhtml"]
