<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
=head1 Use of C&lt;$dtcontextcount&gt;

 For example, this allows me, to generate Latex \chapter, \section,
 \subsection, \paragraph from a single &lt;section&gt; tag with the following code
 fragment:

 Mark Hillebrand

=cut

use XML::DT;
my @SEC_NAMES = qw(chapter section subsection subsubsection paragraph);

%to_latex = (
#     [...]
     'section' =&gt; sub { 
         "\\${SEC_NAMES[$dtcontextcount{section}-1]}{$v{title}}\n$c" },
#     [...]
);
print dt(shift,%to_latex);
</pre></body></html>