Skip to content

Commit

Permalink
Merge pull request #765 from metanorma/update_pres_xml_part3
Browse files Browse the repository at this point in the history
Update pres xml part3
  • Loading branch information
opoudjis authored Nov 10, 2024
2 parents 4b85f83 + 7c22255 commit 38a0c3f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
7 changes: 7 additions & 0 deletions xslt_src/bipm.brochure.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,13 @@

<xsl:template match="bipm:indexsect" mode="flatxml"/>

<xsl:template match="*[local-name() = 'passthrough']" mode="flatxml">
<!-- <xsl:if test="contains(@formats, 'pdf')"> -->
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
<xsl:apply-templates mode="flatxml"/>
</xsl:if>
</xsl:template>

<!-- ================================= -->
<!-- END: Flattening xml for fit notes at page sides (margins) -->
<!-- ================================= -->
Expand Down
15 changes: 11 additions & 4 deletions xslt_src/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -19086,10 +19086,10 @@
<!-- remove preprocess-xslt -->
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>

<xsl:template match="*[local-name() = 'stem'] |
*[local-name() = 'image'] |
*[local-name() = 'sourcecode'] |
*[local-name() = 'bibdata'] |
<xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough'])] |
*[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] |
*[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough'])] |
*[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] |
*[local-name() = 'localized-strings']" mode="update_xml_step1">
<xsl:copy-of select="."/>
</xsl:template>
Expand Down Expand Up @@ -19156,6 +19156,13 @@
</xsl:choose>
</xsl:template>

<xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
<xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
<!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
<xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:if>
</xsl:template>

<!-- =========================================================================== -->
<!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
Expand Down

0 comments on commit 38a0c3f

Please sign in to comment.