element title ; putting the content into this variable since we will use this content twice local stream titlecontent ; creating a variable of type stream open titlecontent as buffer put titlecontent "%c" close titlecontent ; existing code output "

" using attribute id of parent do when attribute id is specified output "" done output "%g(titlecontent)

%n" ; referent reopen toc as referent "toc" using attribute id of parent put toc "
  • %g(titlecontent)
  • " close toc