Added class info to the Index chapters/sections.
Sections now have surrounding div in html.
Chapter/Sections carry id and class data through
foreach my $role ( sort { $a cmp $b } keys %{$index_hash} ) {
my $chapter = XML::LibXML::Element->new('chapter');
$book->appendChild($chapter);
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);
$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} } ) {
$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 -->
<a class="next_page" href="{next_url}"><![CDATA[next->]]></a>
<!-- Chapter Title -->
+ <h2 id="{@id}" class="{@class}">
<xsl:value-of select="concat('Chapter ',chapter_id,' - ',title)"/>
</h2>
<!-- Chapter Info -->
<xsl:value-of select="concat('Chapter ',chapter_id,' - ',title)"/>
</h2>
<!-- Chapter Info -->
+ <div id="chapter" class="chapter{@class}">
<xsl:apply-templates select="*[name()!='section']"/>
<xsl:apply-templates select="section"/>
</div>
<xsl:apply-templates select="*[name()!='section']"/>
<xsl:apply-templates select="section"/>
</div>
<xsl:template match="/chapter/section">
<!-- Section Title -->
<xsl:template match="/chapter/section">
<!-- Section Title -->
+ <h3 id="{@id}" class="{@class}">
<xsl:value-of select="concat(position(),'. ',title)"/>
</h3>
<!-- Section Paragraphs -->
<xsl:value-of select="concat(position(),'. ',title)"/>
</h3>
<!-- Section Paragraphs -->
+ <div class="section{@class}">
<xsl:apply-templates select="*"/>
<xsl:apply-templates select="*"/>
</xsl:template>
<!-- Section paragraph -->
</xsl:template>
<!-- Section paragraph -->