foreach my $role ( sort { $a cmp $b } keys %{$index_hash} ) {
my $chapter = XML::LibXML::Element->new('chapter');
$book->appendChild($chapter);
- $chapter->setAttribute( 'id', 'index_' . $role );
+ $chapter->setAttribute( 'id', join( '_', 'index', $role ) );
+ $chapter->setAttribute( 'class', 'index' );
$chapter->appendTextChild( 'title', ( ucfirst($role) . ' Index' ) );
foreach my $first ( sort { $a cmp $b } keys %{ $index_hash->{$role} } ) {
my $section = XML::LibXML::Element->new('section');
my $list = XML::LibXML::Element->new('variablelist');
$chapter->appendChild($section);
- $section->setAttribute( 'id', 'index_' . $role . '_' . $first );
+ $section->setAttribute( 'id', join( '_', 'index', $role, $first ) );
+ $section->setAttribute( 'class', 'index' );
$section->appendTextChild( 'title', $first ? $first : 'Symbols' );
$section->appendChild($list);
foreach my $primary ( sort { $a cmp $b } keys %{ $index_hash->{$role}{$first} } ) {
<a class="next_page" href="{next_url}"><![CDATA[next->]]></a>
<!-- Chapter Title -->
- <h2>
+ <h2 id="{@id}" class="{@class}">
<xsl:value-of select="concat('Chapter ',chapter_id,' - ',title)"/>
</h2>
<!-- Chapter Info -->
- <div id="chapter">
+ <div id="chapter" class="chapter{@class}">
<xsl:apply-templates select="*[name()!='section']"/>
<xsl:apply-templates select="section"/>
</div>
<xsl:template match="/chapter/section">
<!-- Section Title -->
- <h3 id="{@id}">
+ <h3 id="{@id}" class="{@class}">
<xsl:value-of select="concat(position(),'. ',title)"/>
</h3>
<!-- Section Paragraphs -->
+ <div class="section{@class}">
<xsl:apply-templates select="*"/>
+ </div>
</xsl:template>
<!-- Section paragraph -->