|
343 | 343 | <!-- Logic for generating titles; default handling is to grab the first <h1>-<h6> content -->
|
344 | 344 | <xsl:template match="*" mode="title.markup">
|
345 | 345 | <xsl:choose>
|
346 |
| - <xsl:when test="self::h:section[@data-type='index' and not(h:h1|h:h2|h:h3|h:h4|h:h5|h:h6)]"> |
| 346 | + <xsl:when test="self::h:section[@data-type='index' and not(h:h1|h:h2|h:h3|h:h4|h:h5|h:h6|h:header/h:h1|h:header/h:h2|h:header/h:h3|h:header/h:h4|h:header/h:h5|h:header/h:h6)]"> |
347 | 347 | <xsl:call-template name="get-localization-value">
|
348 | 348 | <xsl:with-param name="gentext-key" select="'index'"/>
|
349 | 349 | </xsl:call-template>
|
350 | 350 | </xsl:when>
|
351 | 351 | <xsl:otherwise>
|
352 |
| - <xsl:apply-templates select="(h:h1|h:h2|h:h3|h:h4|h:h5|h:h6)[1]/node()"/> |
| 352 | + <xsl:apply-templates select="(h:h1|h:h2|h:h3|h:h4|h:h5|h:h6| |
| 353 | + h:header/h:h1|h:header/h:h2|h:header/h:h3|h:header/h:h4|h:header/h:h5|h:header/h:h6)[1]/node()"/> |
353 | 354 | </xsl:otherwise>
|
354 | 355 | </xsl:choose>
|
355 | 356 | </xsl:template>
|
|
358 | 359 | <xsl:template match="*" mode="process-heading">
|
359 | 360 | <xsl:param name="autogenerate.labels" select="$autogenerate.labels"/>
|
360 | 361 | <!-- Labeled element is typically the parent element of the heading (e.g., <section> or <figure>) -->
|
361 |
| - <xsl:param name="labeled-element" select=".."/> |
| 362 | + <xsl:param name="labeled-element" select="(parent::h:header/parent::*|parent::*[not(self::h:header)])[1]"/> |
362 | 363 | <!-- Labeled element semantic name is typically the parent element of the heading's @data-type -->
|
363 |
| - <xsl:param name="labeled-element-semantic-name" select="../@data-type"/> |
| 364 | + <xsl:param name="labeled-element-semantic-name" select="(parent::h:header/parent::*|parent::*[not(self::h:header)])[1]/@data-type"/> |
364 | 365 | <!-- Name for output heading element; same as current node name by default -->
|
365 | 366 | <xsl:param name="output-element-name" select="local-name(.)"/>
|
366 | 367 | <xsl:element name="{$output-element-name}" namespace="http://www.w3.org/1999/xhtml">
|
|
488 | 489 | <xsl:when test="@data-pdf-bookmark">
|
489 | 490 | <xsl:attribute name="data-pdf-bookmark" select="@data-pdf-bookmark"/>
|
490 | 491 | </xsl:when>
|
491 |
| - <xsl:when test="h:h1"> |
| 492 | + <xsl:when test="h:h1 or h:header/h:h1"> |
492 | 493 | <xsl:variable name="processed-heading">
|
493 |
| - <xsl:apply-templates select="h:h1[1]" mode="process-heading"> |
| 494 | + <xsl:apply-templates select="(h:h1|h:header/h:h1)[1]" mode="process-heading"> |
494 | 495 | <xsl:with-param name="autogenerate.labels" select="$autogenerate.pdf.bookmark.labels"/>
|
495 | 496 | </xsl:apply-templates>
|
496 | 497 | </xsl:variable>
|
|
506 | 507 | <xsl:when test="@data-pdf-bookmark">
|
507 | 508 | <xsl:attribute name="data-pdf-bookmark" select="@data-pdf-bookmark"/>
|
508 | 509 | </xsl:when>
|
509 |
| - <xsl:when test="h:h2"> |
| 510 | + <xsl:when test="h:h2 or h:header/h:h2"> |
510 | 511 | <xsl:variable name="processed-heading">
|
511 |
| - <xsl:apply-templates select="h:h2[1]" mode="process-heading"> |
| 512 | + <xsl:apply-templates select="(h:h2|h:header/h:h2)[1]" mode="process-heading"> |
512 | 513 | <xsl:with-param name="autogenerate.labels" select="$autogenerate.pdf.bookmark.labels"/>
|
513 | 514 | </xsl:apply-templates>
|
514 | 515 | </xsl:variable>
|
|
524 | 525 | <xsl:when test="@data-pdf-bookmark">
|
525 | 526 | <xsl:attribute name="data-pdf-bookmark" select="@data-pdf-bookmark"/>
|
526 | 527 | </xsl:when>
|
527 |
| - <xsl:when test="h:h3"> |
| 528 | + <xsl:when test="h:h3 or h:header/h:h3"> |
528 | 529 | <xsl:variable name="processed-heading">
|
529 |
| - <xsl:apply-templates select="h:h3[1]" mode="process-heading"> |
| 530 | + <xsl:apply-templates select="(h:h3|h:header/h:h3)[1]" mode="process-heading"> |
530 | 531 | <xsl:with-param name="autogenerate.labels" select="$autogenerate.pdf.bookmark.labels"/>
|
531 | 532 | </xsl:apply-templates>
|
532 | 533 | </xsl:variable>
|
|
542 | 543 | <xsl:when test="@data-pdf-bookmark">
|
543 | 544 | <xsl:attribute name="data-pdf-bookmark" select="@data-pdf-bookmark"/>
|
544 | 545 | </xsl:when>
|
545 |
| - <xsl:when test="h:h4"> |
| 546 | + <xsl:when test="h:h4 or h:header/h:h4"> |
546 | 547 | <xsl:variable name="processed-heading">
|
547 |
| - <xsl:apply-templates select="h:h4[1]" mode="process-heading"> |
| 548 | + <xsl:apply-templates select="(h:h4|h:header/h:h4)[1]" mode="process-heading"> |
548 | 549 | <xsl:with-param name="autogenerate.labels" select="$autogenerate.pdf.bookmark.labels"/>
|
549 | 550 | </xsl:apply-templates>
|
550 | 551 | </xsl:variable>
|
|
560 | 561 | <xsl:when test="@data-pdf-bookmark">
|
561 | 562 | <xsl:attribute name="data-pdf-bookmark" select="@data-pdf-bookmark"/>
|
562 | 563 | </xsl:when>
|
563 |
| - <xsl:when test="h:h5"> |
| 564 | + <xsl:when test="h:h5 or h:header/h:h5"> |
564 | 565 | <xsl:variable name="processed-heading">
|
565 |
| - <xsl:apply-templates select="h:h5[1]" mode="process-heading"> |
| 566 | + <xsl:apply-templates select="(h:h5|h:header/h:h5)[1]" mode="process-heading"> |
566 | 567 | <xsl:with-param name="autogenerate.labels" select="$autogenerate.pdf.bookmark.labels"/>
|
567 | 568 | </xsl:apply-templates>
|
568 | 569 | </xsl:variable>
|
|
578 | 579 | <xsl:when test="@data-pdf-bookmark">
|
579 | 580 | <xsl:attribute name="data-pdf-bookmark" select="@data-pdf-bookmark"/>
|
580 | 581 | </xsl:when>
|
581 |
| - <xsl:when test="h:h1"> |
| 582 | + <xsl:when test="h:h1 or h:header/h:h1"> |
582 | 583 | <xsl:variable name="processed-heading">
|
583 |
| - <xsl:apply-templates select="h:h1[1]" mode="process-heading"> |
| 584 | + <xsl:apply-templates select="(h:h1|h:header/h:h1)[1]" mode="process-heading"> |
584 | 585 | <xsl:with-param name="autogenerate.labels" select="$autogenerate.pdf.bookmark.labels"/>
|
585 | 586 | </xsl:apply-templates>
|
586 | 587 | </xsl:variable>
|
|
0 commit comments