lib/isodoc/un/un.plenary-attachment.xsl in metanorma-un-0.9.5 vs lib/isodoc/un/un.plenary-attachment.xsl in metanorma-un-0.9.6

- old
+ new

@@ -1,37 +1,33 @@ <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:un="https://www.metanorma.org/ns/un" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:barcode="http://barcode4j.krysalis.org/ns" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0"> <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/> <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/> - - - - - + <xsl:variable name="debug">false</xsl:variable> - + <xsl:variable name="contents_"> - <contents> + <contents> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements' and local-name() != 'note' and local-name() != 'admonition']" mode="contents"/> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/> - + <xsl:apply-templates select="/un:un-standard/un:sections/*" mode="contents"/> <xsl:apply-templates select="/un:un-standard/un:annex" mode="contents"/> <xsl:apply-templates select="/un:un-standard/un:bibliography/un:references" mode="contents"/> - + <xsl:call-template name="processTablesFigures_Contents"/> </contents> </xsl:variable> <xsl:variable name="contents" select="xalan:nodeset($contents_)"/> <xsl:variable name="title" select="/un:un-standard/un:bibdata/un:title[@language = 'en' and @type = 'main']"/> <xsl:variable name="id" select="/un:un-standard/un:bibdata/un:ext/un:session/un:id"/> - + <xsl:template match="/"> <xsl:call-template name="namespaceCheck"/> <fo:root xml:lang="{$lang}"> <xsl:variable name="root-style"> <root-style xsl:use-attribute-sets="root-style"/> @@ -46,15 +42,15 @@ <fo:region-before extent="17.5mm"/> <fo:region-after extent="10mm"/> <fo:region-start extent="20mm"/> <fo:region-end extent="20mm"/> </fo:simple-page-master> - + <!-- Document odd pages --> <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm"> <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/> - <fo:region-before region-name="header-odd" extent="26mm"/> + <fo:region-before region-name="header-odd" extent="26mm"/> <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/> <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/> <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/> </fo:simple-page-master> <!-- Document even pages --> @@ -70,21 +66,21 @@ <fo:conditional-page-master-reference odd-or-even="even" master-reference="even"/> <fo:conditional-page-master-reference odd-or-even="odd" master-reference="odd"/> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </fo:layout-master-set> - + <fo:declarations> <xsl:call-template name="addPDFUAmeta"/> </fo:declarations> - + <xsl:call-template name="addBookmarks"> <xsl:with-param name="contents" select="$contents"/> </xsl:call-template> - + <!-- Cover Page --> - <fo:page-sequence master-reference="cover-page" force-page-count="no-force"> + <fo:page-sequence master-reference="cover-page" force-page-count="no-force"> <fo:flow flow-name="xsl-region-body"> <fo:block-container border-bottom="0.5pt solid black" margin-bottom="6pt"> <fo:block text-align-last="justify"> <fo:inline padding-right="22mm"> </fo:inline> <fo:inline font-size="14pt" baseline-shift="15%"><xsl:value-of select="/un:un-standard/un:bibdata/un:contributor/un:organization/un:name"/></fo:inline> @@ -157,20 +153,20 @@ <xsl:value-of select="translate(/un:un-standard/un:sections/un:clause[1]/un:ol[1]/un:li[1]/un:p[1], '.', '')"/> </fo:block> <fo:block role="H1"><xsl:value-of select="$title"/></fo:block> </fo:block> </fo:block-container> - + <!-- <xsl:apply-templates select="/un:un-standard/un:preface/un:foreword"/> --> <fo:block-container font-weight="bold" margin-left="20mm" margin-top="10pt"> <fo:block margin-left="-20mm"> <fo:block font-size="17pt" margin-bottom="16pt"> <xsl:value-of select="$title"/> - + <xsl:for-each select="/un:un-standard/un:bibdata/un:note[@type = 'title-footnote']"> - <xsl:variable name="number" select="position()"/> + <xsl:variable name="number" select="position()"/> <fo:inline font-size="14pt" baseline-shift="15%" font-weight="normal"> <xsl:if test="$number = 1"> <xsl:text> </xsl:text> </xsl:if> <fo:basic-link internal-destination="title-footnote_{$number}" fox:alt-text="title footnote"> @@ -180,11 +176,11 @@ </xsl:call-template> </fo:basic-link> <xsl:if test="position() != last()"><fo:inline baseline-shift="20%">,</fo:inline></xsl:if> </fo:inline> </xsl:for-each> - + <xsl:for-each select="/un:un-standard/un:bibdata/un:note[@type = 'title-footnote']"> <xsl:variable name="number" select="position()"/> <fo:block id="title-footnote_{$number}" font-size="14pt" font-weight="normal"> <xsl:if test="$number = 1"> <xsl:attribute name="margin-top">12pt</xsl:attribute> @@ -195,34 +191,34 @@ </xsl:call-template> <xsl:text> </xsl:text> <xsl:apply-templates/> </fo:block> </xsl:for-each> - + </fo:block> - + <fo:block font-size="14pt" margin-bottom="16pt"> <xsl:value-of select="/un:un-standard/un:bibdata/un:title[@language = 'en' and @type = 'subtitle']"/> </fo:block> <xsl:if test="/un:un-standard/un:bibdata/un:ext/un:session/un:collaborator"> <fo:block font-size="14pt" margin-bottom="22pt"> <xsl:text>Developed in Collaboration with the </xsl:text><xsl:value-of select="/un:un-standard/un:bibdata/un:ext/un:session/un:collaborator"/> </fo:block> </xsl:if> </fo:block> </fo:block-container> - + <xsl:apply-templates select="/un:un-standard/un:preface/un:abstract"/> - + <xsl:variable name="charsToRemove" select="concat($upper, $lower, '.()~!@#$%^*-+:')"/> <xsl:variable name="code" select="translate(/un:un-standard/un:bibdata/un:docidentifier, $charsToRemove,'')"/> - + <fo:block-container absolute-position="fixed" left="20mm" top="258mm" width="30mm" text-align="center"> <fo:block font-size="10pt" text-align="left"> <xsl:value-of select="/un:un-standard/un:bibdata/un:docidentifier"/> </fo:block> - + <fo:block padding-top="1mm"> <xsl:if test="normalize-space($code) != ''"> <fo:instream-foreign-object fox:alt-text="Barcode"> <barcode:barcode message="{$code}"> <barcode:code39> @@ -241,11 +237,11 @@ </fo:block> <fo:block padding-top="-0.8mm" text-align="left" font-family="Arial" font-size="8pt" letter-spacing="1.8mm"> <xsl:value-of select="concat('*', $code, '*')"/> </fo:block> </fo:block-container> - + <fo:block-container absolute-position="fixed" left="143mm" top="262mm"> <fo:block> <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Recycle))}" width="26mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Recycle"/> </fo:block> </fo:block-container> @@ -261,16 +257,15 @@ </barcode:barcode> </fo:instream-foreign-object> </xsl:if> </fo:block> </fo:block-container> - + </fo:flow> </fo:page-sequence> <!-- End Cover Page --> - - + <!-- Document Pages --> <fo:page-sequence master-reference="document" initial-page-number="2" format="1" force-page-count="no-force" line-height="115%"> <fo:static-content flow-name="xsl-footnote-separator"> <fo:block-container margin-left="-8mm"> <fo:block margin-left="8mm"> @@ -278,46 +273,44 @@ </fo:block> </fo:block-container> </fo:static-content> <xsl:call-template name="insertHeaderFooter"/> <fo:flow flow-name="xsl-region-body"> - + <xsl:if test="$debug = 'true'"> <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text> DEBUG contents=<xsl:copy-of select="$contents"/> <xsl:text disable-output-escaping="yes">--&gt;</xsl:text> </xsl:if> - + <!-- Preface Pages (except Abstract, that showed in Summary on cover page`) --> <xsl:if test="/un:un-standard/un:preface/*[not(local-name() = 'abstract' or local-name() != 'note' or local-name() != 'admonition')]"> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements' and local-name() != 'note' and local-name() != 'admonition']"/> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/> <fo:block break-after="page"/> </xsl:if> - + <fo:block> <xsl:apply-templates select="/un:un-standard/un:sections/*"/> <xsl:apply-templates select="/un:un-standard/un:annex"/> <xsl:apply-templates select="/un:un-standard/un:bibliography/un:references"/> </fo:block> - + <fo:block-container margin-left="50mm" width="30mm" border-bottom="0.5pt solid black" margin-top="12pt" keep-with-previous="always"> <fo:block> </fo:block> </fo:block-container> - + </fo:flow> </fo:page-sequence> <!-- End Document Pages --> - + </fo:root> - </xsl:template> + </xsl:template> - - <!-- ============================= --> <!-- CONTENTS --> <!-- ============================= --> <!-- element with title --> @@ -325,58 +318,57 @@ <xsl:variable name="level"> <xsl:call-template name="getLevel"> <xsl:with-param name="depth" select="un:title/@depth"/> </xsl:call-template> </xsl:variable> - + <xsl:variable name="display"> - <xsl:choose> + <xsl:choose> <xsl:when test="$level &gt; $toc_level">false</xsl:when> <xsl:otherwise>true</xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="skip"> <xsl:choose> <xsl:when test="ancestor-or-self::un:bibitem">true</xsl:when> <xsl:when test="ancestor-or-self::un:term">true</xsl:when> <xsl:when test="@inline-header = 'true'">true</xsl:when> <xsl:otherwise>false</xsl:otherwise> </xsl:choose> </xsl:variable> - - <xsl:if test="$skip = 'false'"> - + + <xsl:if test="$skip = 'false'"> + <xsl:variable name="section"> <xsl:call-template name="getSection"/> </xsl:variable> - + <xsl:variable name="title"> <xsl:call-template name="getName"/> </xsl:variable> - + <xsl:variable name="type"> <xsl:value-of select="local-name()"/> </xsl:variable> - + <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}"> <title> <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/> </title> <xsl:apply-templates mode="contents"/> </item> - </xsl:if> - + </xsl:if> + </xsl:template> <!-- ============================= --> <!-- ============================= --> - <!-- ============================= --> <!-- PARAGRAPHS --> - <!-- ============================= --> - + <!-- ============================= --> + <xsl:template match="un:preface/un:abstract" priority="3"> <fo:block> <fo:table table-layout="fixed" width="100%" border="0.5pt solid black"> <fo:table-column column-width="19mm"/> <fo:table-column column-width="134mm"/> @@ -408,11 +400,11 @@ </fo:table-row> </fo:table-body> </fo:table> </fo:block> </xsl:template> - + <xsl:template match="un:abstract//un:p" priority="3"> <fo:block margin-bottom="6pt"> <xsl:attribute name="text-align"> <xsl:choose> <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when> @@ -420,11 +412,11 @@ </xsl:choose> </xsl:attribute> <xsl:apply-templates/> </fo:block> </xsl:template> - + <xsl:template match="un:preface//un:p" priority="2"> <fo:block margin-bottom="12pt"> <xsl:attribute name="text-align"> <xsl:choose> <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when> @@ -432,16 +424,15 @@ </xsl:choose> </xsl:attribute> <xsl:apply-templates/> </fo:block> </xsl:template> - - + <xsl:template match="un:clause[@inline-header = 'true']" priority="3"> <fo:block-container margin-left="1mm"> <fo:block-container margin-left="0mm"> - <fo:list-block provisional-distance-between-starts="9mm"> + <fo:list-block provisional-distance-between-starts="9mm"> <xsl:call-template name="setId"/> <xsl:attribute name="text-align"> <xsl:choose> <xsl:when test="child::*/@align"><xsl:value-of select="child::*/@align"/></xsl:when> <xsl:otherwise>justify</xsl:otherwise> @@ -457,31 +448,30 @@ <fo:block> <xsl:apply-templates/> </fo:block> </fo:list-item-body> </fo:list-item> - </fo:list-block> + </fo:list-block> </fo:block-container> </fo:block-container> </xsl:template> - + <xsl:template match="un:title" mode="inline-header"> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> <fo:inline role="H{$level}"> <xsl:apply-templates/> </fo:inline> </xsl:template> - - + <xsl:template match="un:p[ancestor::un:table]"> <fo:block> <xsl:apply-templates/> </fo:block> </xsl:template> - + <xsl:template match="un:p" name="paragraph"> <xsl:param name="split_keep-within-line"/> <fo:block margin-bottom="6pt" line-height="122%"> <xsl:if test="following-sibling::*"> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> @@ -495,128 +485,121 @@ <xsl:apply-templates> <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/> </xsl:apply-templates> </fo:block> </xsl:template> - - + <xsl:template match="un:fn/un:p"> <fo:block> <xsl:apply-templates/> </fo:block> </xsl:template> - + <xsl:template match="un:ul | un:ol" mode="list" priority="2"> <fo:block-container margin-left="8mm" text-indent="0mm"> <xsl:call-template name="list"/> </fo:block-container> </xsl:template> - - + <xsl:template match="un:li//un:p"> <fo:block margin-bottom="6pt" line-height="122%" text-align="justify"> <xsl:apply-templates/> </fo:block> </xsl:template> - + <xsl:template match="un:link" priority="2"> <fo:inline> <xsl:if test="ancestor::un:fn and string-length(@target) &gt; 110"> <xsl:attribute name="font-size">8pt</xsl:attribute> </xsl:if> <xsl:call-template name="link"/> </fo:inline> </xsl:template> - - - <!-- ============================= --> - <!-- ============================= --> - - - + <!-- ============================= --> + <!-- ============================= --> + <!-- ====== --> <!-- title --> <!-- ====== --> - - <xsl:template match="un:preface//un:title" priority="3"> + + <xsl:template match="un:preface//un:title" priority="3"> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> <xsl:variable name="font-size"> <xsl:choose> - <xsl:when test="$level = 1">14pt</xsl:when> + <xsl:when test="$level = 1">14pt</xsl:when> <xsl:when test="$level = 2">12pt</xsl:when> <xsl:when test="$level = 3">10pt</xsl:when> <xsl:otherwise>11pt</xsl:otherwise> </xsl:choose> </xsl:variable> <fo:block font-size="{$font-size}" font-weight="bold" margin-top="3pt" margin-bottom="16pt" keep-with-next="always" role="H{$level}"> <xsl:apply-templates/> <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/> </fo:block> </xsl:template> - + <xsl:template match="un:annex//un:title"> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> <xsl:variable name="font-size"> - <xsl:choose> + <xsl:choose> <xsl:when test="$level = 1">12pt</xsl:when> - <xsl:when test="$level = 2">10pt</xsl:when> + <xsl:when test="$level = 2">10pt</xsl:when> <xsl:when test="$level = 3">10pt</xsl:when> <xsl:otherwise>11pt</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:choose> <xsl:when test="$level = 1"> - <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" keep-with-next="always" role="H{$level}"> + <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" keep-with-next="always" role="H{$level}"> <fo:block margin-bottom="12pt"> <xsl:apply-templates/> <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/> </fo:block> </fo:block> </xsl:when> - <xsl:otherwise> + <xsl:otherwise> <fo:block font-size="{$font-size}" font-weight="bold" margin-left="1mm" space-before="3pt" margin-bottom="6pt" keep-with-next="always" role="H{$level}"> <xsl:apply-templates/> <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/> </fo:block> </xsl:otherwise> </xsl:choose> </xsl:template> - + <xsl:template match="un:title[parent::un:clause[@inline-header = 'true']]" priority="3"/> - + <xsl:template match="un:title" name="title"> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> - + <xsl:variable name="font-size"> - <xsl:choose> + <xsl:choose> <xsl:when test="$level = 1">14pt</xsl:when> <xsl:when test="$level = 2">12pt</xsl:when> <xsl:when test="$level = 3">10pt</xsl:when> <xsl:otherwise>11pt</xsl:otherwise> </xsl:choose> </xsl:variable> - - - <xsl:choose> + + <xsl:choose> <xsl:when test="ancestor::un:sections and $level = 1"> <fo:block-container margin-left="-16mm"> <fo:block font-size="{$font-size}" font-weight="bold" margin-left="16mm" space-before="16pt" margin-bottom="13pt" keep-with-next="always" role="H{$level}"> <fo:table table-layout="fixed" width="100%"> <fo:table-column column-width="16mm"/> <fo:table-column column-width="130mm"/> <fo:table-body> <fo:table-row> <fo:table-cell> - <xsl:variable name="section"> + <xsl:variable name="section"> <xsl:for-each select=".."> <xsl:call-template name="getSection"/> </xsl:for-each> </xsl:variable> <fo:block text-align="center"> @@ -649,81 +632,77 @@ </xsl:if> <xsl:call-template name="insertTitleAsListItem"> <xsl:with-param name="provisional-distance-between-starts" select="'8mm'"/> </xsl:call-template> </fo:block> - </xsl:when> + </xsl:when> <xsl:otherwise> - <fo:block font-size="{$font-size}" font-weight="bold" text-align="left" keep-with-next="always" role="H{$level}"> + <fo:block font-size="{$font-size}" font-weight="bold" text-align="left" keep-with-next="always" role="H{$level}"> <xsl:apply-templates/> <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/> </fo:block> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ====== --> <!-- ====== --> - - + <!-- ============================ --> <!-- for further use --> <!-- ============================ --> - <xsl:template match="un:figure" priority="2"> <fo:block-container id="{@id}"> <fo:block> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> - </fo:block> + </fo:block> <xsl:apply-templates select="un:name"/> <!-- <xsl:call-template name="fn_display_figure"/> --> <xsl:for-each select="un:note"> <xsl:call-template name="note"/> </xsl:for-each> </fo:block-container> </xsl:template> - - <xsl:template match="un:dl" priority="2"> <fo:block-container margin-left="0mm"> <xsl:if test="parent::*[local-name() = 'note']"> <xsl:attribute name="margin-left"> <xsl:choose> <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when> <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise> </xsl:choose> - </xsl:attribute> + </xsl:attribute> </xsl:if> <fo:block-container margin-left="0mm"> - + <fo:block line-height="122%" margin-bottom="6pt" text-indent="0mm" text-align="justify"> <xsl:apply-templates/> </fo:block> - - </fo:block-container> - </fo:block-container> + + </fo:block-container> + </fo:block-container> </xsl:template> - + <xsl:template match="un:dt" priority="2"> <fo:block margin-bottom="6pt"> <xsl:apply-templates/> <xsl:apply-templates select="following-sibling::un:dd[1]" mode="dd"/> </fo:block> </xsl:template> - + <xsl:template match="un:dd"/> <xsl:template match="un:dd" mode="dd"> <fo:inline><xsl:apply-templates/></fo:inline> </xsl:template> - + <xsl:template match="un:dd//un:p" priority="3"> <fo:inline><xsl:apply-templates/></fo:inline> </xsl:template> <!-- ============================ --> - <!-- ============================ --> - + <!-- ============================ --> + <xsl:template name="insertHeaderFooter"> <fo:static-content flow-name="header-odd" role="artifact"> <fo:block-container height="25mm" display-align="after" border-bottom="0.5pt solid black" margin-left="-20.5mm" margin-right="-20.5mm"> <fo:block font-size="9pt" font-weight="bold" text-align="right" margin-left="21mm" margin-right="21mm" padding-bottom="0.5mm"> <xsl:value-of select="$id"/> @@ -747,143 +726,236 @@ <fo:block font-size="9pt" font-weight="bold" margin-left="21mm" margin-right="21mm" padding-top="12mm"><fo:page-number/></fo:block> </fo:block-container> </fo:static-content> </xsl:template> - <xsl:variable name="Image-Logo"> <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAOEAAAC0CAYAAABi8Es+AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtAD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G93cyk8L3N0RXZ0OnNvZnR3YXJlQWdlbnQ+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDpjaGFuZ2VkPi88L3N0RXZ0OmNoYW5nZWQ+CiAgICAgICAgICAgICAgIDwvcmRmOmxpPgogICAgICAgICAgICA8L3JkZjpTZXE+CiAgICAgICAgIDwveG1wTU06SGlzdG9yeT4KICAgICAgICAgPHRpZmY6T3JpZW50YXRpb24+MTwvdGlmZjpPcmllbnRhdGlvbj4KICAgICAgICAgPHRpZmY6WFJlc29sdXRpb24+MzAwMDAwMC8xMDAwMDwvdGlmZjpYUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6WVJlc29sdXRpb24+MzAwMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4yMjU8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MTgwPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz4xznjNAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAFWJSURBVHja7F1nWBVHFz50sCCxghUFFOzG2EuIBTti7OKnRI01xhrFEmOMRmOP3aixE1vsGmOvKMaCqNhQUBBBUBAREYTz/di5uHd2Zsu9l2LCeZ55Ermzs7Ozc3ZmznnPe8wgX/K6FAUAJwAoAQAFAcAaAIoAgA0A2FF13wHAKwBIJP99BQDxAPAcADLzhzJviln+EOS62AFAZQBwBQA3UlwAoAwAlAUAWxPcI4MoYhQARAPAbQC4QcqDfAXNV8L/2nhXBYBGAPAZANQHgBoAYJmLfUoBgOsAcJqUQPK3fMlXwn+NlASA1gDgRYpjHu9vGgBcBICTAHAMAC6TlTRf8pXwo1O8HgDQEwCaGDrORYoUgVKlSkHx4sWhePHiULRoUXBwcIAHDx7AoUOHsuqZm5vD7t27wd7eHuLi4iA+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ToG1ddvz3ULMPup5lCuOU4sKiKRD2JNDkBRtisUVexrht+6pCf0ER2o/DGvfFWNOx3ta461zd3t7e578w0haUlIz+AazhBKw3jvHMAn9h5/a27X/p3hf6NRUW+L/E5SFYd4Aydiq+GoMTeXskFlup2/iLClciwirDIdkXbaow58novC6+zflRu92+I11BBQVFGs2TOrduuXKHbacDX+b65RuM+GowTjUAPQam8XjA6SNE23chcKnAvm/Fd/q/b+pCZF+Sl+P7vKGxdZ0/P/8TWFodKJUxzk/ABIcq6S4AN1w2JO8n5WfQ24WU8ynKdVem8l80QzUwx2y0exd1OefiZp2SwkH7fIApxnIhHgN/uwSnK9rHMGlTzW27fbttd6WZ4vyOjg6GU1zf67RY5eXlZTt37mz3PliWCaHL5ubmlm7QhsvK9sMi/W48Holu2rQxfTIvEVlcrPTjqe4EZ7CgwBdra9uSmtcPt6eta6FynHEJKYGv2Jd90s86AQpAwNJsRuT5xUAHrKK4IkCd9g6NQAQPIi8vz4f5o72tANZVgO/GMpe59RvrtQvt7JMQLS0dAyI9sst1m7uTuL28gqwJBqfh8pTaWOTqTIvSblYxVtTe2RnbvHlzg/fsEofcLK4oasda9edCs9An49viDe3tm3sS2YHA/gAL39Le/tU2lGFS0mphWYsBlhI432690j5UQnnB0DjXjuv/Pkr/knwu5fQOx46PR+RzPKz5FG+vOtVFmJn08mQq/ix17K4bM722kS3f8O0J0IOnwddK6jo7zqrx5f7EdckzAOrK/5erFeIorlh4YH/pthHXfac7449A8DVAaRXYTgUQ4wdj/xgw8ytFk7xSqrdd135+AIqVLd+k6ICjZETxZhgY8HLnv3VGvTZa/+9kz/qlzuHctP4A89UE73L1sCJO8nXeWcqW3QOHeLyryF/Q4L3BoEhzW+fOO0A12vewbTZxj6/yWeCqz4J31WY1ny3/F6UYkeY68LIzhtsxa8myZailU1K6HlxN/x9kjcPp+HcBBgAS2JZd+kqHSQAAAABJRU5ErkJggg==</xsl:text> </xsl:variable> - -<xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:variable name="table_widths_from_if_calculated_"> + + <!-- external parameters --> + + <xsl:param name="svg_images"/> <!-- svg images array --> + <xsl:variable name="images" select="document($svg_images)"/> + <xsl:param name="basepath"/> <!-- base path for images --> + <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format --> + <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off --> + <xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text --> + + <xsl:param name="table_if">false</xsl:param> <!-- generate extended table in IF for autolayout-algorithm --> + <xsl:param name="table_widths"/> <!-- path to xml with table's widths, generated on 1st pass, based on FOP Intermediate Format --> + <!-- Example: <tables> + <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF + <tbody> + <tr> + <td id="tab-symdu_1_1"> + <p_len>6</p_len> + <p_len>100</p_len> for 2nd paragraph + <word_len>6</word_len> + <word_len>20</word_len> + ... + --> + + <!-- for command line debug: <xsl:variable name="table_widths_from_if" select="document($table_widths)"/> --> + <xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/> + + <xsl:variable name="table_widths_from_if_calculated_"> <xsl:for-each select="$table_widths_from_if//table"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:call-template name="calculate-column-widths-autolayout-algorithm"/> </xsl:copy> </xsl:for-each> - </xsl:variable><xsl:variable name="table_widths_from_if_calculated" select="xalan:nodeset($table_widths_from_if_calculated_)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_"> + </xsl:variable> + <xsl:variable name="table_widths_from_if_calculated" select="xalan:nodeset($table_widths_from_if_calculated_)"/> + + <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl --> + + <xsl:variable name="isGenerateTableIF_"> false - </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang"> + </xsl:variable> + <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/> + + <xsl:variable name="lang"> <xsl:call-template name="getLang"/> - </xsl:variable><xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/><xsl:variable name="papersize_width_"> + </xsl:variable> + + <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt. + You can put such conditions by using xslt construction `xsl:if test="..."` or <xsl:choose><xsl:when test=""></xsl:when><xsl:otherwiste></xsl:otherwiste></xsl:choose>, + BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose --> + + <!-- + <misc-container> + <presentation-metadata> + <papersize>letter</papersize> + </presentation-metadata> + </misc-container> + --> + + <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/> + <xsl:variable name="papersize_width_"> <xsl:choose> <xsl:when test="$papersize = 'letter'">215.9</xsl:when> <xsl:when test="$papersize = 'a4'">210</xsl:when> </xsl:choose> - </xsl:variable><xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/><xsl:variable name="papersize_height_"> + </xsl:variable> + <xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/> + <xsl:variable name="papersize_height_"> <xsl:choose> <xsl:when test="$papersize = 'letter'">279.4</xsl:when> <xsl:when test="$papersize = 'a4'">297</xsl:when> </xsl:choose> - </xsl:variable><xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/><xsl:variable name="pageWidth_"> + </xsl:variable> + <xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/> + + <!-- page width in mm --> + <xsl:variable name="pageWidth_"> <xsl:choose> <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when> <xsl:otherwise> 210 </xsl:otherwise> </xsl:choose> - </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_"> + </xsl:variable> + <xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/> + + <!-- page height in mm --> + <xsl:variable name="pageHeight_"> <xsl:choose> <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when> <xsl:otherwise> 297 </xsl:otherwise> </xsl:choose> - </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_"> + </xsl:variable> + <xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/> + + <!-- Page margins in mm (just digits, without 'mm')--> + <!-- marginLeftRight1 and marginLeftRight2 - is left or right margin depends on odd/even page, + for example, left margin on odd page and right margin on even page --> + <xsl:variable name="marginLeftRight1_"> 40 - </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_"> + </xsl:variable> + <xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/> + + <xsl:variable name="marginLeftRight2_"> 40 - </xsl:variable><xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/><xsl:variable name="marginTop_"> + </xsl:variable> + <xsl:variable name="marginLeftRight2" select="normalize-space($marginLeftRight2_)"/> + + <xsl:variable name="marginTop_"> 30 - </xsl:variable><xsl:variable name="marginTop" select="normalize-space($marginTop_)"/><xsl:variable name="marginBottom_"> + </xsl:variable> + <xsl:variable name="marginTop" select="normalize-space($marginTop_)"/> + + <xsl:variable name="marginBottom_"> 40 - </xsl:variable><xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/><xsl:variable name="titles_"> - - + </xsl:variable> + <xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/> + + <!-- Note 2: almost all localized string determined in the element //localized-strings in metanorma xml, but there are a few cases when: + - string didn't determined yet + - we need to put the string on two-languages (for instance, on English and French both), but xml contains only localized strings for one language + - there is a difference between localized string value and text that should be displayed in PDF + --> + <xsl:variable name="titles_"> + <!-- These titles of Table of contents renders different than determined in localized-strings --> <title-toc lang="en"> - - - + </title-toc> <title-toc lang="fr"> <xsl:text>Sommaire</xsl:text> </title-toc> <title-toc lang="zh"> - + <xsl:text>Contents</xsl:text> - + </title-toc> - + <title-descriptors lang="en">Descriptors</title-descriptors> - + <title-part lang="en"> - - - + </title-part> <title-part lang="fr"> - - - + </title-part> <title-part lang="ru"> - - + </title-part> <title-part lang="zh">第 # 部分:</title-part> - + <title-subpart lang="en">Sub-part #</title-subpart> <title-subpart lang="fr">Partie de sub #</title-subpart> - + <title-list-tables lang="en">List of Tables</title-list-tables> - + <title-list-figures lang="en">List of Figures</title-list-figures> - + <title-table-figures lang="en">Table of Figures</title-table-figures> - + <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations> - + <title-summary lang="en">Summary</title-summary> - + <title-continued lang="ru">(продолжение)</title-continued> <title-continued lang="en">(continued)</title-continued> <title-continued lang="fr">(continué)</title-continued> - - </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="title-list-tables"> + + </xsl:variable> + <xsl:variable name="titles" select="xalan:nodeset($titles_)"/> + + <xsl:variable name="title-list-tables"> <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/> <xsl:value-of select="$toc_table_title"/> <xsl:if test="normalize-space($toc_table_title) = ''"> <xsl:call-template name="getTitle"> <xsl:with-param name="name" select="'title-list-tables'"/> </xsl:call-template> </xsl:if> - </xsl:variable><xsl:variable name="title-list-figures"> + </xsl:variable> + + <xsl:variable name="title-list-figures"> <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/> <xsl:value-of select="$toc_figure_title"/> <xsl:if test="normalize-space($toc_figure_title) = ''"> <xsl:call-template name="getTitle"> <xsl:with-param name="name" select="'title-list-figures'"/> </xsl:call-template> </xsl:if> - </xsl:variable><xsl:variable name="title-list-recommendations"> + </xsl:variable> + + <xsl:variable name="title-list-recommendations"> <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/> <xsl:value-of select="$toc_requirement_title"/> <xsl:if test="normalize-space($toc_requirement_title) = ''"> <xsl:call-template name="getTitle"> <xsl:with-param name="name" select="'title-list-recommendations'"/> </xsl:call-template> </xsl:if> - </xsl:variable><xsl:variable name="bibdata"> + </xsl:variable> + + <xsl:variable name="bibdata"> <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/> <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/> - </xsl:variable><xsl:variable name="linebreak">&#8232;</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space">​</xsl:variable><xsl:variable name="hair_space"> </xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle"> + </xsl:variable> + + <!-- Characters --> + <xsl:variable name="linebreak">&#8232;</xsl:variable> + <xsl:variable name="tab_zh"> </xsl:variable> + <xsl:variable name="non_breaking_hyphen">‑</xsl:variable> + <xsl:variable name="thin_space"> </xsl:variable> + <xsl:variable name="zero_width_space">​</xsl:variable> + <xsl:variable name="hair_space"> </xsl:variable> + <xsl:variable name="en_dash">–</xsl:variable> + + <xsl:template name="getTitle"> <xsl:param name="name"/> <xsl:param name="lang"/> <xsl:variable name="lang_"> <xsl:choose> <xsl:when test="$lang != ''"> @@ -902,60 +974,59 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable><xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable><xsl:variable name="font_noto_serif">Noto Serif, Noto Serif HK, Noto Serif JP, Noto Serif KR, Noto Serif SC, Noto Serif TC</xsl:variable><xsl:attribute-set name="root-style"> - - - - - - - - - - - - - - - - - + </xsl:template> + + <xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable> + <xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable> + + <xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/> + + <!-- ====================================== --> + <!-- STYLES --> + <!-- ====================================== --> + <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable> + <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable> + <xsl:variable name="font_noto_serif">Noto Serif, Noto Serif HK, Noto Serif JP, Noto Serif KR, Noto Serif SC, Noto Serif TC</xsl:variable> + <xsl:attribute-set name="root-style"> + <xsl:attribute name="font-family">Times New Roman, STIX Two Math, <xsl:value-of select="$font_noto_serif"/></xsl:attribute> <xsl:attribute name="font-family-generic">Serif</xsl:attribute> <xsl:attribute name="font-size">10pt</xsl:attribute> - - </xsl:attribute-set><xsl:template name="insertRootStyle"> + + </xsl:attribute-set> <!-- root-style --> + + <xsl:template name="insertRootStyle"> <xsl:param name="root-style"/> <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/> - + <xsl:variable name="additional_fonts_"> <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']"> <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if> </xsl:for-each> </xsl:variable> <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/> - + <xsl:variable name="font_family_generic" select="$root-style_/root-style/@font-family-generic"/> - + <xsl:for-each select="$root-style_/root-style/@*"> - + <xsl:choose> <xsl:when test="local-name() = 'font-family-generic'"><!-- skip, it's using for determine 'sans' or 'serif' --></xsl:when> <xsl:when test="local-name() = 'font-family'"> - + <xsl:variable name="font_regional_prefix"> <xsl:choose> <xsl:when test="$font_family_generic = 'Sans'">Noto Sans</xsl:when> <xsl:otherwise>Noto Serif</xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:attribute name="{local-name()}"> - + <xsl:variable name="font_extended"> <xsl:choose> <xsl:when test="$lang = 'zh'"><xsl:value-of select="$font_regional_prefix"/> SC</xsl:when> <xsl:when test="$lang = 'hk'"><xsl:value-of select="$font_regional_prefix"/> HK</xsl:when> <xsl:when test="$lang = 'jp'"><xsl:value-of select="$font_regional_prefix"/> JP</xsl:when> @@ -966,23 +1037,23 @@ </xsl:variable> <xsl:if test="normalize-space($font_extended) != ''"> <xsl:value-of select="$font_regional_prefix"/><xsl:text>, </xsl:text> <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text> </xsl:if> - + <xsl:value-of select="."/> - + <xsl:if test="$additional_fonts != ''"> <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/> </xsl:if> </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:copy-of select="."/> </xsl:otherwise> </xsl:choose> - + <!-- <xsl:choose> <xsl:when test="local-name() = 'font-family'"> <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/> </xsl:attribute> @@ -990,1318 +1061,1049 @@ <xsl:otherwise> <xsl:copy-of select="."/> </xsl:otherwise> </xsl:choose> --> </xsl:for-each> - </xsl:template><xsl:attribute-set name="copyright-statement-style"> - - </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style"> - - - </xsl:attribute-set><xsl:attribute-set name="copyright-statement-p-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="license-statement-style"> - - - </xsl:attribute-set><xsl:attribute-set name="license-statement-title-style"> + </xsl:template> <!-- insertRootStyle --> + + <!-- Preface sections styles --> + <xsl:attribute-set name="copyright-statement-style"> + + </xsl:attribute-set> <!-- copyright-statement-style --> + + <xsl:attribute-set name="copyright-statement-title-style"> + + </xsl:attribute-set> <!-- copyright-statement-title-style --> + + <xsl:attribute-set name="copyright-statement-p-style"> + + </xsl:attribute-set> <!-- copyright-statement-p-style --> + + <xsl:attribute-set name="license-statement-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="license-statement-title-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> - - - - - - - </xsl:attribute-set><xsl:attribute-set name="license-statement-p-style"> - - - - - </xsl:attribute-set><xsl:attribute-set name="legal-statement-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="legal-statement-title-style"> + + </xsl:attribute-set> <!-- license-statement-title-style --> + + <xsl:attribute-set name="license-statement-p-style"> + + </xsl:attribute-set> <!-- license-statement-p-style --> + + <xsl:attribute-set name="legal-statement-style"> + + </xsl:attribute-set> <!-- legal-statement-style --> + + <xsl:attribute-set name="legal-statement-title-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> - - - - - - </xsl:attribute-set><xsl:attribute-set name="legal-statement-p-style"> - - </xsl:attribute-set><xsl:attribute-set name="feedback-statement-style"> - - - </xsl:attribute-set><xsl:attribute-set name="feedback-statement-title-style"> + + </xsl:attribute-set> <!-- legal-statement-title-style --> + + <xsl:attribute-set name="legal-statement-p-style"> + + </xsl:attribute-set> <!-- legal-statement-p-style --> + + <xsl:attribute-set name="feedback-statement-style"> + + </xsl:attribute-set> <!-- feedback-statement-style --> + + <xsl:attribute-set name="feedback-statement-title-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="feedback-statement-p-style"> - - - </xsl:attribute-set><xsl:attribute-set name="link-style"> - - - - - - </xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style"> - - </xsl:attribute-set><xsl:attribute-set name="sourcecode-style"> + + </xsl:attribute-set> <!-- feedback-statement-title-style --> + + <xsl:attribute-set name="feedback-statement-p-style"> + + </xsl:attribute-set> <!-- feedback-statement-p-style --> + + <!-- End Preface sections styles --> + + <xsl:attribute-set name="link-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="sourcecode-container-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="sourcecode-style"> <xsl:attribute name="white-space">pre</xsl:attribute> <xsl:attribute name="wrap-option">wrap</xsl:attribute> <xsl:attribute name="role">Code</xsl:attribute> - - - - - - - - - - - - - - - - - - <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute> + + <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute> <xsl:attribute name="margin-top">6pt</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="permission-style"> - - </xsl:attribute-set><xsl:attribute-set name="permission-name-style"> - - </xsl:attribute-set><xsl:attribute-set name="permission-label-style"> - - </xsl:attribute-set><xsl:attribute-set name="requirement-style"> - - - </xsl:attribute-set><xsl:attribute-set name="requirement-name-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="permission-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="permission-name-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="permission-label-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="requirement-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="requirement-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="requirement-label-style"> - - </xsl:attribute-set><xsl:attribute-set name="subject-style"> - </xsl:attribute-set><xsl:attribute-set name="inherit-style"> - </xsl:attribute-set><xsl:attribute-set name="description-style"> - </xsl:attribute-set><xsl:attribute-set name="specification-style"> - </xsl:attribute-set><xsl:attribute-set name="measurement-target-style"> - </xsl:attribute-set><xsl:attribute-set name="verification-style"> - </xsl:attribute-set><xsl:attribute-set name="import-style"> - </xsl:attribute-set><xsl:attribute-set name="recommendation-style"> - - - </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style"> - - - </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style"> - - </xsl:attribute-set><xsl:attribute-set name="termexample-style"> - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="example-style"> - - - - - - - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="example-body-style"> - - - - - - </xsl:attribute-set><xsl:attribute-set name="example-name-style"> - - - - - - - - - - - - - - - + </xsl:attribute-set> + + <xsl:attribute-set name="requirement-label-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="subject-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="inherit-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="description-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="specification-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="measurement-target-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="verification-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="import-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="recommendation-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="recommendation-name-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="recommendation-label-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="termexample-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="example-style"> + + </xsl:attribute-set> <!-- example-style --> + + <xsl:attribute-set name="example-body-style"> + + </xsl:attribute-set> <!-- example-body-style --> + + <xsl:attribute-set name="example-name-style"> + <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="font-size">10pt</xsl:attribute> - <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - - - - - </xsl:attribute-set><xsl:attribute-set name="example-p-style"> - - - - - - - - - - - - - + + </xsl:attribute-set> <!-- example-name-style --> + + <xsl:attribute-set name="example-p-style"> + <xsl:attribute name="font-size">11pt</xsl:attribute> <xsl:attribute name="margin-top">12pt</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - <xsl:attribute name="margin-left">15mm</xsl:attribute> - - - - - </xsl:attribute-set><xsl:attribute-set name="termexample-name-style"> - - - - - - - </xsl:attribute-set><xsl:variable name="table-border_"> - - - </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-container-style"> + <xsl:attribute name="margin-left">15mm</xsl:attribute> + + </xsl:attribute-set> <!-- example-p-style --> + + <xsl:attribute-set name="termexample-name-style"> + + </xsl:attribute-set> <!-- termexample-name-style --> + + <!-- ========================== --> + <!-- Table styles --> + <!-- ========================== --> + <xsl:variable name="table-border_"> + + </xsl:variable> + <xsl:variable name="table-border" select="normalize-space($table-border_)"/> + + <xsl:attribute-set name="table-container-style"> <xsl:attribute name="margin-left">0mm</xsl:attribute> <xsl:attribute name="margin-right">0mm</xsl:attribute> - - - - - - - - - - - - - - - - - - - - + <xsl:attribute name="margin-bottom">18pt</xsl:attribute> <xsl:attribute name="font-size">8pt</xsl:attribute> - - - - </xsl:attribute-set><xsl:attribute-set name="table-style"> + + </xsl:attribute-set> <!-- table-container-style --> + + <xsl:attribute-set name="table-style"> <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute> <xsl:attribute name="table-layout">fixed</xsl:attribute> <xsl:attribute name="margin-left">0mm</xsl:attribute> <xsl:attribute name="margin-right">0mm</xsl:attribute> - - - - - - - - - - - - - - - - - - - - + <xsl:attribute name="border-top">0.5pt solid black</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="table-name-style"> + + </xsl:attribute-set><!-- table-style --> + + <xsl:attribute-set name="table-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> - - - - - - - - - - - + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> <xsl:attribute name="font-weight">normal</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> <xsl:attribute name="font-size">10pt</xsl:attribute> <xsl:attribute name="text-align">left</xsl:attribute> <xsl:attribute name="text-indent">0mm</xsl:attribute> - - - - - - </xsl:attribute-set><xsl:attribute-set name="table-row-style"> + + </xsl:attribute-set> <!-- table-name-style --> + + <xsl:attribute-set name="table-row-style"> <xsl:attribute name="min-height">4mm</xsl:attribute> - - - - - </xsl:attribute-set><xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style"> <xsl:attribute name="font-weight">bold</xsl:attribute> - - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style"> - </xsl:attribute-set><xsl:attribute-set name="table-header-cell-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="table-header-cell-style"> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="border">solid black 1pt</xsl:attribute> <xsl:attribute name="padding-left">1mm</xsl:attribute> <xsl:attribute name="padding-right">1mm</xsl:attribute> <xsl:attribute name="display-align">center</xsl:attribute> - - - - - - - - - - - - + <xsl:attribute name="display-align">center</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> <xsl:attribute name="font-weight">normal</xsl:attribute> <xsl:attribute name="padding-top">2mm</xsl:attribute> <xsl:attribute name="padding-left">2mm</xsl:attribute> <xsl:attribute name="border">solid black 0pt</xsl:attribute> <xsl:attribute name="border-top">solid black 0.2pt</xsl:attribute> <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute> <xsl:attribute name="text-indent">0mm</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="table-cell-style"> + + </xsl:attribute-set> <!-- table-header-cell-style --> + + <xsl:attribute-set name="table-cell-style"> <xsl:attribute name="display-align">center</xsl:attribute> <xsl:attribute name="border">solid black 1pt</xsl:attribute> <xsl:attribute name="padding-left">1mm</xsl:attribute> <xsl:attribute name="padding-right">1mm</xsl:attribute> - - - - - - - - - - - - - + <xsl:attribute name="display-align">before</xsl:attribute> <xsl:attribute name="padding-left">0mm</xsl:attribute> <xsl:attribute name="padding-top">2mm</xsl:attribute> <xsl:attribute name="padding-bottom">1mm</xsl:attribute> <xsl:attribute name="border">solid black 0pt</xsl:attribute> <xsl:attribute name="border-bottom">solid black 1.5pt</xsl:attribute> <xsl:attribute name="text-indent">0mm</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style"> + + </xsl:attribute-set> <!-- table-cell-style --> + + <xsl:attribute-set name="table-footer-cell-style"> <xsl:attribute name="border">solid black 1pt</xsl:attribute> <xsl:attribute name="padding-left">1mm</xsl:attribute> <xsl:attribute name="padding-right">1mm</xsl:attribute> <xsl:attribute name="padding-top">1mm</xsl:attribute> - - - - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="table-note-style"> + + </xsl:attribute-set> <!-- table-footer-cell-style --> + + <xsl:attribute-set name="table-note-style"> <xsl:attribute name="font-size">10pt</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="table-fn-style"> + + </xsl:attribute-set><!-- table-note-style --> + + <xsl:attribute-set name="table-fn-style"> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style"> + + </xsl:attribute-set> <!-- table-fn-style --> + + <xsl:attribute-set name="table-fn-number-style"> <xsl:attribute name="font-size">80%</xsl:attribute> <xsl:attribute name="padding-right">5mm</xsl:attribute> - - - - - - - - - - - - - + <xsl:attribute name="vertical-align">super</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="fn-container-body-style"> + + </xsl:attribute-set> <!-- table-fn-number-style --> + + <xsl:attribute-set name="fn-container-body-style"> <xsl:attribute name="text-indent">0</xsl:attribute> <xsl:attribute name="start-indent">0</xsl:attribute> - - + <xsl:attribute name="margin-left">-8mm</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="table-fn-body-style"> - - </xsl:attribute-set><xsl:attribute-set name="figure-fn-number-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="table-fn-body-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="figure-fn-number-style"> <xsl:attribute name="font-size">80%</xsl:attribute> <xsl:attribute name="padding-right">5mm</xsl:attribute> <xsl:attribute name="vertical-align">super</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="figure-fn-body-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="figure-fn-body-style"> <xsl:attribute name="text-align">justify</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="dt-row-style"> - - - </xsl:attribute-set><xsl:attribute-set name="dt-cell-style"> - </xsl:attribute-set><xsl:attribute-set name="dt-block-style"> + + </xsl:attribute-set> + <!-- ========================== --> + <!-- END Table styles --> + <!-- ========================== --> + + <!-- ========================== --> + <!-- Definition's list styles --> + <!-- ========================== --> + <xsl:attribute-set name="dt-row-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="dt-cell-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="dt-block-style"> <xsl:attribute name="margin-top">6pt</xsl:attribute> - - - - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="dl-name-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="dl-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> - - - - - - - - - - - + <xsl:attribute name="font-weight">normal</xsl:attribute> - - - - - - </xsl:attribute-set><xsl:attribute-set name="dd-cell-style"> + + </xsl:attribute-set> <!-- dl-name-style --> + + <xsl:attribute-set name="dd-cell-style"> <xsl:attribute name="padding-left">2mm</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="appendix-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="appendix-example-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="xref-style"> - - - - - - </xsl:attribute-set><xsl:attribute-set name="eref-style"> - - - - - + </xsl:attribute-set> + + <!-- ========================== --> + <!-- END Definition's list styles --> + <!-- ========================== --> + + <xsl:attribute-set name="appendix-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="appendix-example-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="xref-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="eref-style"> + <xsl:attribute name="color">blue</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="note-style"> - - - - - - - - - - - - - - + + </xsl:attribute-set> + + <xsl:attribute-set name="note-style"> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - - - - - </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style"> - - - - - - - - - - - - + + </xsl:attribute-set> + + <xsl:variable name="note-body-indent">10mm</xsl:variable> + <xsl:variable name="note-body-indent-table">5mm</xsl:variable> + + <xsl:attribute-set name="note-name-style"> + <xsl:attribute name="padding-right">4mm</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="table-note-name-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="table-note-name-style"> <xsl:attribute name="padding-right">2mm</xsl:attribute> - - - - - </xsl:attribute-set><xsl:attribute-set name="note-p-style"> - - - - - - - - - - - - - + + </xsl:attribute-set> + + <xsl:attribute-set name="note-p-style"> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - <xsl:attribute name="text-indent">0</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="termnote-style"> - - - - - - - <xsl:attribute name="margin-top">4pt</xsl:attribute> - - - - </xsl:attribute-set><xsl:attribute-set name="termnote-name-style"> - - - - - </xsl:attribute-set><xsl:attribute-set name="termnote-p-style"> - - </xsl:attribute-set><xsl:attribute-set name="quote-style"> + <xsl:attribute name="text-indent">0</xsl:attribute> + + </xsl:attribute-set> + + <xsl:attribute-set name="termnote-style"> + + <xsl:attribute name="margin-top">4pt</xsl:attribute> + + </xsl:attribute-set> + + <xsl:attribute-set name="termnote-name-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="termnote-p-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="quote-style"> <xsl:attribute name="margin-left">12mm</xsl:attribute> <xsl:attribute name="margin-right">12mm</xsl:attribute> - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="quote-source-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="quote-source-style"> <xsl:attribute name="text-align">right</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="termsource-style"> - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="termsource-text-style"> - - - </xsl:attribute-set><xsl:attribute-set name="origin-style"> - - - - - </xsl:attribute-set><xsl:attribute-set name="term-style"> - - </xsl:attribute-set><xsl:attribute-set name="term-name-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="termsource-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="termsource-text-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="origin-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="term-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="term-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="figure-style"> - - </xsl:attribute-set><xsl:attribute-set name="figure-name-style"> - - - - - - - - - - - - - - - - + </xsl:attribute-set> - + <xsl:attribute-set name="figure-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="figure-name-style"> + <xsl:attribute name="text-align">center</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> <xsl:attribute name="keep-with-previous">always</xsl:attribute> - - - - - </xsl:attribute-set><xsl:attribute-set name="formula-style"> + + </xsl:attribute-set> + + <!-- Formula's styles --> + <xsl:attribute-set name="formula-style"> <xsl:attribute name="margin-top">6pt</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - - - - - - - </xsl:attribute-set><xsl:attribute-set name="formula-stem-block-style"> + + </xsl:attribute-set> <!-- formula-style --> + + <xsl:attribute-set name="formula-stem-block-style"> <xsl:attribute name="text-align">center</xsl:attribute> - - - - - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style"> + + </xsl:attribute-set> <!-- formula-stem-block-style --> + + <xsl:attribute-set name="formula-stem-number-style"> <xsl:attribute name="text-align">right</xsl:attribute> - - - - - - </xsl:attribute-set><xsl:attribute-set name="image-style"> + + </xsl:attribute-set> <!-- formula-stem-number-style --> + <!-- End Formula's styles --> + + <xsl:attribute-set name="image-style"> <xsl:attribute name="text-align">center</xsl:attribute> - - - - + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> <xsl:attribute name="keep-with-next">always</xsl:attribute> - <xsl:attribute name="border">2pt solid black</xsl:attribute> - - - - </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style"> - - </xsl:attribute-set><xsl:attribute-set name="image-graphic-style"> + <xsl:attribute name="border">2pt solid black</xsl:attribute> + + </xsl:attribute-set> + + <xsl:attribute-set name="figure-pseudocode-p-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="image-graphic-style"> <xsl:attribute name="width">100%</xsl:attribute> <xsl:attribute name="content-height">100%</xsl:attribute> - <xsl:attribute name="scaling">uniform</xsl:attribute> - - - + <xsl:attribute name="scaling">uniform</xsl:attribute> + <xsl:attribute name="content-width">scale-to-fit</xsl:attribute> - - - - </xsl:attribute-set><xsl:attribute-set name="tt-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="tt-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="sourcecode-name-style"> <xsl:attribute name="font-size">11pt</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="text-align">center</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> <xsl:attribute name="keep-with-previous">always</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="preferred-block-style"> - - - - - - - </xsl:attribute-set><xsl:attribute-set name="preferred-term-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="preferred-block-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="preferred-term-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="domain-style"> - - </xsl:attribute-set><xsl:attribute-set name="admitted-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="deprecates-style"> - - - </xsl:attribute-set><xsl:attribute-set name="definition-style"> - - - - </xsl:attribute-set><xsl:variable name="color-added-text"> + + </xsl:attribute-set> + + <xsl:attribute-set name="domain-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="admitted-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="deprecates-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="definition-style"> + + </xsl:attribute-set> + + <xsl:variable name="color-added-text"> <xsl:text>rgb(0, 255, 0)</xsl:text> - </xsl:variable><xsl:attribute-set name="add-style"> - + </xsl:variable> + <xsl:attribute-set name="add-style"> + <xsl:attribute name="color">red</xsl:attribute> <xsl:attribute name="text-decoration">underline</xsl:attribute> <!-- <xsl:attribute name="color">black</xsl:attribute> <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute> <xsl:attribute name="padding-top">1mm</xsl:attribute> <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> --> - - </xsl:attribute-set><xsl:variable name="add-style"> + + </xsl:attribute-set> + + <xsl:variable name="add-style"> <add-style xsl:use-attribute-sets="add-style"/> - </xsl:variable><xsl:template name="append_add-style"> + </xsl:variable> + <xsl:template name="append_add-style"> <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/> - </xsl:template><xsl:variable name="color-deleted-text"> + </xsl:template> + + <xsl:variable name="color-deleted-text"> <xsl:text>red</xsl:text> - </xsl:variable><xsl:attribute-set name="del-style"> + </xsl:variable> + <xsl:attribute-set name="del-style"> <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> <xsl:attribute name="text-decoration">line-through</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="mathml-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="mathml-style"> <xsl:attribute name="font-family">STIX Two Math</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="list-style"> - - - - - - - - - - - - - - - - - + + </xsl:attribute-set> + + <xsl:attribute-set name="list-style"> + <xsl:attribute name="provisional-distance-between-starts">4mm</xsl:attribute> <xsl:attribute name="margin-left">-8mm</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="list-name-style"> + + </xsl:attribute-set> <!-- list-style --> + + <xsl:attribute-set name="list-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> - - - - - - - - - - + <xsl:attribute name="font-weight">normal</xsl:attribute> - - - - - - </xsl:attribute-set><xsl:attribute-set name="list-item-style"> - - - </xsl:attribute-set><xsl:attribute-set name="list-item-label-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="list-item-body-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="toc-style"> + + </xsl:attribute-set> <!-- list-name-style --> + + <xsl:attribute-set name="list-item-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="list-item-label-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="list-item-body-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="toc-style"> <xsl:attribute name="line-height">135%</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="fn-reference-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="fn-reference-style"> <xsl:attribute name="font-size">80%</xsl:attribute> <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="fn-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="fn-style"> <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="fn-num-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="fn-num-style"> <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> - - - - - - - - - - - - - - - - + <xsl:attribute name="font-size">60%</xsl:attribute> <xsl:attribute name="vertical-align">super</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="fn-body-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="fn-body-style"> <xsl:attribute name="font-weight">normal</xsl:attribute> <xsl:attribute name="font-style">normal</xsl:attribute> <xsl:attribute name="text-indent">0</xsl:attribute> <xsl:attribute name="start-indent">0</xsl:attribute> - - - - - - - - - - - - - - - - - - + <xsl:attribute name="font-size">9pt</xsl:attribute> <xsl:attribute name="text-align">justify</xsl:attribute> <xsl:attribute name="line-height">125%</xsl:attribute> <xsl:attribute name="margin-left">8mm</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="fn-body-num-style"> <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute> - - - - - - - - - - - - - - - - - + <xsl:attribute name="font-size">60%</xsl:attribute> <xsl:attribute name="vertical-align">super</xsl:attribute> <xsl:attribute name="padding-right">8mm</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="admonition-style"> - - - - - - - - - - - - - - + + </xsl:attribute-set> <!-- fn-body-num-style --> + + <!-- admonition --> + <xsl:attribute-set name="admonition-style"> + <xsl:attribute name="border">0.25pt solid black</xsl:attribute> <xsl:attribute name="margin-left">-3mm</xsl:attribute> <xsl:attribute name="margin-right">-3mm</xsl:attribute> <xsl:attribute name="padding-top">4mm</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="admonition-container-style"> + + </xsl:attribute-set> <!-- admonition-style --> + + <xsl:attribute-set name="admonition-container-style"> <xsl:attribute name="margin-left">0mm</xsl:attribute> <xsl:attribute name="margin-right">0mm</xsl:attribute> - - - - - - - - - - + <xsl:attribute name="margin-left">2mm</xsl:attribute> <xsl:attribute name="margin-right">2mm</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="admonition-name-style"> + + </xsl:attribute-set> <!-- admonition-container-style --> + + <xsl:attribute-set name="admonition-name-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> - - - - - - - - - - - - + <xsl:attribute name="text-align">center</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="admonition-p-style"> - - - - - - - - - - - + + </xsl:attribute-set> <!-- admonition-name-style --> + + <xsl:attribute-set name="admonition-p-style"> + <xsl:attribute name="text-align">justify</xsl:attribute> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> <xsl:attribute name="line-height">122%</xsl:attribute> - - - </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-style"> - - - - - - - - - - - - - - - - - - + + </xsl:attribute-set> <!-- admonition-p-style --> + <!-- end admonition --> + + <!-- bibitem in Normative References (references/@normative="true") --> + <xsl:attribute-set name="bibitem-normative-style"> + <xsl:attribute name="margin-top">6pt</xsl:attribute> <xsl:attribute name="margin-left">14mm</xsl:attribute> <xsl:attribute name="text-indent">-14mm</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-style"> + + </xsl:attribute-set> <!-- bibitem-normative-style --> + + <!-- bibitem in Normative References (references/@normative="true"), renders as list --> + <xsl:attribute-set name="bibitem-normative-list-style"> <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - - - - + <!-- <xsl:if test="$namespace = 'ieee'"> <xsl:attribute name="margin-bottom">6pt</xsl:attribute> <xsl:attribute name="provisional-distance-between-starts">9.5mm</xsl:attribute> </xsl:if> --> - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-style"> - - - - - </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-style"> + + </xsl:attribute-set> <!-- bibitem-normative-list-style --> + + <xsl:attribute-set name="bibitem-non-normative-style"> + + </xsl:attribute-set> <!-- bibitem-non-normative-style --> + + <!-- bibitem in bibliography section (references/@normative="false"), renders as list --> + <xsl:attribute-set name="bibitem-non-normative-list-style"> <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - - - - - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-body-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-body-style"> - - - - - </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style"> + + </xsl:attribute-set> <!-- bibitem-non-normative-list-style --> + + <!-- bibitem in bibliography section (references/@normative="false"), list body --> + <xsl:attribute-set name="bibitem-normative-list-body-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="bibitem-non-normative-list-body-style"> + + </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style --> + + <!-- footnote reference number for bibitem, in the text --> + <xsl:attribute-set name="bibitem-note-fn-style"> <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> <xsl:attribute name="font-size">65%</xsl:attribute> - - - - - - - - - - - - - - - - - + <xsl:attribute name="vertical-align">super</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-number-style"> + + </xsl:attribute-set> <!-- bibitem-note-fn-style --> + + <!-- footnote number on the page bottom --> + <xsl:attribute-set name="bibitem-note-fn-number-style"> <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute> - - - - - - - - - - - - - - - - - + <xsl:attribute name="font-size">60%</xsl:attribute> <xsl:attribute name="vertical-align">super</xsl:attribute> - - </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-body-style"> + + </xsl:attribute-set> <!-- bibitem-note-fn-number-style --> + + <!-- footnote body (text) on the page bottom --> + <xsl:attribute-set name="bibitem-note-fn-body-style"> <xsl:attribute name="font-size">10pt</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> <xsl:attribute name="start-indent">0pt</xsl:attribute> - - - - - - - - - - - - - </xsl:attribute-set><xsl:attribute-set name="references-non-normative-style"> - - - - </xsl:attribute-set><xsl:attribute-set name="hljs-doctag"> + + </xsl:attribute-set> <!-- bibitem-note-fn-body-style --> + + <xsl:attribute-set name="references-non-normative-style"> + + </xsl:attribute-set> <!-- references-non-normative-style --> + + <!-- Highlight.js syntax GitHub styles --> + <xsl:attribute-set name="hljs-doctag"> <xsl:attribute name="color">#d73a49</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-keyword"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-keyword"> <xsl:attribute name="color">#d73a49</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-keyword"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-meta_hljs-keyword"> <xsl:attribute name="color">#d73a49</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-template-tag"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-template-tag"> <xsl:attribute name="color">#d73a49</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-template-variable"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-template-variable"> <xsl:attribute name="color">#d73a49</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-type"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-type"> <xsl:attribute name="color">#d73a49</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-variable_and_language_"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-variable_and_language_"> <xsl:attribute name="color">#d73a49</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-title"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-title"> <xsl:attribute name="color">#6f42c1</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class_"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-title_and_class_"> <xsl:attribute name="color">#6f42c1</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_class__and_inherited__"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-title_and_class__and_inherited__"> <xsl:attribute name="color">#6f42c1</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-title_and_function_"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-title_and_function_"> <xsl:attribute name="color">#6f42c1</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-attr"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-attr"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-attribute"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-attribute"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-literal"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-literal"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-meta"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-meta"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-number"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-number"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-operator"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-operator"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-variable"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-variable"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-selector-attr"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-selector-attr"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-selector-class"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-selector-class"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-selector-id"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-selector-id"> <xsl:attribute name="color">#005cc5</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-regexp"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-regexp"> <xsl:attribute name="color">#032f62</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-string"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-string"> <xsl:attribute name="color">#032f62</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-meta_hljs-string"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-meta_hljs-string"> <xsl:attribute name="color">#032f62</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-built_in"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-built_in"> <xsl:attribute name="color">#e36209</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-symbol"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-symbol"> <xsl:attribute name="color">#e36209</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-comment"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-comment"> <xsl:attribute name="color">#6a737d</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-code"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-code"> <xsl:attribute name="color">#6a737d</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-formula"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-formula"> <xsl:attribute name="color">#6a737d</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-name"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-name"> <xsl:attribute name="color">#22863a</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-quote"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-quote"> <xsl:attribute name="color">#22863a</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-selector-tag"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-selector-tag"> <xsl:attribute name="color">#22863a</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-selector-pseudo"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-selector-pseudo"> <xsl:attribute name="color">#22863a</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-subst"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-subst"> <xsl:attribute name="color">#24292e</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-section"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-section"> <xsl:attribute name="color">#005cc5</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-bullet"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-bullet"> <xsl:attribute name="color">#735c0f</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-emphasis"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-emphasis"> <xsl:attribute name="color">#24292e</xsl:attribute> <xsl:attribute name="font-style">italic</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-strong"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-strong"> <xsl:attribute name="color">#24292e</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-addition"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-addition"> <xsl:attribute name="color">#22863a</xsl:attribute> <xsl:attribute name="background-color">#f0fff4</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-deletion"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-deletion"> <xsl:attribute name="color">#b31d28</xsl:attribute> <xsl:attribute name="background-color">#ffeef0</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set name="hljs-char_and_escape_"> - </xsl:attribute-set><xsl:attribute-set name="hljs-link"> - </xsl:attribute-set><xsl:attribute-set name="hljs-params"> - </xsl:attribute-set><xsl:attribute-set name="hljs-property"> - </xsl:attribute-set><xsl:attribute-set name="hljs-punctuation"> - </xsl:attribute-set><xsl:attribute-set name="hljs-tag"> - </xsl:attribute-set><xsl:attribute-set name="indexsect-title-style"> + </xsl:attribute-set> + + <xsl:attribute-set name="hljs-char_and_escape_"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-link"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-params"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-property"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-punctuation"> + </xsl:attribute-set> + <xsl:attribute-set name="hljs-tag"> + </xsl:attribute-set> + <!-- End Highlight syntax styles --> + + <!-- Index section styles --> + <xsl:attribute-set name="indexsect-title-style"> <xsl:attribute name="role">H1</xsl:attribute> - - - - - - </xsl:attribute-set><xsl:attribute-set name="indexsect-clause-title-style"> + + </xsl:attribute-set> + + <xsl:attribute-set name="indexsect-clause-title-style"> <xsl:attribute name="keep-with-next">always</xsl:attribute> - - - - - - </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents"> + + </xsl:attribute-set> + + <!-- End Index section styles --> + <!-- ====================================== --> + <!-- END STYLES --> + <!-- ====================================== --> + + <xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable> + <xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable> + + <xsl:variable name="ace_tag">ace-tag_</xsl:variable> + + <xsl:template name="processPrefaceSectionsDefault_Contents"> <xsl:variable name="nodes_preface_"> <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]"> <node id="{@id}"/> </xsl:for-each> </xsl:variable> <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/> - + <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]"> <xsl:sort select="@displayorder" data-type="number"/> - + <!-- process Section's title --> <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/> <xsl:if test="$preceding-sibling_id != ''"> <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/> </xsl:if> - + <xsl:apply-templates select="." mode="contents"/> </xsl:for-each> - </xsl:template><xsl:template name="processMainSectionsDefault_Contents"> - + </xsl:template> + + <xsl:template name="processMainSectionsDefault_Contents"> + <xsl:variable name="nodes_sections_"> <xsl:for-each select="/*/*[local-name()='sections']/*"> <node id="{@id}"/> </xsl:for-each> </xsl:variable> <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/> - + <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]"> <xsl:sort select="@displayorder" data-type="number"/> - + <!-- process Section's title --> <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/> <xsl:if test="$preceding-sibling_id != ''"> <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="contents_no_displayorder"/> </xsl:if> - + <xsl:apply-templates select="." mode="contents"/> </xsl:for-each> - + <xsl:for-each select="/*/*[local-name()='annex']"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="." mode="contents"/> </xsl:for-each> - + <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="." mode="contents"/> </xsl:for-each> - </xsl:template><xsl:template name="processTablesFigures_Contents"> + </xsl:template> + + <xsl:template name="processTablesFigures_Contents"> <xsl:param name="always"/> <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'"> <xsl:call-template name="processTables_Contents"/> </xsl:if> <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'"> <xsl:call-template name="processFigures_Contents"/> </xsl:if> - </xsl:template><xsl:template name="processTables_Contents"> + </xsl:template> + + <xsl:template name="processTables_Contents"> <tables> <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']"> <table id="{@id}" alt-text="{*[local-name() = 'name']}"> <xsl:copy-of select="*[local-name() = 'name']"/> </table> </xsl:for-each> </tables> - </xsl:template><xsl:template name="processFigures_Contents"> + </xsl:template> + + <xsl:template name="processFigures_Contents"> <figures> <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']"> <figure id="{@id}" alt-text="{*[local-name() = 'name']}"> <xsl:copy-of select="*[local-name() = 'name']"/> </figure> </xsl:for-each> </figures> - </xsl:template><xsl:template name="processPrefaceSectionsDefault"> + </xsl:template> + + <xsl:template name="processPrefaceSectionsDefault"> <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="."/> </xsl:for-each> - </xsl:template><xsl:template name="processMainSectionsDefault"> + </xsl:template> + + <xsl:template name="processMainSectionsDefault"> <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="."/> - + </xsl:for-each> - + <xsl:for-each select="/*/*[local-name()='annex']"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="."/> </xsl:for-each> - + <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="."/> </xsl:for-each> - </xsl:template><xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable><xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable><xsl:template match="text()" name="text"> - + </xsl:template> + + <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable> + <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable> + <xsl:template match="text()" name="text"> + <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable> <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_fo_inline_keep-together_within-line_open,'$1',$tag_fo_inline_keep-together_within-line_close))"/> <xsl:call-template name="replace_fo_inline_tags"> <xsl:with-param name="tag_open" select="$tag_fo_inline_keep-together_within-line_open"/> <xsl:with-param name="tag_close" select="$tag_fo_inline_keep-together_within-line_close"/> <xsl:with-param name="text" select="$text"/> </xsl:call-template> - - </xsl:template><xsl:template name="replace_fo_inline_tags"> + + </xsl:template> + + <xsl:template name="replace_fo_inline_tags"> <xsl:param name="tag_open"/> <xsl:param name="tag_close"/> <xsl:param name="text"/> <xsl:choose> <xsl:when test="contains($text, $tag_open)"> @@ -2318,18 +2120,23 @@ <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/> </xsl:call-template> </xsl:when> <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name()='br']"> + </xsl:template> + + <xsl:template match="*[local-name()='br']"> <xsl:value-of select="$linebreak"/> - </xsl:template><xsl:template match="*[local-name() = 'keep-together_within-line']"> + </xsl:template> + + <!-- keep-together for standard's name (ISO 12345:2020) --> + <xsl:template match="*[local-name() = 'keep-together_within-line']"> <xsl:param name="split_keep-within-line"/> - + <!-- <fo:inline>split_keep-within-line='<xsl:value-of select="$split_keep-within-line"/>'</fo:inline> --> <xsl:choose> - + <xsl:when test="normalize-space($split_keep-within-line) = 'true'"> <xsl:variable name="sep">_</xsl:variable> <xsl:variable name="items"> <xsl:call-template name="split"> <xsl:with-param name="pText" select="."/> @@ -2347,252 +2154,244 @@ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:when> - + <xsl:otherwise> <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline> </xsl:otherwise> - + </xsl:choose> - </xsl:template><xsl:template match="*[local-name()='copyright-statement']"> + </xsl:template> + + <!-- ================================= --> + <!-- Preface boilerplate sections processing --> + <!-- ================================= --> + <xsl:template match="*[local-name()='copyright-statement']"> <fo:block xsl:use-attribute-sets="copyright-statement-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='title']"> - + </xsl:template> <!-- copyright-statement --> + + <xsl:template match="*[local-name()='copyright-statement']//*[local-name()='title']"> + <!-- process in the template 'title' --> <xsl:call-template name="title"/> - - </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='p']"> - - + + </xsl:template> <!-- copyright-statement//title --> + + <xsl:template match="*[local-name()='copyright-statement']//*[local-name()='p']"> + <!-- process in the template 'paragraph' --> <xsl:call-template name="paragraph"/> - - </xsl:template><xsl:template match="*[local-name()='license-statement']"> + + </xsl:template> <!-- copyright-statement//p --> + + <xsl:template match="*[local-name()='license-statement']"> <fo:block xsl:use-attribute-sets="license-statement-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='title']"> - + </xsl:template> <!-- license-statement --> + + <xsl:template match="*[local-name()='license-statement']//*[local-name()='title']"> + <!-- process in the template 'title' --> <xsl:call-template name="title"/> - - </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='p']"> - + + </xsl:template> <!-- license-statement/title --> + + <xsl:template match="*[local-name()='license-statement']//*[local-name()='p']"> + <!-- process in the template 'paragraph' --> <xsl:call-template name="paragraph"/> - - </xsl:template><xsl:template match="*[local-name()='legal-statement']"> + + </xsl:template> <!-- license-statement/p --> + + <xsl:template match="*[local-name()='legal-statement']"> <fo:block xsl:use-attribute-sets="legal-statement-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']"> - + </xsl:template> <!-- legal-statement --> + + <xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']"> + <!-- process in the template 'title' --> <xsl:call-template name="title"/> - - - </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']"> + + </xsl:template> <!-- legal-statement/title --> + + <xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']"> <xsl:param name="margin"/> - + <!-- process in the template 'paragraph' --> <xsl:call-template name="paragraph"> <xsl:with-param name="margin" select="$margin"/> </xsl:call-template> - - </xsl:template><xsl:template match="*[local-name()='feedback-statement']"> + + </xsl:template> <!-- legal-statement/p --> + + <xsl:template match="*[local-name()='feedback-statement']"> <fo:block xsl:use-attribute-sets="feedback-statement-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='title']"> - + </xsl:template> <!-- feedback-statement --> + + <xsl:template match="*[local-name()='feedback-statement']//*[local-name()='title']"> + <!-- process in the template 'title' --> <xsl:call-template name="title"/> - - </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']"> + + </xsl:template> + + <xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']"> <xsl:param name="margin"/> - + <!-- process in the template 'paragraph' --> <xsl:call-template name="paragraph"> <xsl:with-param name="margin" select="$margin"/> </xsl:call-template> - - </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1"> + + </xsl:template> + + <!-- ================================= --> + <!-- END Preface boilerplate sections processing --> + <!-- ================================= --> + + <!-- add zero spaces into table cells text --> + <xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1"> <xsl:choose> <xsl:when test="parent::*[local-name() = 'keep-together_within-line']"> <xsl:value-of select="."/> </xsl:when> <xsl:otherwise> <xsl:call-template name="addZeroWidthSpacesToTextNodes"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="addZeroWidthSpacesToTextNodes"> + </xsl:template> + + <xsl:template name="addZeroWidthSpacesToTextNodes"> <xsl:variable name="text"><text><xsl:call-template name="text"/></text></xsl:variable> <!-- <xsl:copy-of select="$text"/> --> <xsl:for-each select="xalan:nodeset($text)/text/node()"> <xsl:choose> <xsl:when test="self::text()"><xsl:call-template name="add-zero-spaces-java"/></xsl:when> <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... --> </xsl:choose> </xsl:for-each> - </xsl:template><xsl:template match="*[local-name()='table']" name="table"> - + </xsl:template> + + <xsl:template match="*[local-name()='table']" name="table"> + <xsl:variable name="table-preamble"> - - + </xsl:variable> - + <xsl:variable name="table"> - + <xsl:variable name="simple-table"> <xsl:call-template name="getSimpleTable"> <xsl:with-param name="id" select="@id"/> </xsl:call-template> </xsl:variable> <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> --> - + <!-- simple-table=<xsl:copy-of select="$simple-table"/> --> - - + <!-- Display table's name before table as standalone block --> <!-- $namespace = 'iso' or --> - + <xsl:apply-templates select="*[local-name()='name']"/> <!-- table's title rendered before table --> - - - + <xsl:call-template name="table_name_fn_display"/> - - + <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/> - + <xsl:variable name="colwidths"> <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])"> <xsl:call-template name="calculate-column-widths"> <xsl:with-param name="cols-count" select="$cols-count"/> <xsl:with-param name="table" select="$simple-table"/> </xsl:call-template> </xsl:if> </xsl:variable> <!-- <xsl:variable name="colwidths" select="xalan:nodeset($colwidths_)"/> --> - + <!-- DEBUG --> <xsl:if test="$table_if_debug = 'true'"> <fo:block font-size="60%"> <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/> </fo:block> </xsl:if> - - + <!-- <xsl:copy-of select="$colwidths"/> --> - + <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text> DEBUG colwidths=<xsl:copy-of select="$colwidths"/> <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> --> - - - + <xsl:variable name="margin-side"> <xsl:choose> <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when> <xsl:otherwise>0</xsl:otherwise> </xsl:choose> </xsl:variable> - - + <fo:block-container xsl:use-attribute-sets="table-container-style"> - - + <xsl:attribute name="margin-left"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute> <xsl:attribute name="margin-right"><xsl:value-of select="-$margin-side"/>mm</xsl:attribute> - - - - - - - - - - - - - - - - - + <!-- end table block-container attributes --> - + <!-- display table's name before table for PAS inside block-container (2-columnn layout) --> - - + <xsl:variable name="table_width_default">100%</xsl:variable> <xsl:variable name="table_width"> <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) --> - + <xsl:choose> <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when> <xsl:otherwise><xsl:value-of select="$table_width_default"/></xsl:otherwise> </xsl:choose> - + </xsl:variable> - - + <xsl:variable name="table_attributes"> - + <xsl:element name="table_attributes" use-attribute-sets="table-style"> <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute> - - + <xsl:attribute name="margin-left"><xsl:value-of select="$margin-side"/>mm</xsl:attribute> <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute> - - - - - - - - - - - - - - - + </xsl:element> </xsl:variable> - + <xsl:if test="$isGenerateTableIF = 'true'"> <!-- to determine start of table --> <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block> </xsl:if> - + <fo:table id="{@id}"> - + <xsl:if test="$isGenerateTableIF = 'true'"> <xsl:attribute name="wrap-option">no-wrap</xsl:attribute> </xsl:if> - - <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*"> + + <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*"> <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> - - <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/> + + <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/> <xsl:if test="$isNoteOrFnExist = 'true'"> <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer --> </xsl:if> - - + <xsl:choose> <xsl:when test="$isGenerateTableIF = 'true'"> <!-- generate IF for table widths --> <!-- example: <tr> @@ -2605,14 +2404,14 @@ <word id="tab-symdu_1_2_word_1">Description</word> </td> </tr> --> <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/> - + </xsl:when> <xsl:otherwise> - + <xsl:choose> <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']"> <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']"> <fo:table-column column-width="{@width}"/> </xsl:for-each> @@ -2621,60 +2420,53 @@ <xsl:call-template name="insertTableColumnWidth"> <xsl:with-param name="colwidths" select="$colwidths"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> - + <xsl:choose> <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']"> <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely --> </xsl:otherwise> </xsl:choose> - + </xsl:otherwise> </xsl:choose> - + </fo:table> - - <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/> + + <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/> <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody --> <xsl:call-template name="insertTableFooterInSeparateTable"> <xsl:with-param name="table_attributes" select="$table_attributes"/> - <xsl:with-param name="colwidths" select="$colwidths"/> - <xsl:with-param name="colgroup" select="$colgroup"/> + <xsl:with-param name="colwidths" select="$colwidths"/> + <xsl:with-param name="colgroup" select="$colgroup"/> </xsl:call-template> </xsl:for-each> - - - - - - + <xsl:if test="*[local-name()='bookmark']"> <!-- special case: table/bookmark --> <fo:block keep-with-previous="always" line-height="0.1"> <xsl:for-each select="*[local-name()='bookmark']"> <xsl:call-template name="bookmark"/> </xsl:for-each> </fo:block> </xsl:if> - + </fo:block-container> </xsl:variable> - + <xsl:variable name="isAdded" select="@added"/> <xsl:variable name="isDeleted" select="@deleted"/> - + <xsl:choose> <xsl:when test="@width"> - + <!-- centered table when table name is centered (see table-name-style) --> - - - + <xsl:choose> <xsl:when test="$isAdded = 'true' or $isDeleted = 'true'"> <xsl:copy-of select="$table-preamble"/> <fo:block> <xsl:call-template name="setTrackChangesStyles"> @@ -2687,12 +2479,11 @@ <xsl:otherwise> <xsl:copy-of select="$table-preamble"/> <xsl:copy-of select="$table"/> </xsl:otherwise> </xsl:choose> - - + </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$isAdded = 'true' or $isDeleted = 'true'"> <xsl:copy-of select="$table-preamble"/> @@ -2709,61 +2500,63 @@ <xsl:copy-of select="$table"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> - - </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"> + + </xsl:template> + + <xsl:template match="*[local-name()='table']/*[local-name() = 'name']"> <xsl:param name="continued"/> <xsl:if test="normalize-space() != ''"> - - - + <fo:block xsl:use-attribute-sets="table-name-style"> - - - - <xsl:choose> - <xsl:when test="$continued = 'true'"> - + <xsl:when test="$continued = 'true'"> + </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> - - + </fo:block> - - - + </xsl:if> - </xsl:template><xsl:template name="calculate-columns-numbers"> + </xsl:template> <!-- table/name --> + + <xsl:template name="calculate-columns-numbers"> <xsl:param name="table-row"/> <xsl:variable name="columns-count" select="count($table-row/*)"/> <xsl:variable name="sum-colspans" select="sum($table-row/*/@colspan)"/> <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/> <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/> - </xsl:template><xsl:template name="calculate-column-widths"> + </xsl:template> + + <xsl:template name="calculate-column-widths"> <xsl:param name="table"/> <xsl:param name="cols-count"/> - + <xsl:call-template name="calculate-column-widths-proportional"> <xsl:with-param name="cols-count" select="$cols-count"/> <xsl:with-param name="table" select="$table"/> </xsl:call-template> - - </xsl:template><xsl:template name="calculate-column-widths-proportional"> + + </xsl:template> + + <!-- ================================================== --> + <!-- Calculate column's width based on text string max widths --> + <!-- ================================================== --> + <xsl:template name="calculate-column-widths-proportional"> <xsl:param name="table"/> <xsl:param name="cols-count"/> <xsl:param name="curr-col" select="1"/> <xsl:param name="width" select="0"/> - + <!-- table=<xsl:copy-of select="$table"/> --> - + <xsl:if test="$curr-col &lt;= $cols-count"> <xsl:variable name="widths"> <xsl:choose> <xsl:when test="not($table)"><!-- this branch is not using in production, for debug only --> <xsl:for-each select="*[local-name()='thead']//*[local-name()='tr']"> @@ -2793,16 +2586,16 @@ </xsl:call-template> </xsl:variable> <width> <xsl:value-of select="$max_length"/> </width> - + </xsl:for-each> </xsl:when> <xsl:otherwise> <!-- <curr_col><xsl:value-of select="$curr-col"/></curr_col> --> - + <!-- <table><xsl:copy-of select="$table"/></table> --> <xsl:for-each select="xalan:nodeset($table)/*/*[local-name()='tr']"> <xsl:variable name="td_text"> <xsl:apply-templates select="td[$curr-col]" mode="td_text"/> @@ -2838,19 +2631,19 @@ <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="$max_length div $divider"/> </width> - + </xsl:for-each> - + </xsl:otherwise> </xsl:choose> </xsl:variable> - + <!-- widths=<xsl:copy-of select="$widths"/> --> - + <column> <xsl:for-each select="xalan:nodeset($widths)//width"> <xsl:sort select="." data-type="number" order="descending"/> <xsl:if test="position()=1"> <xsl:value-of select="."/> @@ -2861,29 +2654,43 @@ <xsl:with-param name="cols-count" select="$cols-count"/> <xsl:with-param name="curr-col" select="$curr-col +1"/> <xsl:with-param name="table" select="$table"/> </xsl:call-template> </xsl:if> - </xsl:template><xsl:template match="*[@keep-together.within-line or local-name() = 'keep-together_within-line']/text()" priority="2" mode="td_text"> + </xsl:template> <!-- calculate-column-widths-proportional --> + + <!-- ================================= --> + <!-- mode="td_text" --> + <!-- ================================= --> + <!-- replace each each char to 'X', just to process the tag 'keep-together_within-line' as whole word in longest word calculation --> + <xsl:template match="*[@keep-together.within-line or local-name() = 'keep-together_within-line']/text()" priority="2" mode="td_text"> <!-- <xsl:message>DEBUG t1=<xsl:value-of select="."/></xsl:message> <xsl:message>DEBUG t2=<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/></xsl:message> --> <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/> - + <!-- if all capitals english letters or digits --> <xsl:if test="normalize-space(translate(., concat($upper,'0123456789'), '')) = ''"> <xsl:call-template name="repeat"> <xsl:with-param name="char" select="'X'"/> <xsl:with-param name="count" select="string-length(normalize-space(.)) * 0.5"/> </xsl:call-template> </xsl:if> - </xsl:template><xsl:template match="text()" mode="td_text"> + </xsl:template> + + <xsl:template match="text()" mode="td_text"> <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text> - </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text"> + </xsl:template> + + <xsl:template match="*[local-name()='termsource']" mode="td_text"> <xsl:value-of select="*[local-name()='origin']/@citeas"/> - </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text"> + </xsl:template> + + <xsl:template match="*[local-name()='link']" mode="td_text"> <xsl:value-of select="@target"/> - </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text" name="math_length"> + </xsl:template> + + <xsl:template match="*[local-name()='math']" mode="td_text" name="math_length"> <xsl:if test="$isGenerateTableIF = 'false'"> <xsl:variable name="mathml_"> <xsl:for-each select="*"> <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'"> <xsl:copy-of select="."/> @@ -2897,44 +2704,56 @@ <xsl:for-each select="$mathml//@open"><xsl:value-of select="."/></xsl:for-each> <xsl:for-each select="$mathml//@close"><xsl:value-of select="."/></xsl:for-each> </xsl:variable> <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces --> </xsl:if> - </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm"> + </xsl:template> + <!-- ================================= --> + <!-- END mode="td_text" --> + <!-- ================================= --> + <!-- ================================================== --> + <!-- END Calculate column's width based on text string max widths --> + <!-- ================================================== --> + + <!-- ================================================== --> + <!-- Calculate column's width based on HTML4 algorithm --> + <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) --> + <!-- ================================================== --> + + <xsl:template name="calculate-column-widths-autolayout-algorithm"> <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step --> - + <!-- via intermediate format --> <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table --> - + <!-- In the first pass, line wrapping is disabled, and the user agent keeps track of the minimum and maximum width of each cell. --> - + <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. --> - + <!-- get current table id --> <xsl:variable name="table_id" select="@id"/> <!-- find table by id in the file 'table_widths' --> <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/> <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> --> - + <!-- table='<xsl:copy-of select="$table"/>' --> <!-- table_id='<xsl:value-of select="$table_id"/>\ --> <!-- table-if='<xsl:copy-of select="$table-if"/>' --> <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' --> - + <xsl:variable name="table_with_cell_widths_"> <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF --> </xsl:variable> <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/> - + <!-- <xsl:if test="$table_if_debug = 'true'"> <xsl:copy-of select="$table_with_cell_widths"/> </xsl:if> --> - - + <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. --> - + <xsl:variable name="column_widths_"> <!-- iteration of columns --> <xsl:for-each select="$table_with_cell_widths//tr[1]/td"> <xsl:variable name="pos" select="position()"/> <column> @@ -2952,15 +2771,15 @@ </xsl:attribute> </column> </xsl:for-each> </xsl:variable> <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/> - + <!-- <column_widths> <xsl:copy-of select="$column_widths"/> </column_widths> --> - + <!-- These in turn, are used to find the minimum and maximum width for the table. --> <xsl:variable name="table_widths_"> <table> <xsl:attribute name="width_max"> <xsl:value-of select="sum($column_widths/column/@width_max)"/> @@ -2969,30 +2788,29 @@ <xsl:value-of select="sum($column_widths/column/@width_min)"/> </xsl:attribute> </table> </xsl:variable> <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/> - + <xsl:variable name="page_width"> <xsl:choose> <xsl:when test="$parent_table_page-width != ''"> <xsl:value-of select="$parent_table_page-width"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@page-width"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:if test="$table_if_debug = 'true'"> <table_width> <xsl:copy-of select="$table_widths"/> </table_width> <debug>$page_width=<xsl:value-of select="$page_width"/></debug> </xsl:if> - - + <!-- There are three cases: --> <xsl:choose> <!-- 1. The minimum table width is equal to or wider than the available space --> <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below --> <!-- call old algorithm --> @@ -3038,23 +2856,25 @@ <!-- set the column's width to the minimum width plus d times W over D. --> <column divider="100"> <xsl:value-of select="round(@width_min + $d * $W div $D)"/> <!-- * 10 --> </column> </xsl:for-each> - + </xsl:when> <xsl:otherwise><unknown_case/></xsl:otherwise> </xsl:choose> - - </xsl:template><xsl:template name="get-calculated-column-widths-autolayout-algorithm"> - + + </xsl:template> <!-- calculate-column-widths-autolayout-algorithm --> + + <xsl:template name="get-calculated-column-widths-autolayout-algorithm"> + <!-- if nested 'dl' or 'table' --> <xsl:variable name="parent_table_id" select="normalize-space(ancestor::*[local-name() = 'table' or local-name() = 'dl'][1]/@id)"/> <parent_table_id><xsl:value-of select="$parent_table_id"/></parent_table_id> - + <parent_element><xsl:value-of select="local-name(..)"/></parent_element> - + <xsl:variable name="parent_table_page-width_"> <xsl:if test="$parent_table_id != ''"> <!-- determine column number in the parent table --> <xsl:variable name="parent_table_column_number"> <xsl:choose> @@ -3067,14 +2887,14 @@ <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> --> <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/> </xsl:if> </xsl:variable> <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/> - + <!-- get current table id --> <xsl:variable name="table_id" select="@id"/> - + <xsl:choose> <xsl:when test="$parent_table_id = '' or $parent_table_page-width = ''"> <!-- find table by id in the file 'table_widths' and get all `<column>...</column> --> <xsl:copy-of select="$table_widths_from_if_calculated//table[@id = $table_id]/node()"/> </xsl:when> @@ -3085,112 +2905,129 @@ <xsl:with-param name="parent_table_page-width" select="$parent_table_page-width"/> <!-- padding-left = 2mm = 50000--> </xsl:call-template> </xsl:for-each> </xsl:otherwise> </xsl:choose> - - </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if"> + + </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm --> + + <!-- ============================= --> + <!-- mode: determine_cell_widths-if --> + <!-- ============================= --> + <xsl:template match="@*|node()" mode="determine_cell_widths-if"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/> </xsl:copy> - </xsl:template><xsl:template match="td | th" mode="determine_cell_widths-if"> + </xsl:template> + + <xsl:template match="td | th" mode="determine_cell_widths-if"> <xsl:copy> <xsl:copy-of select="@*"/> - + <!-- The maximum width is given by the widest line. --> <xsl:attribute name="width_max"> <xsl:for-each select="p_len"> <xsl:sort select="." data-type="number" order="descending"/> <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if> </xsl:for-each> </xsl:attribute> - + <!-- The minimum width is given by the widest text element (word, image, etc.) --> <xsl:variable name="width_min"> <xsl:for-each select="word_len"> <xsl:sort select="." data-type="number" order="descending"/> <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if> </xsl:for-each> </xsl:variable> <xsl:attribute name="width_min"> <xsl:value-of select="$width_min"/> </xsl:attribute> - + <xsl:if test="$width_min = 0"> <xsl:attribute name="width_min">1</xsl:attribute> </xsl:if> - + <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/> - + </xsl:copy> - </xsl:template><xsl:template match="*[local-name()='thead']"> + </xsl:template> + <!-- ============================= --> + <!-- END mode: determine_cell_widths-if --> + <!-- ============================= --> + + <!-- ================================================== --> + <!-- Calculate column's width based on HTML4 algorithm --> + <!-- ================================================== --> + + <xsl:template match="*[local-name()='thead']"> <xsl:param name="cols-count"/> <fo:table-header> - - + <xsl:apply-templates/> </fo:table-header> - </xsl:template><xsl:template name="table-header-title"> + </xsl:template> <!-- thead --> + + <!-- template is using for iso, jcgm, bsi only --> + <xsl:template name="table-header-title"> <xsl:param name="cols-count"/> <!-- row for title --> <fo:table-row> <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black"> - - - - + <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']"> <xsl:with-param name="continued">true</xsl:with-param> </xsl:apply-templates> - - - - - - + </fo:table-cell> </fo:table-row> - </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody"> + </xsl:template> <!-- table-header-title --> + + <xsl:template match="*[local-name()='thead']" mode="process_tbody"> <fo:table-body> <xsl:apply-templates/> </fo:table-body> - </xsl:template><xsl:template match="*[local-name()='tfoot']"> + </xsl:template> + + <xsl:template match="*[local-name()='tfoot']"> <xsl:apply-templates/> - </xsl:template><xsl:template name="insertTableFooter"> + </xsl:template> + + <xsl:template name="insertTableFooter"> <xsl:param name="cols-count"/> <xsl:if test="../*[local-name()='tfoot']"> - <fo:table-footer> + <fo:table-footer> <xsl:apply-templates select="../*[local-name()='tfoot']"/> </fo:table-footer> </xsl:if> - </xsl:template><xsl:template name="insertTableFooterInSeparateTable"> + </xsl:template> + + <xsl:template name="insertTableFooterInSeparateTable"> <xsl:param name="table_attributes"/> <xsl:param name="colwidths"/> <xsl:param name="colgroup"/> - + <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/> - + <xsl:variable name="isNoteOrFnExistShowAfterTable"> - + </xsl:variable> - + <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'"> - + <xsl:variable name="cols-count"> <xsl:choose> <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']"> <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - - + <xsl:variable name="tableWithNotesAndFootnotes"> - + <fo:table keep-with-previous="always"> <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*"> <xsl:variable name="name" select="local-name()"/> <xsl:choose> <xsl:when test="$name = 'border-top'"> @@ -3203,13 +3040,11 @@ <xsl:otherwise> <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:for-each> - - - + <xsl:choose> <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']"> <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']"> <fo:table-column column-width="{@width}"/> </xsl:for-each> @@ -3219,109 +3054,94 @@ <xsl:call-template name="insertTableColumnWidth"> <xsl:with-param name="colwidths" select="$colwidths"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> - + <fo:table-body> <fo:table-row> <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}"> - - - - <!-- fn will be processed inside 'note' processing --> - - - - - - + <!-- for BSI (not PAS) display Notes before footnotes --> - - + <!-- except gb and bsi --> - + <xsl:apply-templates select="../*[local-name()='note']"/> - - - + <!-- horizontal row separator --> - - + <!-- fn processing --> - + <xsl:call-template name="table_fn_display"/> - - - + <!-- for PAS display Notes after footnotes --> - - + </fo:table-cell> </fo:table-row> </fo:table-body> - + </fo:table> </xsl:variable> - + <xsl:if test="normalize-space($tableWithNotesAndFootnotes) != ''"> <xsl:copy-of select="$tableWithNotesAndFootnotes"/> </xsl:if> - - - + </xsl:if> - </xsl:template><xsl:template match="*[local-name()='tbody']"> - + </xsl:template> <!-- insertTableFooterInSeparateTable --> + + <xsl:template match="*[local-name()='tbody']"> + <xsl:variable name="cols-count"> <xsl:choose> - <xsl:when test="../*[local-name()='thead']"> + <xsl:when test="../*[local-name()='thead']"> <xsl:call-template name="calculate-columns-numbers"> <xsl:with-param name="table-row" select="../*[local-name()='thead']/*[local-name()='tr'][1]"/> </xsl:call-template> </xsl:when> - <xsl:otherwise> + <xsl:otherwise> <xsl:call-template name="calculate-columns-numbers"> <xsl:with-param name="table-row" select="./*[local-name()='tr'][1]"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:variable> - - - + <xsl:apply-templates select="../*[local-name()='thead']"> <xsl:with-param name="cols-count" select="$cols-count"/> </xsl:apply-templates> - + <xsl:call-template name="insertTableFooter"> <xsl:with-param name="cols-count" select="$cols-count"/> </xsl:call-template> - + <fo:table-body> - <xsl:apply-templates/> - + </fo:table-body> - - </xsl:template><xsl:template match="/" mode="process_table-if"> + + </xsl:template> <!-- tbody --> + + <xsl:template match="/" mode="process_table-if"> <xsl:param name="table_or_dl">table</xsl:param> <xsl:apply-templates mode="process_table-if"> <xsl:with-param name="table_or_dl" select="$table_or_dl"/> </xsl:apply-templates> - </xsl:template><xsl:template match="*[local-name()='tbody']" mode="process_table-if"> + </xsl:template> + + <xsl:template match="*[local-name()='tbody']" mode="process_table-if"> <xsl:param name="table_or_dl">table</xsl:param> - + <fo:table-body> <xsl:for-each select="*[local-name() = 'tr']"> <xsl:variable name="col_count" select="count(*)"/> <!-- iteration for each tr/td --> - + <xsl:choose> <xsl:when test="$table_or_dl = 'table'"> <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*"> <fo:table-row number-columns-spanned="{$col_count}"> <!-- <test_table><xsl:copy-of select="."/></test_table> --> @@ -3330,11 +3150,11 @@ </xsl:for-each> </xsl:when> <xsl:otherwise> <!-- $table_or_dl = 'dl' --> <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']"> <xsl:variable name="is_dt" select="position() = 1"/> - + <xsl:for-each select="*"> <!-- <test><xsl:copy-of select="."/></test> --> <fo:table-row number-columns-spanned="{$col_count}"> <xsl:choose> <xsl:when test="$is_dt"> @@ -3347,86 +3167,77 @@ </fo:table-row> </xsl:for-each> </xsl:for-each> </xsl:otherwise> </xsl:choose> - + </xsl:for-each> </fo:table-body> - </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2"> + </xsl:template> <!-- process_table-if --> + + <!-- ===================== --> + <!-- Table's row processing --> + <!-- ===================== --> + <!-- row in table header (thead) --> + <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2"> <fo:table-row xsl:use-attribute-sets="table-header-row-style"> - - - - - - - - - <xsl:call-template name="setTableRowAttributes"/> - + <xsl:apply-templates/> </fo:table-row> - </xsl:template><xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2"> + </xsl:template> + + <!-- row in table footer (tfoot) --> + <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2"> <fo:table-row xsl:use-attribute-sets="table-footer-row-style"> - + <xsl:call-template name="setTableRowAttributes"/> <xsl:apply-templates/> </fo:table-row> - </xsl:template><xsl:template match="*[local-name()='tr']"> + </xsl:template> + + <!-- row in table's body (tbody) --> + <xsl:template match="*[local-name()='tr']"> <fo:table-row xsl:use-attribute-sets="table-body-row-style"> - - - - - - - + <xsl:call-template name="setTableRowAttributes"/> <xsl:apply-templates/> </fo:table-row> - </xsl:template><xsl:template name="setTableRowAttributes"> - - - - + </xsl:template> - - - + <xsl:template name="setTableRowAttributes"> + <xsl:if test="not(*[local-name()='th'])"> <xsl:attribute name="min-height">8mm</xsl:attribute> </xsl:if> - - </xsl:template><xsl:template match="*[local-name()='th']"> + + </xsl:template> <!-- setTableRowAttributes --> + <!-- ===================== --> + <!-- END Table's row processing --> + <!-- ===================== --> + + <!-- cell in table header row --> + <xsl:template match="*[local-name()='th']"> <fo:table-cell xsl:use-attribute-sets="table-header-cell-style"> <!-- text-align="{@align}" --> <xsl:call-template name="setTextAlignment"> <xsl:with-param name="default">center</xsl:with-param> </xsl:call-template> - - - - - - - - - <xsl:if test="$lang = 'ar'"> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> - + <xsl:call-template name="setTableCellAttributes"/> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> - </xsl:template><xsl:template name="setTableCellAttributes"> + </xsl:template> <!-- cell in table header row - 'th' --> + + <xsl:template name="setTableCellAttributes"> <xsl:if test="@colspan"> <xsl:attribute name="number-columns-spanned"> <xsl:value-of select="@colspan"/> </xsl:attribute> </xsl:if> @@ -3434,117 +3245,104 @@ <xsl:attribute name="number-rows-spanned"> <xsl:value-of select="@rowspan"/> </xsl:attribute> </xsl:if> <xsl:call-template name="display-align"/> - </xsl:template><xsl:template name="display-align"> + </xsl:template> + + <xsl:template name="display-align"> <xsl:if test="@valign"> <xsl:attribute name="display-align"> <xsl:choose> <xsl:when test="@valign = 'top'">before</xsl:when> <xsl:when test="@valign = 'middle'">center</xsl:when> <xsl:when test="@valign = 'bottom'">after</xsl:when> <xsl:otherwise>before</xsl:otherwise> - </xsl:choose> + </xsl:choose> </xsl:attribute> </xsl:if> - </xsl:template><xsl:template match="*[local-name()='td']" name="td"> + </xsl:template> + + <!-- cell in table body, footer --> + <xsl:template match="*[local-name()='td']" name="td"> <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" --> <xsl:call-template name="setTextAlignment"> <xsl:with-param name="default">left</xsl:with-param> </xsl:call-template> - + <xsl:if test="$lang = 'ar'"> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> - - - + <!-- bsi --> - - - - - - - - - - - - - - - - <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table --> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> - + <xsl:call-template name="setTableCellAttributes"/> - + <xsl:if test="$isGenerateTableIF = 'true'"> <xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width --> <xsl:attribute name="text-align">left</xsl:attribute> </xsl:if> - + <fo:block> - + <xsl:if test="$isGenerateTableIF = 'true'"> <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> </xsl:if> - - - - + <xsl:apply-templates/> - + <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> --> - </fo:block> + </fo:block> </fo:table-cell> - </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"> + </xsl:template> <!-- td --> + <xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"> + <fo:block xsl:use-attribute-sets="table-note-style"> - - - - <!-- Table's note name (NOTE, for example) --> <fo:inline xsl:use-attribute-sets="table-note-name-style"> - - - - - - + <xsl:if test="@type = 'source' or @type = 'abbreviation'"> - <xsl:attribute name="font-size">9pt</xsl:attribute> + <xsl:attribute name="font-size">9pt</xsl:attribute> </xsl:if> - - + <xsl:apply-templates select="*[local-name() = 'name']"/> - + </fo:inline> - - - + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - - </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2"> + + </xsl:template> <!-- table/note --> + + <xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2"> <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn"> - + </xsl:template> + + <!-- ===================== --> + <!-- Footnotes processing --> + <!-- ===================== --> + <!-- + <fn reference="1"> + <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p> + </fn> + --> + <!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures --> + <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn"> + <!-- list of footnotes to calculate actual footnotes number --> <xsl:variable name="p_fn_"> <xsl:call-template name="get_fn_list"/> </xsl:variable> <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/> - + <xsl:variable name="gen_id" select="generate-id(.)"/> <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/> <xsl:variable name="reference_"> <xsl:value-of select="@reference"/> <xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if> @@ -3559,19 +3357,17 @@ </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="current_fn_number_text"> <xsl:value-of select="$current_fn_number"/> - - + </xsl:variable> - + <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/> <xsl:variable name="footnote_inline"> <fo:inline xsl:use-attribute-sets="fn-num-style"> - - + <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <xsl:value-of select="$current_fn_number_text"/> </fo:basic-link> </fo:inline> </xsl:variable> @@ -3583,22 +3379,17 @@ </xsl:when> <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'"> <fo:footnote xsl:use-attribute-sets="fn-style"> <xsl:copy-of select="$footnote_inline"/> <fo:footnote-body> - + <fo:block-container xsl:use-attribute-sets="fn-container-body-style"> - + <fo:block xsl:use-attribute-sets="fn-body-style"> - - - + <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style"> - - - - + <xsl:value-of select="$current_fn_number_text"/> </fo:inline> <xsl:apply-templates/> </fo:block> </fo:block-container> @@ -3607,11 +3398,13 @@ </xsl:when> <xsl:otherwise> <xsl:copy-of select="$footnote_inline"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="get_fn_list"> + </xsl:template> <!-- fn in text --> + + <xsl:template name="get_fn_list"> <xsl:choose> <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already --> <fn gen_id="{generate-id(.)}"> <xsl:copy-of select="@*"/> <xsl:copy-of select="node()"/> @@ -3639,76 +3432,79 @@ </fn> </xsl:for-each> </xsl:for-each> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="table_fn_display"> + </xsl:template> + + <!-- ============================ --> + <!-- table's footnotes rendering --> + <!-- ============================ --> + <xsl:template name="table_fn_display"> <xsl:variable name="references"> - + <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']"> <xsl:call-template name="create_fn"/> </xsl:for-each> </xsl:variable> - + <xsl:for-each select="xalan:nodeset($references)//fn"> <xsl:variable name="reference" select="@reference"/> <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note--> <fo:block xsl:use-attribute-sets="table-fn-style"> - - - + <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style"> - - - - - + <xsl:value-of select="@reference"/> - - - - - - - + </fo:inline> <fo:inline xsl:use-attribute-sets="table-fn-body-style"> <xsl:copy-of select="./node()"/> </fo:inline> </fo:block> </xsl:if> </xsl:for-each> - </xsl:template><xsl:template name="create_fn"> + </xsl:template> + + <xsl:template name="create_fn"> <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> - - + <xsl:apply-templates/> </fn> - </xsl:template><xsl:template name="table_name_fn_display"> + </xsl:template> + + <!-- footnotes for table's name rendering --> + <xsl:template name="table_name_fn_display"> <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']"> <xsl:variable name="reference" select="@reference"/> <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block> <fo:block margin-bottom="12pt"> <xsl:apply-templates/> </fo:block> </xsl:for-each> - </xsl:template><xsl:template name="fn_display_figure"> - + </xsl:template> + <!-- ============================ --> + <!-- EMD table's footnotes rendering --> + <!-- ============================ --> + + <!-- figure's footnotes rendering --> + <xsl:template name="fn_display_figure"> + <xsl:variable name="references"> <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]"> <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> <xsl:apply-templates/> </fn> </xsl:for-each> </xsl:variable> - + <xsl:if test="xalan:nodeset($references)//fn"> - + <xsl:variable name="key_iso"> - + </xsl:variable> - + <!-- current hierarchy is 'figure' element --> <xsl:variable name="following_dl_colwidths"> <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' --> <xsl:variable name="simple-table"> <!-- <xsl:variable name="doc_ns"> @@ -3722,44 +3518,44 @@ <xsl:otherwise> <xsl:value-of select="substring-before(name(/*), '-')"/> </xsl:otherwise> </xsl:choose> </xsl:variable> --> - + <xsl:for-each select="*[local-name() = 'dl'][1]"> <tbody> <xsl:apply-templates mode="dl"/> </tbody> </xsl:for-each> </xsl:variable> - + <xsl:call-template name="calculate-column-widths"> <xsl:with-param name="cols-count" select="2"/> <xsl:with-param name="table" select="$simple-table"/> </xsl:call-template> - + </xsl:if> </xsl:variable> - + <xsl:variable name="maxlength_dt"> <xsl:for-each select="*[local-name() = 'dl'][1]"> - <xsl:call-template name="getMaxLength_dt"/> + <xsl:call-template name="getMaxLength_dt"/> </xsl:for-each> </xsl:variable> <fo:block> <fo:table width="95%" table-layout="fixed"> <xsl:if test="normalize-space($key_iso) = 'true'"> <xsl:attribute name="font-size">10pt</xsl:attribute> - + </xsl:if> <xsl:choose> <!-- if there 'dl', then set same columns width --> <xsl:when test="xalan:nodeset($following_dl_colwidths)//column"> <xsl:call-template name="setColumnWidth_dl"> - <xsl:with-param name="colwidths" select="$following_dl_colwidths"/> - <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/> + <xsl:with-param name="colwidths" select="$following_dl_colwidths"/> + <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <fo:table-column column-width="15%"/> <fo:table-column column-width="85%"/> @@ -3778,13 +3574,13 @@ </fo:block> </fo:table-cell> <fo:table-cell> <fo:block xsl:use-attribute-sets="figure-fn-body-style"> <xsl:if test="normalize-space($key_iso) = 'true'"> - + <xsl:attribute name="margin-bottom">0</xsl:attribute> - + </xsl:if> <xsl:copy-of select="./node()"/> </fo:block> </fo:table-cell> </fo:table-row> @@ -3792,161 +3588,151 @@ </xsl:for-each> </fo:table-body> </fo:table> </fo:block> </xsl:if> - - </xsl:template><xsl:template match="*[local-name()='fn']"> + + </xsl:template> <!-- fn_display_figure --> + + <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) --> + <xsl:template match="*[local-name()='fn']"> <fo:inline xsl:use-attribute-sets="fn-reference-style"> - - - - - + <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id--> - - + <xsl:value-of select="@reference"/> - - + </fo:basic-link> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']"> + </xsl:template> + + <xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']"> <fo:inline><xsl:value-of select="."/></fo:inline> - </xsl:template><xsl:template match="*[local-name()='fn']//*[local-name()='p']"> + </xsl:template> + + <xsl:template match="*[local-name()='fn']//*[local-name()='p']"> <fo:inline> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='dl']"> + </xsl:template> + <!-- ===================== --> + <!-- END Footnotes processing --> + <!-- ===================== --> + + <!-- ===================== --> + <!-- Definition List --> + <!-- ===================== --> + <xsl:template match="*[local-name()='dl']"> <xsl:variable name="isAdded" select="@added"/> <xsl:variable name="isDeleted" select="@deleted"/> <fo:block-container> - + <xsl:if test="not(ancestor::*[local-name() = 'quote'])"> <xsl:attribute name="margin-left">0mm</xsl:attribute> </xsl:if> - - + <xsl:if test="parent::*[local-name() = 'note']"> <xsl:attribute name="margin-left"> <xsl:choose> <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when> <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise> </xsl:choose> </xsl:attribute> - + </xsl:if> - + <xsl:call-template name="setTrackChangesStyles"> <xsl:with-param name="isAdded" select="$isAdded"/> <xsl:with-param name="isDeleted" select="$isDeleted"/> </xsl:call-template> - + <fo:block-container margin-left="0mm"> - - + <xsl:attribute name="margin-right">0mm</xsl:attribute> - - + <xsl:variable name="parent" select="local-name(..)"/> - + <xsl:variable name="key_iso"> <!-- and (not(../@class) or ../@class !='pseudocode') --> </xsl:variable> - + <xsl:variable name="onlyOneComponent" select="normalize-space($parent = 'formula' and count(*[local-name()='dt']) = 1)"/> - + <xsl:choose> <xsl:when test="$onlyOneComponent = 'true'"> <!-- only one component --> - + <fo:block margin-bottom="12pt" text-align="left"> - + <xsl:variable name="title-where"> <xsl:call-template name="getLocalizedString"> <xsl:with-param name="key">where</xsl:with-param> </xsl:call-template> </xsl:variable> <xsl:value-of select="$title-where"/><xsl:text> </xsl:text> <xsl:apply-templates select="*[local-name()='dt']/*"/> <xsl:text/> <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/> </fo:block> - + </xsl:when> <!-- END: only one component --> <xsl:when test="$parent = 'formula'"> <!-- a few components --> <fo:block margin-bottom="12pt" text-align="left"> - - - - + <xsl:variable name="title-where"> <xsl:call-template name="getLocalizedString"> <xsl:with-param name="key">where</xsl:with-param> </xsl:call-template> </xsl:variable> <xsl:value-of select="$title-where"/> </fo:block> </xsl:when> <!-- END: a few components --> <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure --> <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always"> - - - - + <xsl:variable name="title-key"> <xsl:call-template name="getLocalizedString"> <xsl:with-param name="key">key</xsl:with-param> </xsl:call-template> </xsl:variable> <xsl:value-of select="$title-key"/> </fo:block> </xsl:when> <!-- END: definition list in a figure --> </xsl:choose> - + <!-- a few components --> <xsl:if test="$onlyOneComponent = 'false'"> <fo:block> - - - - - + <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']"> <xsl:attribute name="margin-top">0</xsl:attribute> </xsl:if> - + <fo:block> - - - - + <xsl:apply-templates select="*[local-name() = 'name']"> <xsl:with-param name="process">true</xsl:with-param> </xsl:apply-templates> - + <xsl:if test="$isGenerateTableIF = 'true'"> <!-- to determine start of table --> <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block> </xsl:if> - + <fo:table width="95%" table-layout="fixed"> - + <xsl:if test="$isGenerateTableIF = 'true'"> <xsl:attribute name="wrap-option">no-wrap</xsl:attribute> </xsl:if> - - + <xsl:choose> <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/> <xsl:when test="normalize-space($key_iso) = 'true'"> <xsl:attribute name="font-size">10pt</xsl:attribute> - + </xsl:when> </xsl:choose> - - - + <xsl:choose> <xsl:when test="$isGenerateTableIF = 'true'"> <!-- generate IF for table widths --> <!-- example: <tr> @@ -3958,100 +3744,99 @@ <p>Description</p> <word id="tab-symdu_1_2_word_1">Description</word> </td> </tr> --> - + <!-- create virtual html table for dl/[dt and dd] --> <xsl:variable name="simple-table"> - + <xsl:variable name="dl_table"> <tbody> <xsl:apply-templates mode="dl_if"> <xsl:with-param name="id" select="@id"/> </xsl:apply-templates> </tbody> </xsl:variable> - + <!-- dl_table='<xsl:copy-of select="$dl_table"/>' --> - + <!-- Step: replace <br/> to <p>...</p> --> <xsl:variable name="table_without_br"> <xsl:apply-templates select="xalan:nodeset($dl_table)" mode="table-without-br"/> </xsl:variable> - + <!-- table_without_br='<xsl:copy-of select="$table_without_br"/>' --> - + <!-- Step: add id to each cell --> <!-- add <word>...</word> for each word, image, math --> <xsl:variable name="simple-table-id"> <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-id"> <xsl:with-param name="id" select="@id"/> </xsl:apply-templates> </xsl:variable> - + <!-- simple-table-id='<xsl:copy-of select="$simple-table-id"/>' --> - + <xsl:copy-of select="xalan:nodeset($simple-table-id)"/> - + </xsl:variable> - + <!-- DEBUG: simple-table<xsl:copy-of select="$simple-table"/> --> - + <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"> <xsl:with-param name="table_or_dl">dl</xsl:with-param> </xsl:apply-templates> - + </xsl:when> <xsl:otherwise> - + <xsl:variable name="simple-table"> - + <xsl:variable name="dl_table"> <tbody> <xsl:apply-templates mode="dl"> <xsl:with-param name="id" select="@id"/> </xsl:apply-templates> </tbody> </xsl:variable> - + <xsl:copy-of select="$dl_table"/> </xsl:variable> - + <xsl:variable name="colwidths"> <xsl:call-template name="calculate-column-widths"> <xsl:with-param name="cols-count" select="2"/> <xsl:with-param name="table" select="$simple-table"/> </xsl:call-template> </xsl:variable> - + <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text> DEBUG colwidths=<xsl:copy-of select="$colwidths"/> <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> --> - + <!-- colwidths=<xsl:copy-of select="$colwidths"/> --> - + <xsl:variable name="maxlength_dt"> - <xsl:call-template name="getMaxLength_dt"/> + <xsl:call-template name="getMaxLength_dt"/> </xsl:variable> - + <xsl:variable name="isContainsKeepTogetherTag_"> false </xsl:variable> <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/> <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> --> - - + <xsl:call-template name="setColumnWidth_dl"> - <xsl:with-param name="colwidths" select="$colwidths"/> + <xsl:with-param name="colwidths" select="$colwidths"/> <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/> <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/> </xsl:call-template> - + <fo:table-body> - + <!-- DEBUG --> <xsl:if test="$table_if_debug = 'true'"> <fo:table-row> <fo:table-cell number-columns-spanned="2" font-size="60%"> <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/> @@ -4061,39 +3846,43 @@ <xsl:apply-templates> <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/> <xsl:with-param name="split_keep-within-line" select="xalan:nodeset($colwidths)/split_keep-within-line"/> </xsl:apply-templates> - + </fo:table-body> </xsl:otherwise> </xsl:choose> </fo:table> </fo:block> </fo:block> </xsl:if> <!-- END: a few components --> </fo:block-container> </fo:block-container> - + <xsl:if test="$isGenerateTableIF = 'true'"> <!-- process nested 'dl' --> <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/> </xsl:if> - - </xsl:template><xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']"> + + </xsl:template> <!-- END: dl --> + + <xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']"> <xsl:param name="process">false</xsl:param> <xsl:if test="$process = 'true'"> <fo:block xsl:use-attribute-sets="dl-name-style"> <xsl:apply-templates/> </fo:block> </xsl:if> - </xsl:template><xsl:template name="setColumnWidth_dl"> - <xsl:param name="colwidths"/> + </xsl:template> + + <xsl:template name="setColumnWidth_dl"> + <xsl:param name="colwidths"/> <xsl:param name="maxlength_dt"/> <xsl:param name="isContainsKeepTogetherTag"/> - + <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> --> - + <xsl:choose> <xsl:when test="xalan:nodeset($colwidths)/autolayout"> <xsl:call-template name="insertTableColumnWidth"> <xsl:with-param name="colwidths" select="$colwidths"/> </xsl:call-template> @@ -4149,13 +3938,15 @@ </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="insertTableColumnWidth"> + </xsl:template> + + <xsl:template name="insertTableColumnWidth"> <xsl:param name="colwidths"/> - + <xsl:for-each select="xalan:nodeset($colwidths)//column"> <xsl:choose> <xsl:when test=". = 1 or . = 0"> <fo:table-column column-width="proportional-column-width(2)"/> </xsl:when> @@ -4167,11 +3958,13 @@ </xsl:variable> <fo:table-column column-width="proportional-column-width({round(. div $divider)})"/> </xsl:otherwise> </xsl:choose> </xsl:for-each> - </xsl:template><xsl:template name="getMaxLength_dt"> + </xsl:template> + + <xsl:template name="getMaxLength_dt"> <xsl:variable name="lengths"> <xsl:for-each select="*[local-name()='dt']"> <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/> <xsl:variable name="attributes"> <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each> @@ -4188,11 +3981,15 @@ </xsl:if> </xsl:for-each> </xsl:variable> <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> --> <xsl:value-of select="$maxLength"/> - </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2"> + </xsl:template> + + <!-- note in definition list: dl/note --> + <!-- renders in the 2-column spanned table row --> + <xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2"> <xsl:param name="key_iso"/> <!-- <tr> <td>NOTE</td> <td> <xsl:apply-templates /> @@ -4224,11 +4021,14 @@ <fo:block> <xsl:call-template name="note"/> </fo:block> </fo:table-cell> </fo:table-row> - </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl"> + </xsl:template> <!-- END: dl/note --> + + <!-- virtual html table for dl/[dt and dd] --> + <xsl:template match="*[local-name()='dt']" mode="dl"> <xsl:param name="id"/> <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/> <tr> <td> <xsl:attribute name="id"> @@ -4238,22 +4038,25 @@ </td> <td> <xsl:attribute name="id"> <xsl:value-of select="concat($id,'_',$row_number,'_2')"/> </xsl:attribute> - + <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]"> <xsl:with-param name="process">true</xsl:with-param> </xsl:apply-templates> - + </td> </tr> - - </xsl:template><xsl:template match="*[local-name()='dt']"> + + </xsl:template> + + <!-- Definition's term --> + <xsl:template match="*[local-name()='dt']"> <xsl:param name="key_iso"/> <xsl:param name="split_keep-within-line"/> - + <fo:table-row xsl:use-attribute-sets="dt-row-style"> <xsl:call-template name="insert_dt_cell"> <xsl:with-param name="key_iso" select="$key_iso"/> <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/> </xsl:call-template> @@ -4261,55 +4064,54 @@ <xsl:call-template name="insert_dd_cell"> <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/> </xsl:call-template> </xsl:for-each> </fo:table-row> - </xsl:template><xsl:template name="insert_dt_cell"> + </xsl:template> <!-- END: dt --> + + <xsl:template name="insert_dt_cell"> <xsl:param name="key_iso"/> <xsl:param name="split_keep-within-line"/> <fo:table-cell xsl:use-attribute-sets="dt-cell-style"> - + <xsl:if test="$isGenerateTableIF = 'true'"> <!-- border is mandatory, to calculate real width --> <xsl:attribute name="border">0.1pt solid black</xsl:attribute> <xsl:attribute name="text-align">left</xsl:attribute> </xsl:if> - - + <fo:block xsl:use-attribute-sets="dt-block-style"> <xsl:copy-of select="@id"/> - + <xsl:if test="normalize-space($key_iso) = 'true'"> <xsl:attribute name="margin-top">0</xsl:attribute> </xsl:if> - - - + <xsl:apply-templates> <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/> </xsl:apply-templates> - + <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> --> - + </fo:block> </fo:table-cell> - </xsl:template><xsl:template name="insert_dd_cell"> + </xsl:template> <!-- insert_dt_cell --> + + <xsl:template name="insert_dd_cell"> <xsl:param name="split_keep-within-line"/> <fo:table-cell xsl:use-attribute-sets="dd-cell-style"> - + <xsl:if test="$isGenerateTableIF = 'true'"> <!-- border is mandatory, to calculate real width --> <xsl:attribute name="border">0.1pt solid black</xsl:attribute> </xsl:if> - + <fo:block> - + <xsl:if test="$isGenerateTableIF = 'true'"> <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute> </xsl:if> - - <xsl:choose> <xsl:when test="$isGenerateTableIF = 'true'"> <xsl:apply-templates> <!-- following-sibling::*[local-name()='dd'][1] --> <xsl:with-param name="process">true</xsl:with-param> @@ -4319,100 +4121,120 @@ <xsl:apply-templates select="."> <!-- following-sibling::*[local-name()='dd'][1] --> <xsl:with-param name="process">true</xsl:with-param> <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/> </xsl:apply-templates> </xsl:otherwise> - + </xsl:choose> - + <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> --> - + </fo:block> </fo:table-cell> - </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process"> + </xsl:template> <!-- insert_dd_cell --> + + <!-- END Definition's term --> + + <xsl:template match="*[local-name()='dd']" mode="dl"/> + <xsl:template match="*[local-name()='dd']" mode="dl_process"> <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name()='dd']"> + </xsl:template> + + <xsl:template match="*[local-name()='dd']"> <xsl:param name="process">false</xsl:param> <xsl:param name="split_keep-within-line"/> <xsl:if test="$process = 'true'"> <xsl:apply-templates select="@language"/> <xsl:apply-templates> <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/> </xsl:apply-templates> </xsl:if> - </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline"> + </xsl:template> + + <xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline"> <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline> - </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl_if"> + </xsl:template> + + <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) --> + <xsl:template match="*[local-name()='dt']" mode="dl_if"> <xsl:param name="id"/> <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/> <tr> <td> <xsl:copy-of select="node()"/> </td> <td> - + <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/> - + <!-- get paragraphs from nested 'dl' --> <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/> - - + </td> </tr> - - </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='dl']" mode="dl_if_nested"> + + </xsl:template> + <xsl:template match="*[local-name()='dd']" mode="dl_if"/> + + <xsl:template match="*[local-name()='dl']" mode="dl_if_nested"> <xsl:for-each select="*[local-name() = 'dt']"> <p> <xsl:copy-of select="node()"/> <xsl:text> </xsl:text> <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'p']/node()"/> </p> </xsl:for-each> - </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/><xsl:template match="*[local-name()='em']"> + </xsl:template> + <xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/> + <!-- ===================== --> + <!-- END Definition List --> + <!-- ===================== --> + + <!-- ========================= --> + <!-- Rich text formatting --> + <!-- ========================= --> + <xsl:template match="*[local-name()='em']"> <fo:inline font-style="italic"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']"> + </xsl:template> + + <xsl:template match="*[local-name()='strong'] | *[local-name()='b']"> <xsl:param name="split_keep-within-line"/> <fo:inline font-weight="bold"> - + <xsl:apply-templates> <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/> </xsl:apply-templates> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='padding']"> + </xsl:template> + + <xsl:template match="*[local-name()='padding']"> <fo:inline padding-right="{@value}"> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='sup']"> + </xsl:template> + + <xsl:template match="*[local-name()='sup']"> <fo:inline font-size="80%" vertical-align="super"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='sub']"> + </xsl:template> + + <xsl:template match="*[local-name()='sub']"> <fo:inline font-size="80%" vertical-align="sub"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='tt']"> + </xsl:template> + + <xsl:template match="*[local-name()='tt']"> <fo:inline xsl:use-attribute-sets="tt-style"> - + <xsl:variable name="_font-size"> - - - - - + <!-- 10 --> - - - - - - - - - - + </xsl:variable> - <xsl:variable name="font-size" select="normalize-space($_font-size)"/> + <xsl:variable name="font-size" select="normalize-space($_font-size)"/> <xsl:if test="$font-size != ''"> <xsl:attribute name="font-size"> <xsl:choose> <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when> <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when> @@ -4421,17 +4243,26 @@ </xsl:choose> </xsl:attribute> </xsl:if> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='tt']/text()" priority="2"> + </xsl:template> <!-- tt --> + + <xsl:template match="*[local-name()='tt']/text()" priority="2"> <xsl:call-template name="add_spaces_to_sourcecode"/> - </xsl:template><xsl:template match="*[local-name()='underline']"> + </xsl:template> + + <xsl:template match="*[local-name()='underline']"> <fo:inline text-decoration="underline"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='add']" name="tag_add"> + </xsl:template> + + <!-- ================= --> + <!-- Added,deleted text --> + <!-- ================= --> + <xsl:template match="*[local-name()='add']" name="tag_add"> <xsl:param name="skip">true</xsl:param> <xsl:param name="block">false</xsl:param> <xsl:param name="type"/> <xsl:param name="text-align"/> <xsl:choose> @@ -4452,11 +4283,11 @@ </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="$block = 'false'"> <fo:inline> - <xsl:copy-of select="$tag"/> + <xsl:copy-of select="$tag"/> </fo:inline> </xsl:when> <xsl:otherwise> <fo:block> <!-- for around figures --> <xsl:if test="$text-align != ''"> @@ -4464,11 +4295,11 @@ </xsl:if> <xsl:copy-of select="$tag"/> </fo:block> </xsl:otherwise> </xsl:choose> - + </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when test="@amendment"> <fo:inline> @@ -4502,11 +4333,13 @@ <fo:inline xsl:use-attribute-sets="add-style"> <xsl:apply-templates/> </fo:inline> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="insertTag"> + </xsl:template> <!-- add --> + + <xsl:template name="insertTag"> <xsl:param name="type"/> <xsl:param name="kind"/> <xsl:param name="value"/> <xsl:variable name="add_width" select="string-length($value) * 20"/> <xsl:variable name="maxwidth" select="60 + $add_width"/> @@ -4529,28 +4362,40 @@ </xsl:if> <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan> </text> </svg> </fo:instream-foreign-object> - </xsl:template><xsl:template match="*[local-name()='del']"> + </xsl:template> + + <xsl:template match="*[local-name()='del']"> <fo:inline xsl:use-attribute-sets="del-style"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='hi']"> + </xsl:template> + <!-- ================= --> + <!-- END Added,deleted text --> + <!-- ================= --> + + <!-- highlight text --> + <xsl:template match="*[local-name()='hi']"> <fo:inline background-color="yellow"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]"> + </xsl:template> + + <xsl:template match="text()[ancestor::*[local-name()='smallcap']]"> <xsl:variable name="text" select="normalize-space(.)"/> <fo:inline font-size="75%"> <xsl:if test="string-length($text) &gt; 0"> <xsl:call-template name="recursiveSmallCaps"> <xsl:with-param name="text" select="$text"/> </xsl:call-template> </xsl:if> - </fo:inline> - </xsl:template><xsl:template name="recursiveSmallCaps"> + </fo:inline> + </xsl:template> + + <xsl:template name="recursiveSmallCaps"> <xsl:param name="text"/> <xsl:variable name="char" select="substring($text,1,1)"/> <!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> --> <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/> <xsl:choose> @@ -4566,21 +4411,68 @@ <xsl:if test="string-length($text) &gt; 1"> <xsl:call-template name="recursiveSmallCaps"> <xsl:with-param name="text" select="substring($text,2)"/> </xsl:call-template> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'pagebreak']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'pagebreak']"> <fo:block break-after="page"/> <fo:block> </fo:block> <fo:block break-after="page"/> - </xsl:template><xsl:template match="*[local-name() = 'span']"> + </xsl:template> + + <!-- Example: <span style="font-family:&quot;Noto Sans JP&quot;">styled text</span> --> + <xsl:template match="*[local-name() = 'span'][@style]" priority="2"> + <xsl:variable name="styles__"> + <xsl:call-template name="split"> + <xsl:with-param name="pText" select="concat(@style,';')"/> + <xsl:with-param name="sep" select="';'"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="quot">"</xsl:variable> + <xsl:variable name="styles_"> + <xsl:for-each select="xalan:nodeset($styles__)/item"> + <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/> + <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/> + <xsl:if test="$key = 'font-family' or $key = 'color'"> + <style name="{$key}"><xsl:value-of select="$value"/></style> + </xsl:if> + </xsl:for-each> + </xsl:variable> + <xsl:variable name="styles" select="xalan:nodeset($styles_)"/> + <xsl:choose> + <xsl:when test="$styles/style"> + <fo:inline> + <xsl:for-each select="$styles/style"> + <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute> + </xsl:for-each> + <xsl:apply-templates/> + </fo:inline> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> <!-- END: span[@style] --> + + <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output --> + <xsl:template match="*[local-name() = 'span']"> <xsl:apply-templates/> - </xsl:template><xsl:template name="tokenize"> + </xsl:template> + + <!-- ========================= --> + <!-- END Rich text formatting --> + <!-- ========================= --> + + <!-- split string 'text' by 'separator' --> + <xsl:template name="tokenize"> <xsl:param name="text"/> <xsl:param name="separator" select="' '"/> <xsl:choose> - + <xsl:when test="$isGenerateTableIF = 'true' and not(contains($text, $separator))"> <word><xsl:value-of select="normalize-space($text)"/></word> </xsl:when> <xsl:when test="not(contains($text, $separator))"> <word> @@ -4599,12 +4491,12 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="$len_str_tmp"/> </xsl:otherwise> </xsl:choose> - </xsl:variable> - + </xsl:variable> + <!-- <xsl:if test="$len_str_no_en_chars div $len_str &gt; 0.8"> <xsl:message> div=<xsl:value-of select="$len_str_no_en_chars div $len_str"/> len_str=<xsl:value-of select="$len_str"/> len_str_no_en_chars=<xsl:value-of select="$len_str_no_en_chars"/> @@ -4639,16 +4531,19 @@ <xsl:call-template name="tokenize"> <xsl:with-param name="text" select="substring-after($text, $separator)"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="tokenize_with_tags"> + </xsl:template> + + <!-- split string 'text' by 'separator', enclosing in formatting tags --> + <xsl:template name="tokenize_with_tags"> <xsl:param name="tags"/> <xsl:param name="text"/> <xsl:param name="separator" select="' '"/> <xsl:choose> - + <xsl:when test="not(contains($text, $separator))"> <word> <xsl:call-template name="enclose_text_in_tags"> <xsl:with-param name="text" select="normalize-space($text)"/> <xsl:with-param name="tags" select="$tags"/> @@ -4665,17 +4560,19 @@ <xsl:call-template name="tokenize_with_tags"> <xsl:with-param name="text" select="substring-after($text, $separator)"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="enclose_text_in_tags"> + </xsl:template> + + <xsl:template name="enclose_text_in_tags"> <xsl:param name="text"/> <xsl:param name="tags"/> <xsl:param name="num">1</xsl:param> <!-- default (start) value --> - + <xsl:variable name="tag_name" select="normalize-space(xalan:nodeset($tags)//tag[$num])"/> - + <xsl:choose> <xsl:when test="$tag_name = ''"><xsl:value-of select="$text"/></xsl:when> <xsl:otherwise> <xsl:element name="{$tag_name}"> <xsl:call-template name="enclose_text_in_tags"> @@ -4684,27 +4581,37 @@ <xsl:with-param name="num" select="$num + 1"/> </xsl:call-template> </xsl:element> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="max_length"> + </xsl:template> + + <!-- get max value in array --> + <xsl:template name="max_length"> <xsl:param name="words"/> <xsl:for-each select="$words//word"> <xsl:sort select="." data-type="number" order="descending"/> <xsl:if test="position()=1"> <xsl:value-of select="."/> </xsl:if> </xsl:for-each> - </xsl:template><xsl:template name="add-zero-spaces-java"> + </xsl:template> + + <xsl:template name="add-zero-spaces-java"> <xsl:param name="text" select="."/> <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space --> <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/> - </xsl:template><xsl:template name="add-zero-spaces-link-java"> + </xsl:template> + + <xsl:template name="add-zero-spaces-link-java"> <xsl:param name="text" select="."/> <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space --> <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/> - </xsl:template><xsl:template name="add-zero-spaces"> + </xsl:template> + + <!-- add zero space after dash character (for table's entries) --> + <xsl:template name="add-zero-spaces"> <xsl:param name="text" select="."/> <xsl:variable name="zero-space-after-chars">-</xsl:variable> <xsl:variable name="zero-space-after-dot">.</xsl:variable> <xsl:variable name="zero-space-after-colon">:</xsl:variable> <xsl:variable name="zero-space-after-equal">=</xsl:variable> @@ -4753,11 +4660,13 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="$text"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="add-zero-spaces-equal"> + </xsl:template> + + <xsl:template name="add-zero-spaces-equal"> <xsl:param name="text" select="."/> <xsl:variable name="zero-space-after-equals">==========</xsl:variable> <xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable> <xsl:variable name="zero-space-after-equal">=</xsl:variable> <xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable> @@ -4783,56 +4692,68 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="$text"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="getSimpleTable"> + </xsl:template> + + <!-- Table normalization (colspan,rowspan processing for adding TDs) for column width calculation --> + <xsl:template name="getSimpleTable"> <xsl:param name="id"/> - + <xsl:variable name="simple-table"> - + <!-- Step 0. replace <br/> to <p>...</p> --> <xsl:variable name="table_without_br"> <xsl:apply-templates mode="table-without-br"/> </xsl:variable> - + <!-- Step 1. colspan processing --> <xsl:variable name="simple-table-colspan"> <tbody> <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-colspan"/> </tbody> </xsl:variable> - + <!-- Step 2. rowspan processing --> <xsl:variable name="simple-table-rowspan"> <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/> </xsl:variable> - + <!-- Step 3: add id to each cell --> <!-- add <word>...</word> for each word, image, math --> <xsl:variable name="simple-table-id"> <xsl:apply-templates select="xalan:nodeset($simple-table-rowspan)" mode="simple-table-id"> <xsl:with-param name="id" select="$id"/> </xsl:apply-templates> </xsl:variable> - + <xsl:copy-of select="xalan:nodeset($simple-table-id)"/> </xsl:variable> <xsl:copy-of select="$simple-table"/> - </xsl:template><xsl:template match="@*|node()" mode="table-without-br"> + </xsl:template> + + <!-- ================================== --> + <!-- Step 0. replace <br/> to <p>...</p> --> + <!-- ================================== --> + <xsl:template match="@*|node()" mode="table-without-br"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="table-without-br"/> </xsl:copy> - </xsl:template><xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br"> + </xsl:template> + + <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br"> <xsl:copy> <xsl:copy-of select="@*"/> <p> <xsl:copy-of select="node()"/> </p> </xsl:copy> - </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td'][*[local-name()='br']]" mode="table-without-br"> + </xsl:template> + + <xsl:template match="*[local-name()='th' or local-name()='td'][*[local-name()='br']]" mode="table-without-br"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:for-each select="*[local-name()='br']"> <xsl:variable name="current_id" select="generate-id()"/> <p> @@ -4847,11 +4768,13 @@ </xsl:for-each> </p> </xsl:if> </xsl:for-each> </xsl:copy> - </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p'][*[local-name()='br']]" mode="table-without-br"> + </xsl:template> + + <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p'][*[local-name()='br']]" mode="table-without-br"> <xsl:for-each select="*[local-name()='br']"> <xsl:variable name="current_id" select="generate-id()"/> <p> <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]"> <xsl:copy-of select="."/> @@ -4863,16 +4786,39 @@ <xsl:copy-of select="."/> </xsl:for-each> </p> </xsl:if> </xsl:for-each> - </xsl:template><xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br"> + </xsl:template> + + <!-- remove redundant white spaces --> + <xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br"> <xsl:variable name="text" select="translate(.,'&#9;&#10;&#13;','')"/> <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/> - </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan"> + </xsl:template> + + <!-- mode="table-without-br" --> + <!-- ================================== --> + <!-- END: Step 0. replace <br/> to <p>...</p> --> + <!-- ================================== --> + + <!-- ===================== --> + <!-- 1. mode "simple-table-colspan" + 1.1. remove thead, tbody, fn + 1.2. rename th -> td + 1.3. repeating N td with colspan=N + 1.4. remove namespace + 1.5. remove @colspan attribute + 1.6. add @divide attribute for divide text width in further processing + --> + <!-- ===================== --> + <xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan"> <xsl:apply-templates mode="simple-table-colspan"/> - </xsl:template><xsl:template match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan"> + </xsl:template> + <xsl:template match="*[local-name()='fn']" mode="simple-table-colspan"/> + + <xsl:template match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan"> <xsl:choose> <xsl:when test="@colspan"> <xsl:variable name="td"> <xsl:element name="td"> <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute> @@ -4890,45 +4836,67 @@ <xsl:apply-templates select="@*" mode="simple-table-colspan"/> <xsl:apply-templates mode="simple-table-colspan"/> </xsl:element> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="@colspan" mode="simple-table-colspan"/><xsl:template match="*[local-name()='tr']" mode="simple-table-colspan"> + </xsl:template> + + <xsl:template match="@colspan" mode="simple-table-colspan"/> + + <xsl:template match="*[local-name()='tr']" mode="simple-table-colspan"> <xsl:element name="tr"> <xsl:apply-templates select="@*" mode="simple-table-colspan"/> <xsl:apply-templates mode="simple-table-colspan"/> </xsl:element> - </xsl:template><xsl:template match="@*|node()" mode="simple-table-colspan"> + </xsl:template> + + <xsl:template match="@*|node()" mode="simple-table-colspan"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/> </xsl:copy> - </xsl:template><xsl:template name="repeatNode"> + </xsl:template> + + <!-- repeat node 'count' times --> + <xsl:template name="repeatNode"> <xsl:param name="count"/> <xsl:param name="node"/> - + <xsl:if test="$count &gt; 0"> <xsl:call-template name="repeatNode"> <xsl:with-param name="count" select="$count - 1"/> <xsl:with-param name="node" select="$node"/> </xsl:call-template> <xsl:copy-of select="$node"/> </xsl:if> - </xsl:template><xsl:template match="@*|node()" mode="simple-table-rowspan"> + </xsl:template> + <!-- End mode simple-table-colspan --> + <!-- ===================== --> + <!-- ===================== --> + + <!-- ===================== --> + <!-- 2. mode "simple-table-rowspan" + Row span processing, more information http://andrewjwelch.com/code/xslt/table/table-normalization.html --> + <!-- ===================== --> + <xsl:template match="@*|node()" mode="simple-table-rowspan"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/> </xsl:copy> - </xsl:template><xsl:template match="tbody" mode="simple-table-rowspan"> + </xsl:template> + + <xsl:template match="tbody" mode="simple-table-rowspan"> <xsl:copy> <xsl:copy-of select="tr[1]"/> <xsl:apply-templates select="tr[2]" mode="simple-table-rowspan"> <xsl:with-param name="previousRow" select="tr[1]"/> </xsl:apply-templates> </xsl:copy> - </xsl:template><xsl:template match="tr" mode="simple-table-rowspan"> + </xsl:template> + + <xsl:template match="tr" mode="simple-table-rowspan"> <xsl:param name="previousRow"/> <xsl:variable name="currentRow" select="."/> - + <xsl:variable name="normalizedTDs"> <xsl:for-each select="xalan:nodeset($previousRow)//td"> <xsl:choose> <xsl:when test="@rowspan &gt; 1"> <xsl:copy> @@ -4955,76 +4923,85 @@ <xsl:copy-of select="$newRow"/> <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan"> <xsl:with-param name="previousRow" select="$newRow"/> </xsl:apply-templates> - </xsl:template><xsl:template match="/" mode="simple-table-id"> + </xsl:template> + <!-- End mode simple-table-rowspan --> + + <!-- Step 3: add id for each cell --> + <!-- mode: simple-table-id --> + <xsl:template match="/" mode="simple-table-id"> <xsl:param name="id"/> <xsl:variable name="id_prefixed" select="concat('table_if_',$id)"/> <!-- table id prefixed by 'table_if_' to simple search in IF --> <xsl:apply-templates select="@*|node()" mode="simple-table-id"> <xsl:with-param name="id" select="$id_prefixed"/> </xsl:apply-templates> - </xsl:template><xsl:template match="@*|node()" mode="simple-table-id"> + </xsl:template> + <xsl:template match="@*|node()" mode="simple-table-id"> <xsl:param name="id"/> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="simple-table-id"> <xsl:with-param name="id" select="$id"/> </xsl:apply-templates> </xsl:copy> - </xsl:template><xsl:template match="*[local-name()='tbody']" mode="simple-table-id"> + </xsl:template> + + <xsl:template match="*[local-name()='tbody']" mode="simple-table-id"> <xsl:param name="id"/> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute> <xsl:apply-templates select="node()" mode="simple-table-id"> <xsl:with-param name="id" select="$id"/> </xsl:apply-templates> </xsl:copy> - </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id"> + </xsl:template> + + <xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id"> <xsl:param name="id"/> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/> <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/> <xsl:attribute name="id"> <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/> </xsl:attribute> - + <xsl:for-each select="*[local-name() = 'p']"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/> <xsl:attribute name="id"> <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/> </xsl:attribute> - + <xsl:copy-of select="node()"/> </xsl:copy> </xsl:for-each> - - + <xsl:if test="$isGenerateTableIF = 'true'"> <!-- split each paragraph to words, image, math --> - + <xsl:variable name="td_text"> <xsl:apply-templates select="." mode="td_text_with_formatting"/> </xsl:variable> - + <!-- td_text='<xsl:copy-of select="$td_text"/>' --> - + <xsl:variable name="words"> <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']"> <word> <xsl:copy-of select="."/> </word> </xsl:for-each> - + <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']"> <xsl:copy-of select="."/> </xsl:for-each> - + </xsl:variable> - + <xsl:for-each select="xalan:nodeset($words)/word"> <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/> <xsl:copy> <xsl:attribute name="id"> <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/> @@ -5032,54 +5009,75 @@ <xsl:copy-of select="node()"/> </xsl:copy> </xsl:for-each> </xsl:if> </xsl:copy> - - </xsl:template><xsl:template match="@*|node()" mode="td_text_with_formatting"> + + </xsl:template> + <!-- End mode: simple-table-id --> + <!-- ===================== --> + <!-- ===================== --> + + <!-- =============================== --> + <!-- mode="td_text_with_formatting" --> + <!-- =============================== --> + <xsl:template match="@*|node()" mode="td_text_with_formatting"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'stem' or local-name() = 'image']" mode="td_text_with_formatting"/><xsl:template match="*[local-name() = 'keep-together_within-line']/text()" mode="td_text_with_formatting"> + </xsl:template> + + <xsl:template match="*[local-name() = 'stem' or local-name() = 'image']" mode="td_text_with_formatting"/> + + <xsl:template match="*[local-name() = 'keep-together_within-line']/text()" mode="td_text_with_formatting"> <xsl:variable name="formatting_tags"> <xsl:call-template name="getFormattingTags"/> </xsl:variable> <word> <xsl:call-template name="enclose_text_in_tags"> <xsl:with-param name="text" select="normalize-space(.)"/> <xsl:with-param name="tags" select="$formatting_tags"/> </xsl:call-template> </word> - </xsl:template><xsl:template match="*[local-name() != 'keep-together_within-line']/text()" mode="td_text_with_formatting"> - + </xsl:template> + + <xsl:template match="*[local-name() != 'keep-together_within-line']/text()" mode="td_text_with_formatting"> + <xsl:variable name="td_text" select="."/> - + <xsl:variable name="string_with_added_zerospaces"> <xsl:call-template name="add-zero-spaces-java"> <xsl:with-param name="text" select="$td_text"/> </xsl:call-template> </xsl:variable> - + <xsl:variable name="formatting_tags"> <xsl:call-template name="getFormattingTags"/> </xsl:variable> - + <!-- <word>text</word> --> <xsl:call-template name="tokenize_with_tags"> <xsl:with-param name="tags" select="$formatting_tags"/> <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space --> </xsl:call-template> - </xsl:template><xsl:template name="getFormattingTags"> + </xsl:template> + + <xsl:template name="getFormattingTags"> <tags> <xsl:if test="ancestor::*[local-name() = 'strong']"><tag>strong</tag></xsl:if> <xsl:if test="ancestor::*[local-name() = 'em']"><tag>em</tag></xsl:if> <xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if> <xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if> <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if> <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if> </tags> - </xsl:template><xsl:template name="getLang"> + </xsl:template> + <!-- =============================== --> + <!-- END mode="td_text_with_formatting" --> + <!-- =============================== --> + + <xsl:template name="getLang"> <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/> <xsl:variable name="language"> <xsl:choose> <xsl:when test="$language_current != ''"> <xsl:value-of select="$language_current"/> @@ -5095,16 +5093,18 @@ </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:choose> <xsl:when test="$language = 'English'">en</xsl:when> <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="capitalizeWords"> + </xsl:template> + + <xsl:template name="capitalizeWords"> <xsl:param name="str"/> <xsl:variable name="str2" select="translate($str, '-', ' ')"/> <xsl:choose> <xsl:when test="contains($str2, ' ')"> <xsl:variable name="substr" select="substring-before($str2, ' ')"/> @@ -5120,104 +5120,102 @@ <xsl:call-template name="capitalize"> <xsl:with-param name="str" select="$str2"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="capitalize"> + </xsl:template> + + <xsl:template name="capitalize"> <xsl:param name="str"/> <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/> - <xsl:value-of select="substring($str, 2)"/> - </xsl:template><xsl:template match="mathml:math"> + <xsl:value-of select="substring($str, 2)"/> + </xsl:template> + + <xsl:template match="mathml:math"> <xsl:variable name="isAdded" select="@added"/> <xsl:variable name="isDeleted" select="@deleted"/> - + <fo:inline xsl:use-attribute-sets="mathml-style"> - - - - - + <xsl:call-template name="setTrackChangesStyles"> <xsl:with-param name="isAdded" select="$isAdded"/> <xsl:with-param name="isDeleted" select="$isDeleted"/> </xsl:call-template> - + <xsl:if test="$add_math_as_text = 'true'"> <!-- insert helper tag --> <!-- set unique font-size (fiction) --> <xsl:variable name="font-size_sfx"><xsl:number level="any"/></xsl:variable> <fo:inline color="white" font-size="1.{$font-size_sfx}pt" font-style="normal" font-weight="normal"><xsl:value-of select="$zero_width_space"/></fo:inline> <!-- zero width space --> </xsl:if> - + <xsl:variable name="mathml_content"> <xsl:apply-templates select="." mode="mathml_actual_text"/> </xsl:variable> - - + <xsl:call-template name="mathml_instream_object"> <xsl:with-param name="mathml_content" select="$mathml_content"/> </xsl:call-template> - - + </fo:inline> - </xsl:template><xsl:template name="getMathml_comment_text"> + </xsl:template> + + <xsl:template name="getMathml_comment_text"> <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/> <xsl:variable name="comment_text_"> <xsl:choose> <xsl:when test="normalize-space($comment_text_following) != ''"> <xsl:value-of select="$comment_text_following"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/> </xsl:otherwise> </xsl:choose> - </xsl:variable> + </xsl:variable> <xsl:variable name="comment_text_2" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/> <xsl:variable name="comment_text" select="java:trim(java:java.lang.String.new($comment_text_2))"/> <xsl:value-of select="$comment_text"/> - </xsl:template><xsl:template name="mathml_instream_object"> + </xsl:template> + + <xsl:template name="mathml_instream_object"> <xsl:param name="comment_text"/> <xsl:param name="mathml_content"/> - + <xsl:variable name="comment_text_"> <xsl:choose> <xsl:when test="normalize-space($comment_text) != ''"><xsl:value-of select="$comment_text"/></xsl:when> <xsl:otherwise><xsl:call-template name="getMathml_comment_text"/></xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="mathml"> <xsl:apply-templates select="." mode="mathml"/> </xsl:variable> - + <fo:instream-foreign-object fox:alt-text="Math"> - - - - - - - + <!-- put MathML in Actual Text --> <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> --> <xsl:attribute name="fox:actual-text"> <xsl:value-of select="$mathml_content"/> </xsl:attribute> - + <!-- <xsl:if test="$add_math_as_text = 'true'"> --> <xsl:if test="normalize-space($comment_text_) != ''"> <!-- put Mathin Alternate Text --> <xsl:attribute name="fox:alt-text"> <xsl:value-of select="$comment_text_"/> </xsl:attribute> </xsl:if> <!-- </xsl:if> --> - + <xsl:copy-of select="xalan:nodeset($mathml)"/> - + </fo:instream-foreign-object> - </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text"> + </xsl:template> + + <xsl:template match="mathml:*" mode="mathml_actual_text"> <!-- <xsl:text>a+b</xsl:text> --> <xsl:text>&lt;</xsl:text> <xsl:value-of select="local-name()"/> <xsl:if test="local-name() = 'math'"> <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text> @@ -5227,29 +5225,62 @@ <xsl:value-of select="local-name()"/> <xsl:text>="</xsl:text> <xsl:value-of select="."/> <xsl:text>"</xsl:text> </xsl:for-each> - <xsl:text>&gt;</xsl:text> - <xsl:apply-templates mode="mathml_actual_text"/> + <xsl:text>&gt;</xsl:text> + <xsl:apply-templates mode="mathml_actual_text"/> <xsl:text>&lt;/</xsl:text> <xsl:value-of select="local-name()"/> <xsl:text>&gt;</xsl:text> - </xsl:template><xsl:template match="text()" mode="mathml_actual_text"> + </xsl:template> + + <xsl:template match="text()" mode="mathml_actual_text"> <xsl:value-of select="normalize-space()"/> - </xsl:template><xsl:template match="@*|node()" mode="mathml"> + </xsl:template> + + <xsl:template match="@*|node()" mode="mathml"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="mathml"/> </xsl:copy> - </xsl:template><xsl:template match="mathml:mtext" mode="mathml"> + </xsl:template> + + <xsl:template match="mathml:mtext" mode="mathml"> <xsl:copy> <!-- replace start and end spaces to non-break space --> <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/> </xsl:copy> - </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="mathml:mtd/mathml:mo/text()[. = '/']" mode="mathml"> + </xsl:template> + + <!-- <xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = '&#xa0;'])]" mode="mathml"> + <xsl:copy> + <xsl:apply-templates select="@*|node()" mode="mathml"/> + </xsl:copy> + <xsl:choose> + if in msub, then don't add space + <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"></xsl:when> + if next char in digit, don't add space + <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"></xsl:when> + <xsl:otherwise> + <mathml:mspace width="0.5ex"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> --> + + <xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/> + <xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/> + <xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/> + <xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/> + + <!-- patch: slash in the mtd wrong rendering --> + <xsl:template match="mathml:mtd/mathml:mo/text()[. = '/']" mode="mathml"> <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/> - </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link"> + </xsl:template> + + <xsl:template match="*[local-name()='localityStack']"/> + + <xsl:template match="*[local-name()='link']" name="link"> <xsl:variable name="target"> <xsl:choose> <xsl:when test="@updatetype = 'true'"> <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/> </xsl:when> @@ -5267,24 +5298,15 @@ <xsl:value-of select="normalize-space(@target)"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <fo:inline xsl:use-attribute-sets="link-style"> - + <xsl:if test="starts-with(normalize-space(@target), 'mailto:')"> <xsl:attribute name="keep-together.within-line">always</xsl:attribute> </xsl:if> - - - - - - - - - - + <xsl:choose> <xsl:when test="$target_text = ''"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> @@ -5302,100 +5324,130 @@ </xsl:choose> </fo:basic-link> </xsl:otherwise> </xsl:choose> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='appendix']"> + </xsl:template> <!-- link --> + + <!-- ======================== --> + <!-- Appendix processing --> + <!-- ======================== --> + <xsl:template match="*[local-name()='appendix']"> <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style"> <xsl:apply-templates select="*[local-name()='title']"/> </fo:block> <xsl:apply-templates select="node()[not(local-name()='title')]"/> - </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name()='appendix']/*[local-name()='title']" priority="2"> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline> - </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2"> - <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style"> + </xsl:template> + <!-- ======================== --> + <!-- END Appendix processing --> + <!-- ======================== --> + + <xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2"> + <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style"> <xsl:apply-templates select="*[local-name()='name']"/> </fo:block> <xsl:apply-templates select="node()[not(local-name()='name')]"/> - </xsl:template><xsl:template match="*[local-name() = 'callout']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'callout']"> <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link> - </xsl:template><xsl:template match="*[local-name() = 'annotation']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'annotation']"> <xsl:variable name="annotation-id" select="@id"/> - <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/> - <fo:block id="{$annotation-id}" white-space="nowrap"> - <fo:inline> + <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/> + <fo:block id="{$annotation-id}" white-space="nowrap"> + <fo:inline> <xsl:apply-templates> <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/> </xsl:apply-templates> </fo:inline> - </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']"> + </fo:block> + </xsl:template> + + <xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']"> <xsl:param name="callout"/> <fo:inline id="{@id}"> <!-- for first p in annotation, put <x> --> <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if> <xsl:apply-templates/> - </fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'xref']"> + </fo:inline> + </xsl:template> + + <xsl:template match="*[local-name() = 'xref']"> <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style"> <xsl:if test="parent::*[local-name() = 'add']"> <xsl:call-template name="append_add-style"/> </xsl:if> <xsl:apply-templates/> </fo:basic-link> - </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula"> + </xsl:template> + + <!-- ====== --> + <!-- formula --> + <!-- ====== --> + <xsl:template match="*[local-name() = 'formula']" name="formula"> <fo:block-container margin-left="0mm"> <xsl:if test="parent::*[local-name() = 'note']"> <xsl:attribute name="margin-left"> <xsl:choose> <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when> <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise> </xsl:choose> </xsl:attribute> - + </xsl:if> - <fo:block-container margin-left="0mm"> + <fo:block-container margin-left="0mm"> <fo:block id="{@id}"> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template --> </fo:block> </fo:block-container> </fo:block-container> - </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']"> <fo:inline> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']"> <fo:inline> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template --> + </xsl:template> + + <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template --> <xsl:if test="normalize-space() != ''"> <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'formula'][*[local-name() = 'name']]/*[local-name() = 'stem']"> + </xsl:template> + + <!-- stem inside formula with name (with formula's number) --> + <xsl:template match="*[local-name() = 'formula'][*[local-name() = 'name']]/*[local-name() = 'stem']"> <fo:block xsl:use-attribute-sets="formula-style"> - - - + <fo:table table-layout="fixed" width="100%"> <fo:table-column column-width="95%"/> <fo:table-column column-width="5%"/> <fo:table-body> <fo:table-row> <fo:table-cell display-align="center"> <fo:block xsl:use-attribute-sets="formula-stem-block-style"> - - + <xsl:if test="ancestor::*[local-name() ='annex']"> <xsl:attribute name="text-align">left</xsl:attribute> <xsl:attribute name="margin-left">7mm</xsl:attribute> </xsl:if> - - + <xsl:apply-templates/> </fo:block> </fo:table-cell> <fo:table-cell display-align="center"> <fo:block xsl:use-attribute-sets="formula-stem-number-style"> @@ -5404,236 +5456,247 @@ </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'formula'][not(*[local-name() = 'name'])]/*[local-name() = 'stem']"> + </xsl:template> + + <!-- stem inside formula without name (without formula's number) --> + <xsl:template match="*[local-name() = 'formula'][not(*[local-name() = 'name'])]/*[local-name() = 'stem']"> <fo:block xsl:use-attribute-sets="formula-style"> <fo:block xsl:use-attribute-sets="formula-stem-block-style"> <xsl:apply-templates/> </fo:block> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'note']" name="note"> - + </xsl:template> + + <!-- ====== --> + <!-- ====== --> + + <!-- ====== --> + <!-- note --> + <!-- termnote --> + <!-- ====== --> + + <xsl:template match="*[local-name() = 'note']" name="note"> + <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style"> - - - - - - - - - - - + <fo:block-container margin-left="0mm"> - - - - - - + <fo:block> - - - - - - + <xsl:attribute name="font-size">10pt</xsl:attribute> <xsl:attribute name="text-indent">0</xsl:attribute> - <xsl:attribute name="padding-top">1.5mm</xsl:attribute> + <xsl:attribute name="padding-top">1.5mm</xsl:attribute> <xsl:if test="../@type = 'source' or ../@type = 'abbreviation'"> <xsl:attribute name="font-size">9pt</xsl:attribute> <xsl:attribute name="text-align">justify</xsl:attribute> - <xsl:attribute name="padding-top">0mm</xsl:attribute> + <xsl:attribute name="padding-top">0mm</xsl:attribute> </xsl:if> - - + <fo:inline xsl:use-attribute-sets="note-name-style"> - - - + <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' --> <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> --> <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]"> <xsl:call-template name="append_add-style"/> </xsl:if> - - + <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name--> <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"> <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]"> <xsl:with-param name="skip">false</xsl:with-param> - </xsl:apply-templates> + </xsl:apply-templates> </xsl:if> - + <xsl:apply-templates select="*[local-name() = 'name']"/> - + </fo:inline> - + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - + </fo:block-container> </fo:block-container> - - </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']"> + + </xsl:template> + + <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']"> <xsl:variable name="num"><xsl:number/></xsl:variable> <xsl:choose> <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE --> <fo:inline xsl:use-attribute-sets="note-p-style"> <xsl:apply-templates/> </fo:inline> </xsl:when> <xsl:otherwise> - <fo:block xsl:use-attribute-sets="note-p-style"> + <fo:block xsl:use-attribute-sets="note-p-style"> <xsl:apply-templates/> </fo:block> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'termnote']"> - <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style"> - + </xsl:template> + + <xsl:template match="*[local-name() = 'termnote']"> + <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style"> + <fo:inline xsl:use-attribute-sets="termnote-name-style"> - + <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])"> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> - - - - <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' --> <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> --> <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]"> <xsl:call-template name="append_add-style"/> </xsl:if> - + <xsl:apply-templates select="*[local-name() = 'name']"/> - + </fo:inline> - + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']"> <xsl:param name="sfx"/> <xsl:variable name="suffix"> <xsl:choose> <xsl:when test="$sfx != ''"> - <xsl:value-of select="$sfx"/> + <xsl:value-of select="$sfx"/> </xsl:when> <xsl:otherwise> - - + <xsl:text>:</xsl:text> - - + </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="normalize-space() != ''"> <xsl:apply-templates/> <xsl:value-of select="$suffix"/> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']"> <xsl:param name="sfx"/> <xsl:variable name="suffix"> <xsl:choose> <xsl:when test="$sfx != ''"> - <xsl:value-of select="$sfx"/> + <xsl:value-of select="$sfx"/> </xsl:when> <xsl:otherwise> - - - + <xsl:text> – </xsl:text> - + </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="normalize-space() != ''"> <xsl:apply-templates/> <xsl:value-of select="$suffix"/> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']"> <xsl:variable name="num"><xsl:number/></xsl:variable> <xsl:choose> <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name --> <fo:inline xsl:use-attribute-sets="termnote-p-style"> <xsl:apply-templates/> </fo:inline> </xsl:when> <xsl:otherwise> - <fo:block xsl:use-attribute-sets="termnote-p-style"> + <fo:block xsl:use-attribute-sets="termnote-p-style"> <xsl:apply-templates/> </fo:block> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'terms']"> + </xsl:template> + + <!-- ====== --> + <!-- ====== --> + + <!-- ====== --> + <!-- term --> + <!-- ====== --> + + <xsl:template match="*[local-name() = 'terms']"> <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> --> <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'term']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'term']"> <fo:block id="{@id}" xsl:use-attribute-sets="term-style"> - - - - <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])"> - + </xsl:if> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <xsl:variable name="level"> <xsl:call-template name="getLevelTermName"/> </xsl:variable> <fo:inline role="H{$level}"> <xsl:apply-templates/> </fo:inline> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure"> + </xsl:template> + <!-- ====== --> + <!-- ====== --> + + <!-- ====== --> + <!-- figure --> + <!-- image --> + <!-- ====== --> + + <xsl:template match="*[local-name() = 'figure']" name="figure"> <xsl:variable name="isAdded" select="@added"/> <xsl:variable name="isDeleted" select="@deleted"/> - <fo:block-container id="{@id}"> - + <fo:block-container id="{@id}"> + <xsl:call-template name="setTrackChangesStyles"> <xsl:with-param name="isAdded" select="$isAdded"/> <xsl:with-param name="isDeleted" select="$isDeleted"/> </xsl:call-template> - - - + <fo:block xsl:use-attribute-sets="figure-style"> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> <xsl:call-template name="fn_display_figure"/> <xsl:for-each select="*[local-name() = 'note']"> <xsl:call-template name="note"/> </xsl:for-each> - - + <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image --> - - + </fo:block-container> - </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']"> <fo:block id="{@id}"> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> <xsl:apply-templates select="*[local-name() = 'name']"/> - </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']"> <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'image']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'image']"> <xsl:variable name="isAdded" select="../@added"/> <xsl:variable name="isDeleted" select="../@deleted"/> <xsl:choose> <xsl:when test="ancestor::*[local-name() = 'title']"> <fo:inline padding-left="1mm" padding-right="1mm"> @@ -5643,56 +5706,56 @@ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/> </fo:inline> </xsl:when> <xsl:otherwise> <fo:block xsl:use-attribute-sets="image-style"> - - + <xsl:variable name="src"> <xsl:call-template name="image_src"/> </xsl:variable> - + <xsl:choose> <xsl:when test="$isDeleted = 'true'"> <!-- enclose in svg --> <fo:instream-foreign-object fox:alt-text="Image {@alt}"> <xsl:attribute name="width">100%</xsl:attribute> <xsl:attribute name="content-height">100%</xsl:attribute> <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute> <xsl:attribute name="scaling">uniform</xsl:attribute> - - + <xsl:apply-templates select="." mode="cross_image"/> - + </fo:instream-foreign-object> </xsl:when> <xsl:otherwise> <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"> <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])"> - + <xsl:variable name="img_src"> <xsl:choose> <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when> <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/> <xsl:if test="number($scale) &lt; 100"> <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute> </xsl:if> - + </xsl:if> - + </fo:external-graphic> </xsl:otherwise> </xsl:choose> - + </fo:block> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="image_src"> + </xsl:template> + + <xsl:template name="image_src"> <xsl:choose> <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]"> <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/> </xsl:when> <xsl:when test="not(starts-with(@src, 'data:'))"> @@ -5700,11 +5763,13 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="@src"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image"> + </xsl:template> + + <xsl:template match="*[local-name() = 'image']" mode="cross_image"> <xsl:choose> <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]"> <xsl:variable name="src"> <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/> </xsl:variable> @@ -5741,23 +5806,38 @@ <xsl:with-param name="height" select="$height"/> </xsl:call-template> </svg> </xsl:otherwise> </xsl:choose> - - </xsl:template><xsl:template name="svg_cross"> + + </xsl:template> + + <xsl:template name="svg_cross"> <xsl:param name="width"/> <xsl:param name="height"/> <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/> <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/> - </xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg"> + </xsl:template> + + <!-- =================== --> + <!-- SVG images processing --> + <!-- =================== --> + <xsl:variable name="figure_name_height">14</xsl:variable> + <xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><!-- paper width minus margins --> + <xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><!-- paper height minus margins and title height --> + <xsl:variable name="image_dpi" select="96"/> + <xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/> + <xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/> + + <xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/> + <xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg"> <xsl:param name="name"/> - + <xsl:variable name="svg_content"> <xsl:apply-templates select="." mode="svg_update"/> </xsl:variable> - + <xsl:variable name="alt-text"> <xsl:choose> <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''"> <xsl:value-of select="../*[local-name() = 'name']"/> </xsl:when> @@ -5765,49 +5845,49 @@ <xsl:value-of select="$name"/> </xsl:when> <xsl:otherwise>Figure</xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:choose> <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]"> <fo:block> <xsl:variable name="width" select="@width"/> <xsl:variable name="height" select="@height"/> - + <xsl:variable name="scale_x"> <xsl:choose> <xsl:when test="$width &gt; $width_effective_px"> <xsl:value-of select="$width_effective_px div $width"/> </xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="scale_y"> <xsl:choose> <xsl:when test="$height * $scale_x &gt; $height_effective_px"> <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/> </xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="scale"> <xsl:choose> <xsl:when test="$scale_y != 1"> <xsl:value-of select="$scale_x * $scale_y"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$scale_x"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="width_scale" select="round($width * $scale)"/> <xsl:variable name="height_scale" select="round($height * $scale)"/> - + <fo:table table-layout="fixed" width="100%"> <fo:table-column column-width="proportional-column-width(1)"/> <fo:table-column column-width="{$width_scale}px"/> <fo:table-column column-width="proportional-column-width(1)"/> <fo:table-body> @@ -5831,22 +5911,22 @@ <xsl:attribute name="scaling">uniform</xsl:attribute> <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/> </fo:instream-foreign-object> </fo:block> - + <xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links"> <xsl:with-param name="scale" select="$scale"/> </xsl:apply-templates> </fo:block-container> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:block> - + </xsl:when> <xsl:otherwise> <fo:block xsl:use-attribute-sets="image-style"> <fo:instream-foreign-object fox:alt-text="{$alt-text}"> <xsl:attribute name="width">100%</xsl:attribute> @@ -5865,19 +5945,28 @@ <xsl:copy-of select="$svg_content"/> </fo:instream-foreign-object> </fo:block> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="@*|node()" mode="svg_update"> + </xsl:template> + + <!-- ============== --> + <!-- svg_update --> + <!-- ============== --> + <xsl:template match="@*|node()" mode="svg_update"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="svg_update"/> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update"> + </xsl:template> + + <xsl:template match="*[local-name() = 'image']/@href" mode="svg_update"> <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink"> <xsl:value-of select="."/> </xsl:attribute> - </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update"> + </xsl:template> + + <xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update"> <xsl:copy> <xsl:apply-templates select="@*" mode="svg_update"/> <xsl:variable name="viewbox_"> <xsl:call-template name="split"> <xsl:with-param name="pText" select="@viewBox"/> @@ -5885,11 +5974,11 @@ </xsl:call-template> </xsl:variable> <xsl:variable name="viewbox" select="xalan:nodeset($viewbox_)"/> <xsl:variable name="width" select="normalize-space($viewbox//item[3])"/> <xsl:variable name="height" select="normalize-space($viewbox//item[4])"/> - + <xsl:attribute name="width"> <xsl:choose> <xsl:when test="$width != ''"> <xsl:value-of select="round($width)"/> </xsl:when> @@ -5902,35 +5991,49 @@ <xsl:value-of select="round($height)"/> </xsl:when> <xsl:otherwise>400</xsl:otherwise> <!-- default height --> </xsl:choose> </xsl:attribute> - + <xsl:apply-templates mode="svg_update"/> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3"> + </xsl:template> + <!-- ============== --> + <!-- END: svg_update --> + <!-- ============== --> + + <!-- image with svg and emf --> + <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3"> <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/> <xsl:for-each select="*[local-name() = 'svg']"> <xsl:call-template name="image_svg"> <xsl:with-param name="name" select="$name"/> </xsl:call-template> </xsl:for-each> - </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2"> <xsl:variable name="svg_content" select="document(@src)"/> <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/> <xsl:for-each select="xalan:nodeset($svg_content)/node()"> <xsl:call-template name="image_svg"> <xsl:with-param name="name" select="$name"/> </xsl:call-template> </xsl:for-each> - </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a"> + </xsl:template> + + <xsl:template match="@*|node()" mode="svg_remove_a"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a"> + </xsl:template> + + <xsl:template match="*[local-name() = 'a']" mode="svg_remove_a"> <xsl:apply-templates mode="svg_remove_a"/> - </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links"> + </xsl:template> + + <xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links"> <xsl:param name="scale"/> <xsl:variable name="dest"> <xsl:choose> <xsl:when test="starts-with(@href, '#')"> <xsl:value-of select="substring-after(@href, '#')"/> @@ -5947,11 +6050,11 @@ <xsl:with-param name="width" select="floor(@width * $scale)"/> <xsl:with-param name="height" select="floor(@height * $scale)"/> <xsl:with-param name="dest" select="$dest"/> </xsl:call-template> </xsl:for-each> - + <xsl:for-each select="./*[local-name() = 'polygon']"> <xsl:variable name="points"> <xsl:call-template name="split"> <xsl:with-param name="pText" select="@points"/> </xsl:call-template> @@ -5978,11 +6081,11 @@ <xsl:with-param name="width" select="floor($width * $scale)"/> <xsl:with-param name="height" select="floor($height * $scale)"/> <xsl:with-param name="dest" select="$dest"/> </xsl:call-template> </xsl:for-each> - + <xsl:for-each select="./*[local-name() = 'circle']"> <xsl:call-template name="insertSVGMapLink"> <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/> <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/> <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/> @@ -5997,11 +6100,13 @@ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/> <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/> <xsl:with-param name="dest" select="$dest"/> </xsl:call-template> </xsl:for-each> - </xsl:template><xsl:template name="insertSVGMapLink"> + </xsl:template> + + <xsl:template name="insertSVGMapLink"> <xsl:param name="left"/> <xsl:param name="top"/> <xsl:param name="width"/> <xsl:param name="height"/> <xsl:param name="dest"/> @@ -6016,56 +6121,83 @@ <fo:block> </fo:block></fo:block-container> </fo:inline-container> </fo:basic-link> </fo:block> </fo:block-container> - </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents"> + </xsl:template> + <!-- =================== --> + <!-- End SVG images processing --> + <!-- =================== --> + + <!-- ignore emf processing (Apache FOP doesn't support EMF) --> + <xsl:template match="*[local-name() = 'emf']"/> + + <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents"> <xsl:apply-templates mode="contents"/> <xsl:text> </xsl:text> - </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks"> + </xsl:template> + + <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks"> <xsl:apply-templates mode="bookmarks"/> <xsl:text> </xsl:text> - </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2"> <xsl:value-of select="."/> - </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2"> <xsl:value-of select="."/> - </xsl:template><xsl:template match="node()" mode="contents"> + </xsl:template> + + <xsl:template match="node()" mode="contents"> <xsl:apply-templates mode="contents"/> - </xsl:template><xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" mode="contents_no_displayorder"> + </xsl:template> + + <!-- special case: ignore preface/section-title and sections/section-title without @displayorder --> + <xsl:template match="*[local-name() = 'preface' or local-name() = 'sections']/*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" priority="3" mode="contents"/> + <!-- process them by demand (mode="contents_no_displayorder") --> + <xsl:template match="*[local-name() = 'p'][@type = 'section-title' and not(@displayorder)]" mode="contents_no_displayorder"> <xsl:call-template name="contents_section-title"/> - </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'section-title']" mode="contents_in_clause"> + </xsl:template> + <xsl:template match="*[local-name() = 'p'][@type = 'section-title']" mode="contents_in_clause"> <xsl:call-template name="contents_section-title"/> - </xsl:template><xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents"> + </xsl:template> + + <!-- special case: ignore section-title if @depth different than @depth of parent clause, or @depth of parent clause = 1 --> + <xsl:template match="*[local-name() = 'clause']/*[local-name() = 'p'][@type = 'section-title' and (@depth != ../*[local-name() = 'title']/@depth or ../*[local-name() = 'title']/@depth = 1)]" priority="3" mode="contents"/> + + <xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" name="contents_section-title" mode="contents"> <xsl:variable name="level"> <xsl:call-template name="getLevel"> <xsl:with-param name="depth" select="@depth"/> </xsl:call-template> </xsl:variable> - + <xsl:variable name="section"> <xsl:choose> <xsl:when test="@type = 'section-title'"/> <xsl:otherwise> <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable> - + <xsl:variable name="display"> <xsl:choose> <xsl:when test="normalize-space(@id) = ''">false</xsl:when> <xsl:when test="$level &lt;= $toc_level">true</xsl:when> <xsl:otherwise>false</xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="skip">false</xsl:variable> - <xsl:if test="$skip = 'false'"> - + <xsl:if test="$skip = 'false'"> + <xsl:variable name="title"> <xsl:choose> <xsl:when test="*[local-name() = 'tab']"> <xsl:choose> <xsl:when test="@type = 'section-title'"> @@ -6081,33 +6213,52 @@ <xsl:otherwise> <xsl:copy-of select="node()"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="root"> <xsl:if test="ancestor-or-self::*[local-name() = 'preface']">preface</xsl:if> <xsl:if test="ancestor-or-self::*[local-name() = 'annex']">annex</xsl:if> </xsl:variable> - + <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}"> <title> <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/> </title> </item> </xsl:if> - </xsl:template><xsl:template match="node()" mode="bookmarks"> + </xsl:template> + + <xsl:template match="node()" mode="bookmarks"> <xsl:apply-templates mode="bookmarks"/> - </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents"> + </xsl:template> + + <xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents"> <xsl:apply-templates select="."/> - </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/><xsl:template match="*[local-name() = 'span']" mode="contents"> + </xsl:template> + + <xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/> + + <xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/> + + <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output --> + <xsl:template match="*[local-name() = 'span']" mode="contents"> <xsl:apply-templates mode="contents"/> - </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks"> + </xsl:template> + + <xsl:template match="*[local-name() = 'stem']" mode="bookmarks"> <xsl:apply-templates mode="bookmarks"/> - </xsl:template><xsl:template match="*[local-name() = 'span']" mode="bookmarks"> + </xsl:template> + + <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output --> + <xsl:template match="*[local-name() = 'span']" mode="bookmarks"> <xsl:apply-templates mode="bookmarks"/> - </xsl:template><xsl:template name="addBookmarks"> + </xsl:template> + + <!-- Bookmarks --> + <xsl:template name="addBookmarks"> <xsl:param name="contents"/> <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/> <xsl:if test="$contents_nodes//item"> <fo:bookmark-tree> <xsl:choose> @@ -6146,69 +6297,64 @@ <xsl:otherwise> <xsl:value-of select="@title-part"/> </xsl:otherwise> </xsl:choose> </fo:bookmark-title> - + <xsl:apply-templates select="contents/item" mode="bookmark"/> - + <xsl:call-template name="insertFigureBookmarks"> <xsl:with-param name="contents" select="contents"/> </xsl:call-template> - + <xsl:call-template name="insertTableBookmarks"> <xsl:with-param name="contents" select="contents"/> <xsl:with-param name="lang" select="@lang"/> </xsl:call-template> - + </fo:bookmark> - + </xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:for-each select="$contents_nodes/doc"> - + <xsl:apply-templates select="contents/item" mode="bookmark"/> - + <xsl:call-template name="insertFigureBookmarks"> <xsl:with-param name="contents" select="contents"/> </xsl:call-template> - + <xsl:call-template name="insertTableBookmarks"> <xsl:with-param name="contents" select="contents"/> <xsl:with-param name="lang" select="@lang"/> </xsl:call-template> - + </xsl:for-each> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> - <xsl:apply-templates select="$contents_nodes/contents/item" mode="bookmark"/> - + <xsl:apply-templates select="$contents_nodes/contents/item" mode="bookmark"/> + <xsl:call-template name="insertFigureBookmarks"> <xsl:with-param name="contents" select="$contents_nodes/contents"/> </xsl:call-template> - + <xsl:call-template name="insertTableBookmarks"> <xsl:with-param name="contents" select="$contents_nodes/contents"/> <xsl:with-param name="lang" select="@lang"/> </xsl:call-template> - + </xsl:otherwise> </xsl:choose> - - - - - - - - + </fo:bookmark-tree> </xsl:if> - </xsl:template><xsl:template name="insertFigureBookmarks"> + </xsl:template> + + <xsl:template name="insertFigureBookmarks"> <xsl:param name="contents"/> <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/> <xsl:if test="$contents_nodes/figure"> <fo:bookmark internal-destination="{$contents_nodes/figure[1]/@id}" starting-state="hide"> <fo:bookmark-title>Figures</fo:bookmark-title> @@ -6217,34 +6363,33 @@ <fo:bookmark-title> <xsl:value-of select="normalize-space(title)"/> </fo:bookmark-title> </fo:bookmark> </xsl:for-each> - </fo:bookmark> + </fo:bookmark> </xsl:if> - - + <xsl:if test="$contents_nodes//figures/figure"> <fo:bookmark internal-destination="empty_bookmark" starting-state="hide"> - - - + <xsl:variable name="bookmark-title"> - + <xsl:value-of select="$title-list-figures"/> - + </xsl:variable> <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title> <xsl:for-each select="$contents_nodes//figures/figure"> <fo:bookmark internal-destination="{@id}"> <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> </fo:bookmark> </xsl:for-each> </fo:bookmark> </xsl:if> - - </xsl:template><xsl:template name="insertTableBookmarks"> + + </xsl:template> <!-- insertFigureBookmarks --> + + <xsl:template name="insertTableBookmarks"> <xsl:param name="contents"/> <xsl:param name="lang"/> <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/> <xsl:if test="$contents_nodes/table"> <fo:bookmark internal-destination="{$contents_nodes/table[1]/@id}" starting-state="hide"> @@ -6259,58 +6404,58 @@ <fo:bookmark-title> <xsl:value-of select="normalize-space(title)"/> </fo:bookmark-title> </fo:bookmark> </xsl:for-each> - </fo:bookmark> + </fo:bookmark> </xsl:if> - - + <xsl:if test="$contents_nodes//tables/table"> <fo:bookmark internal-destination="empty_bookmark" starting-state="hide"> - - - + <xsl:variable name="bookmark-title"> - + <xsl:value-of select="$title-list-tables"/> - + </xsl:variable> - + <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title> - + <xsl:for-each select="$contents_nodes//tables/table"> <fo:bookmark internal-destination="{@id}"> <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> </fo:bookmark> </xsl:for-each> </fo:bookmark> </xsl:if> - - </xsl:template><xsl:template name="getLangVersion"> + + </xsl:template> <!-- insertTableBookmarks --> + <!-- End Bookmarks --> + + <xsl:template name="getLangVersion"> <xsl:param name="lang"/> <xsl:param name="doctype" select="''"/> <xsl:param name="title" select="''"/> <xsl:choose> <xsl:when test="$lang = 'en'"> - - + </xsl:when> <xsl:when test="$lang = 'fr'"> - - + </xsl:when> <xsl:when test="$lang = 'de'">Deutsche</xsl:when> <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="item" mode="bookmark"> + </xsl:template> + + <xsl:template match="item" mode="bookmark"> <xsl:choose> <xsl:when test="@id != ''"> <fo:bookmark internal-destination="{@id}" starting-state="hide"> <fo:bookmark-title> <xsl:if test="@section != ''"> - <xsl:value-of select="@section"/> + <xsl:value-of select="@section"/> <xsl:text> </xsl:text> </xsl:if> <xsl:value-of select="normalize-space(title)"/> </fo:bookmark-title> <xsl:apply-templates mode="bookmark"/> @@ -6318,54 +6463,68 @@ </xsl:when> <xsl:otherwise> <xsl:apply-templates mode="bookmark"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']"> - <xsl:if test="normalize-space() != ''"> + </xsl:template> + + <xsl:template match="title" mode="bookmark"/> + <xsl:template match="text()" mode="bookmark"/> + + <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']"> + <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="figure-name-style"> - - - - - + <xsl:apply-templates/> </fo:block> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item"> + </xsl:template> + + <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> + <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/> + + <!-- ====== --> + <!-- ====== --> + <xsl:template match="*[local-name() = 'title']" mode="contents_item"> <xsl:param name="mode">bookmarks</xsl:param> <xsl:apply-templates mode="contents_item"> <xsl:with-param name="mode" select="$mode"/> </xsl:apply-templates> <!-- <xsl:text> </xsl:text> --> - </xsl:template><xsl:template name="getSection"> + </xsl:template> + + <xsl:template name="getSection"> <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/> - </xsl:template><xsl:template name="getName"> + </xsl:template> + + <xsl:template name="getName"> <xsl:choose> <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']"> <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/> </xsl:when> <xsl:otherwise> <xsl:copy-of select="*[local-name() = 'title']/node()"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="insertTitleAsListItem"> + </xsl:template> + + <xsl:template name="insertTitleAsListItem"> <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/> - <xsl:variable name="section"> + <xsl:variable name="section"> <xsl:for-each select=".."> <xsl:call-template name="getSection"/> </xsl:for-each> - </xsl:variable> - <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}"> + </xsl:variable> + <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}"> <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block> <xsl:value-of select="$section"/> </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> - <fo:block> + <fo:block> <xsl:choose> <xsl:when test="*[local-name() = 'tab']"> <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/> </xsl:when> <xsl:otherwise> @@ -6375,138 +6534,154 @@ </xsl:choose> </fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> - </xsl:template><xsl:template name="extractSection"> + </xsl:template> + + <xsl:template name="extractSection"> <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/> - </xsl:template><xsl:template name="extractTitle"> + </xsl:template> + + <xsl:template name="extractTitle"> <xsl:choose> <xsl:when test="*[local-name() = 'tab']"> <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'xref'] | *[local-name() = 'eref']" mode="contents"> + </xsl:template> + + <xsl:template match="*[local-name() = 'fn']" mode="contents"/> + <xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/> + + <xsl:template match="*[local-name() = 'fn']" mode="contents_item"/> + + <xsl:template match="*[local-name() = 'xref'] | *[local-name() = 'eref']" mode="contents"> <xsl:value-of select="."/> - </xsl:template><xsl:template match="*[local-name() = 'review']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item"> + </xsl:template> + + <xsl:template match="*[local-name() = 'review']" mode="contents_item"/> + + <xsl:template match="*[local-name() = 'tab']" mode="contents_item"> <xsl:text> </xsl:text> - </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item"> + </xsl:template> + + <xsl:template match="*[local-name() = 'strong']" mode="contents_item"> <xsl:copy> <xsl:apply-templates mode="contents_item"/> - </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item"> + </xsl:copy> + </xsl:template> + + <xsl:template match="*[local-name() = 'em']" mode="contents_item"> <xsl:copy> <xsl:apply-templates mode="contents_item"/> - </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item"> + </xsl:copy> + </xsl:template> + + <xsl:template match="*[local-name() = 'stem']" mode="contents_item"> <xsl:copy-of select="."/> - </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item"> + </xsl:template> + + <xsl:template match="*[local-name() = 'br']" mode="contents_item"> <xsl:text> </xsl:text> - </xsl:template><xsl:template match="*[local-name() = 'name']" mode="contents_item"> + </xsl:template> + + <xsl:template match="*[local-name() = 'name']" mode="contents_item"> <xsl:param name="mode">bookmarks</xsl:param> <xsl:apply-templates mode="contents_item"> <xsl:with-param name="mode" select="$mode"/> </xsl:apply-templates> - </xsl:template><xsl:template match="*[local-name() = 'add']" mode="contents_item"> + </xsl:template> + + <xsl:template match="*[local-name() = 'add']" mode="contents_item"> <xsl:param name="mode">bookmarks</xsl:param> <xsl:choose> <xsl:when test="starts-with(text(), $ace_tag)"> <xsl:if test="$mode = 'contents'"> <xsl:copy> <xsl:apply-templates mode="contents_item"/> - </xsl:copy> + </xsl:copy> </xsl:if> </xsl:when> <xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="text()" mode="contents_item"> + </xsl:template> + + <xsl:template match="text()" mode="contents_item"> <xsl:call-template name="keep_together_standard_number"/> - </xsl:template><xsl:template match="*[local-name() = 'span']" mode="contents_item"> + </xsl:template> + + <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output --> + <xsl:template match="*[local-name() = 'span']" mode="contents_item"> <xsl:apply-templates mode="contents_item"/> - </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode"> - + </xsl:template> + + <!-- ====== --> + <!-- sourcecode --> + <!-- ====== --> + <xsl:template match="*[local-name()='sourcecode']" name="sourcecode"> + <fo:block-container xsl:use-attribute-sets="sourcecode-container-style"> - + <xsl:if test="not(ancestor::*[local-name() = 'li']) or ancestor::*[local-name() = 'example']"> <xsl:attribute name="margin-left">0mm</xsl:attribute> </xsl:if> - + <xsl:if test="ancestor::*[local-name() = 'example']"> <xsl:attribute name="margin-right">0mm</xsl:attribute> </xsl:if> - + <xsl:copy-of select="@id"/> - + <xsl:if test="parent::*[local-name() = 'note']"> <xsl:attribute name="margin-left"> <xsl:choose> <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when> <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise> </xsl:choose> </xsl:attribute> - + </xsl:if> <fo:block-container margin-left="0mm"> - - - - - + <fo:block xsl:use-attribute-sets="sourcecode-style"> <xsl:variable name="_font-size"> - - - - - + <!-- 9 --> - - + <!-- <xsl:if test="$namespace = 'ieee'"> <xsl:if test="$current_template = 'standard'">8</xsl:if> </xsl:if> --> - - - - - - - + 10 </xsl:variable> - - <xsl:variable name="font-size" select="normalize-space($_font-size)"/> + + <xsl:variable name="font-size" select="normalize-space($_font-size)"/> <xsl:if test="$font-size != ''"> <xsl:attribute name="font-size"> <xsl:choose> <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when> <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when> <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when> <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:if> - - - - - + <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - - + <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content --> - - - - + </fo:block-container> </fo:block-container> - </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name()='sourcecode']/text()" priority="2"> <xsl:choose> <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting --> <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/> <xsl:choose> <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result --> @@ -6519,34 +6694,36 @@ </xsl:when> <xsl:otherwise> <xsl:call-template name="add_spaces_to_sourcecode"/> </xsl:otherwise> </xsl:choose> - - </xsl:template><xsl:template name="add_spaces_to_sourcecode"> + + </xsl:template> + + <xsl:template name="add_spaces_to_sourcecode"> <xsl:variable name="text_step1"> <xsl:call-template name="add-zero-spaces-equal"/> </xsl:variable> <xsl:variable name="text_step2"> <xsl:call-template name="add-zero-spaces-java"> <xsl:with-param name="text" select="$text_step1"/> </xsl:call-template> </xsl:variable> - + <!-- <xsl:value-of select="$text_step2"/> --> - + <!-- add zero-width space after space --> <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/> - + <!-- split text by zero-width space --> <xsl:variable name="text_step4"> <xsl:call-template name="split_for_interspers"> <xsl:with-param name="pText" select="$text_step3"/> <xsl:with-param name="sep" select="$zero_width_space"/> </xsl:call-template> </xsl:variable> - + <xsl:for-each select="xalan:nodeset($text_step4)/node()"> <xsl:choose> <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space --> <xsl:call-template name="interspers-java"> <xsl:with-param name="str" select="."/> @@ -6555,21 +6732,28 @@ <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </xsl:for-each> - - </xsl:template><xsl:variable name="interspers_tag_open">###interspers123###</xsl:variable><xsl:variable name="interspers_tag_close">###/interspers123###</xsl:variable><xsl:template name="split_for_interspers"> + + </xsl:template> <!-- add_spaces_to_sourcecode --> + + <xsl:variable name="interspers_tag_open">###interspers123###</xsl:variable> + <xsl:variable name="interspers_tag_close">###/interspers123###</xsl:variable> + <!-- split string by separator for interspers --> + <xsl:template name="split_for_interspers"> <xsl:param name="pText" select="."/> <xsl:param name="sep" select="','"/> <!-- word with length more than 30 will be interspersed with zero-width space --> <xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space --> <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/> <xsl:call-template name="replace_tag_interspers"> <xsl:with-param name="text" select="$text"/> </xsl:call-template> - </xsl:template><xsl:template name="replace_tag_interspers"> + </xsl:template> <!-- end: split string by separator for interspers --> + + <xsl:template name="replace_tag_interspers"> <xsl:param name="text"/> <xsl:choose> <xsl:when test="contains($text, $interspers_tag_open)"> <xsl:value-of select="substring-before($text, $interspers_tag_open)"/> <xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/> @@ -6580,33 +6764,42 @@ <xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/> </xsl:call-template> </xsl:when> <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="interspers"> + </xsl:template> + + <!-- insert 'char' between each character in the string --> + <xsl:template name="interspers"> <xsl:param name="str"/> <xsl:param name="char" select="$zero_width_space"/> <xsl:if test="$str != ''"> <xsl:value-of select="substring($str, 1, 1)"/> - + <xsl:variable name="next_char" select="substring($str, 2, 1)"/> <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))"> <xsl:value-of select="$char"/> </xsl:if> - + <xsl:call-template name="interspers"> <xsl:with-param name="str" select="substring($str, 2)"/> <xsl:with-param name="char" select="$char"/> </xsl:call-template> </xsl:if> - </xsl:template><xsl:template name="interspers-java"> + </xsl:template> + + <xsl:template name="interspers-java"> <xsl:param name="str"/> <xsl:param name="char" select="$zero_width_space"/> <xsl:value-of select="java:replaceAll(java:java.lang.String.new($str),'([^ -.:=_—])',concat('$1', $char))"/> <!-- insert $char after each char excep space, - . : = _ etc. --> - </xsl:template><xsl:template match="*" mode="syntax_highlight"> + </xsl:template> + + <xsl:template match="*" mode="syntax_highlight"> <xsl:apply-templates mode="syntax_highlight"/> - </xsl:template><xsl:variable name="syntax_highlight_styles_"> + </xsl:template> + + <xsl:variable name="syntax_highlight_styles_"> <style class="hljs-addition" xsl:use-attribute-sets="hljs-addition"/> <style class="hljs-attr" xsl:use-attribute-sets="hljs-attr"/> <style class="hljs-attribute" xsl:use-attribute-sets="hljs-attribute"/> <style class="hljs-built_in" xsl:use-attribute-sets="hljs-built_in"/> <style class="hljs-bullet" xsl:use-attribute-sets="hljs-bullet"/> @@ -6638,11 +6831,11 @@ <style class="hljs-selector-pseudo" xsl:use-attribute-sets="hljs-selector-pseudo"/> <style class="hljs-selector-tag" xsl:use-attribute-sets="hljs-selector-tag"/> <style class="hljs-string" xsl:use-attribute-sets="hljs-string"/> <style class="hljs-strong" xsl:use-attribute-sets="hljs-strong"/> <style class="hljs-subst" xsl:use-attribute-sets="hljs-subst"/> - <style class="hljs-symbol" xsl:use-attribute-sets="hljs-symbol"/> + <style class="hljs-symbol" xsl:use-attribute-sets="hljs-symbol"/> <style class="hljs-tag" xsl:use-attribute-sets="hljs-tag"/> <!-- <style class="hljs-tag_hljs-attr" xsl:use-attribute-sets="hljs-tag_hljs-attr"></style> --> <!-- <style class="hljs-tag_hljs-name" xsl:use-attribute-sets="hljs-tag_hljs-name"></style> --> <style class="hljs-template-tag" xsl:use-attribute-sets="hljs-template-tag"/> <style class="hljs-template-variable" xsl:use-attribute-sets="hljs-template-variable"/> @@ -6651,11 +6844,14 @@ <style class="hljs-title_and_class__and_inherited__" xsl:use-attribute-sets="hljs-title_and_class__and_inherited__"/> <style class="hljs-title_and_function_" xsl:use-attribute-sets="hljs-title_and_function_"/> <style class="hljs-type" xsl:use-attribute-sets="hljs-type"/> <style class="hljs-variable" xsl:use-attribute-sets="hljs-variable"/> <style class="hljs-variable_and_language_" xsl:use-attribute-sets="hljs-variable_and_language_"/> - </xsl:variable><xsl:variable name="syntax_highlight_styles" select="xalan:nodeset($syntax_highlight_styles_)"/><xsl:template match="span" mode="syntax_highlight" priority="2"> + </xsl:variable> + <xsl:variable name="syntax_highlight_styles" select="xalan:nodeset($syntax_highlight_styles_)"/> + + <xsl:template match="span" mode="syntax_highlight" priority="2"> <!-- <fo:inline color="green" font-style="italic"><xsl:apply-templates mode="syntax_highlight"/></fo:inline> --> <fo:inline> <xsl:variable name="classes_"> <xsl:call-template name="split"> <xsl:with-param name="pText" select="@class"/> @@ -6684,18 +6880,18 @@ <xsl:if test="contains(@class, 'hljs-string') and contains(ancestor::*/@class, 'hljs-meta')"> <item>hljs-meta_hljs-string</item> </xsl:if> </xsl:variable> <xsl:variable name="classes" select="xalan:nodeset($classes_)"/> - + <xsl:for-each select="$classes/item"> <xsl:variable name="class_name" select="."/> <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]"> <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute> </xsl:for-each> </xsl:for-each> - + <!-- <xsl:variable name="class_name"> <xsl:choose> <xsl:when test="@class = 'hljs-attr' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-attr</xsl:when> <xsl:when test="@class = 'hljs-name' and ancestor::*/@class = 'hljs-tag'">hljs-tag_hljs-name</xsl:when> <xsl:when test="@class = 'hljs-string' and ancestor::*/@class = 'hljs-meta'">hljs-meta_hljs-string</xsl:when> @@ -6703,123 +6899,195 @@ </xsl:choose> </xsl:variable> <xsl:for-each select="$syntax_highlight_styles/style[@class = $class_name]/@*[not(local-name() = 'class')]"> <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute> </xsl:for-each> --> - + <xsl:apply-templates mode="syntax_highlight"/></fo:inline> - </xsl:template><xsl:template match="text()" mode="syntax_highlight" priority="2"> + </xsl:template> + + <xsl:template match="text()" mode="syntax_highlight" priority="2"> <xsl:call-template name="add_spaces_to_sourcecode"/> - </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"> - <xsl:if test="normalize-space() != ''"> - <fo:block xsl:use-attribute-sets="sourcecode-name-style"> + </xsl:template> + + <!-- end mode="syntax_highlight" --> + + <xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"> + <xsl:if test="normalize-space() != ''"> + <fo:block xsl:use-attribute-sets="sourcecode-name-style"> <xsl:apply-templates/> </fo:block> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'permission']"> - <fo:block id="{@id}" xsl:use-attribute-sets="permission-style"> + </xsl:template> + <!-- ====== --> + <!-- ====== --> + + <!-- ========== --> + <!-- permission --> + <!-- ========== --> + <xsl:template match="*[local-name() = 'permission']"> + <fo:block id="{@id}" xsl:use-attribute-sets="permission-style"> <xsl:apply-templates select="*[local-name()='name']"/> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="permission-name-style"> <xsl:apply-templates/> - + </fo:block> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']"> <fo:block xsl:use-attribute-sets="permission-label-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'requirement']"> - <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style"> + </xsl:template> + <!-- ========== --> + <!-- ========== --> + + <!-- ========== --> + <!-- requirement --> +<!-- ========== --> + <xsl:template match="*[local-name() = 'requirement']"> + <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style"> <xsl:apply-templates select="*[local-name()='name']"/> <xsl:apply-templates select="*[local-name()='label']"/> <xsl:apply-templates select="@obligation"/> <xsl:apply-templates select="*[local-name()='subject']"/> <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'label') and not(local-name() = 'subject')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="requirement-name-style"> - + <xsl:apply-templates/> - + </fo:block> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"> <fo:block xsl:use-attribute-sets="requirement-label-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation"> + </xsl:template> + + <xsl:template match="*[local-name() = 'requirement']/@obligation"> <fo:block> <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"> <fo:block xsl:use-attribute-sets="subject-style"> <xsl:text>Target Type </xsl:text><xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'recommendation']"> - <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style"> + </xsl:template> + + <!-- ========== --> + <!-- ========== --> + + <!-- ========== --> + <!-- recommendation --> + <!-- ========== --> + <xsl:template match="*[local-name() = 'recommendation']"> + <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style"> <xsl:apply-templates select="*[local-name()='name']"/> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:block xsl:use-attribute-sets="recommendation-name-style"> <xsl:apply-templates/> - + </fo:block> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']"> <fo:block xsl:use-attribute-sets="recommendation-label-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'subject']"> + </xsl:template> + <!-- ========== --> + <!-- END recommendation --> + <!-- ========== --> + + <!-- ========== --> + <!-- ========== --> + + <xsl:template match="*[local-name() = 'subject']"> <fo:block xsl:use-attribute-sets="subject-style"> <xsl:text>Target Type </xsl:text><xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']"> <fo:block xsl:use-attribute-sets="inherit-style"> <xsl:text>Dependency </xsl:text><xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']"> <fo:block xsl:use-attribute-sets="description-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']"> <fo:block xsl:use-attribute-sets="specification-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']"> <fo:block xsl:use-attribute-sets="measurement-target-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']"> <fo:block xsl:use-attribute-sets="verification-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']"> <fo:block xsl:use-attribute-sets="import-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> + </xsl:template> + <!-- ========== --> + <!-- END --> + <!-- ========== --> + + <!-- ========== --> + <!-- requirement, recommendation, permission table --> + <!-- ========== --> + <xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt"> <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> <xsl:attribute name="margin-bottom">0pt</xsl:attribute> </xsl:if> <fo:block-container margin-left="0mm" margin-right="0mm"> <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" --> <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> --> </xsl:if> - <xsl:variable name="simple-table"> + <xsl:variable name="simple-table"> <xsl:call-template name="getSimpleTable"> <xsl:with-param name="id" select="@id"/> </xsl:call-template> - </xsl:variable> + </xsl:variable> <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/> <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])"> <fo:table-column column-width="30%"/> <fo:table-column column-width="70%"/> </xsl:if> @@ -6833,20 +7101,26 @@ </fo:block> </xsl:for-each> </xsl:if> </fo:block-container> </fo:block-container> - </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement"> - <fo:table-header> + </xsl:template> + + <xsl:template match="*[local-name()='thead']" mode="requirement"> + <fo:table-header> <xsl:apply-templates mode="requirement"/> </fo:table-header> - </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement"> + </xsl:template> + + <xsl:template match="*[local-name()='tbody']" mode="requirement"> <fo:table-body> <xsl:apply-templates mode="requirement"/> </fo:table-body> - </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement"> - <fo:table-row height="7mm" border-bottom="0.5pt solid grey"> + </xsl:template> + + <xsl:template match="*[local-name()='tr']" mode="requirement"> + <fo:table-row height="7mm" border-bottom="0.5pt solid grey"> <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) --> <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute> </xsl:if> <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')"> <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute> @@ -6854,127 +7128,161 @@ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')"> <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute> </xsl:if> <xsl:apply-templates mode="requirement"/> </fo:table-row> - </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement"> + </xsl:template> + + <xsl:template match="*[local-name()='th']" mode="requirement"> <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" --> <xsl:call-template name="setTextAlignment"> <xsl:with-param name="default">left</xsl:with-param> </xsl:call-template> - + <xsl:call-template name="setTableCellAttributes"/> - + <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> - </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement"> + </xsl:template> + + <xsl:template match="*[local-name()='td']" mode="requirement"> <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" --> <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']"> <xsl:attribute name="padding">0mm</xsl:attribute> <xsl:attribute name="padding-left">0mm</xsl:attribute> </xsl:if> <xsl:call-template name="setTextAlignment"> <xsl:with-param name="default">left</xsl:with-param> </xsl:call-template> - + <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])"> <xsl:attribute name="font-weight">bold</xsl:attribute> </xsl:if> - + <xsl:call-template name="setTableCellAttributes"/> - - <fo:block> + + <fo:block> <xsl:apply-templates/> - </fo:block> + </fo:block> </fo:table-cell> - </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2"> <fo:block font-size="11pt"> - + <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]"> + </xsl:template> + + <xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]"> <fo:block> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'termexample']"> - <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style"> + </xsl:template> + <!-- ========== --> + <!-- END requirement, recommendation, permission table --> + <!-- ========== --> + + <!-- ====== --> + <!-- termexample --> + <!-- ====== --> + <xsl:template match="*[local-name() = 'termexample']"> + <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style"> <xsl:apply-templates select="*[local-name()='name']"/> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"> <xsl:if test="normalize-space() != ''"> <fo:inline xsl:use-attribute-sets="termexample-name-style"> <xsl:apply-templates/> </fo:inline> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']"> <xsl:variable name="element">inline - - - </xsl:variable> - <xsl:choose> + + + </xsl:variable> + <xsl:choose> <xsl:when test="contains($element, 'block')"> <fo:block xsl:use-attribute-sets="example-p-style"> - - - + <xsl:apply-templates/> </fo:block> </xsl:when> <xsl:otherwise> <fo:inline><xsl:apply-templates/></fo:inline> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'example']"> - + </xsl:template> + <!-- ====== --> + <!-- ====== --> + + <!-- ====== --> + <!-- example --> + <!-- ====== --> + + <!-- There are a few cases: + 1. EXAMPLE text + 2. EXAMPLE + text + 3. EXAMPLE text line 1 + text line 2 + 4. EXAMPLE + text line 1 + text line 2 + --> + <xsl:template match="*[local-name() = 'example']"> + <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style"> - - - + <xsl:variable name="fo_element"> - <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if> + <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if> block </xsl:variable> - + <fo:block-container margin-left="0mm"> - + <xsl:choose> - + <xsl:when test="contains(normalize-space($fo_element), 'block')"> - + <!-- display name 'EXAMPLE' in a separate block --> <fo:block> <xsl:apply-templates select="*[local-name()='name']"> <xsl:with-param name="fo_element" select="$fo_element"/> </xsl:apply-templates> </fo:block> - + <fo:block-container xsl:use-attribute-sets="example-body-style"> - <fo:block-container margin-left="0mm" margin-right="0mm"> + <fo:block-container margin-left="0mm" margin-right="0mm"> <xsl:apply-templates select="node()[not(local-name() = 'name')]"> <xsl:with-param name="fo_element" select="$fo_element"/> </xsl:apply-templates> </fo:block-container> </fo:block-container> </xsl:when> <!-- end block --> - + <xsl:otherwise> <!-- inline --> - + <!-- display 'EXAMPLE' and first element in the same line --> <fo:block> <xsl:apply-templates select="*[local-name()='name']"> <xsl:with-param name="fo_element" select="$fo_element"/> </xsl:apply-templates> <fo:inline> <xsl:apply-templates select="*[not(local-name() = 'name')][1]"> <xsl:with-param name="fo_element" select="$fo_element"/> </xsl:apply-templates> </fo:inline> - </fo:block> - + </fo:block> + <xsl:if test="*[not(local-name() = 'name')][position() &gt; 1]"> <!-- display further elements in blocks --> <fo:block-container xsl:use-attribute-sets="example-body-style"> <fo:block-container margin-left="0mm" margin-right="0mm"> <xsl:apply-templates select="*[not(local-name() = 'name')][position() &gt; 1]"> @@ -6982,17 +7290,19 @@ </xsl:apply-templates> </fo:block-container> </fo:block-container> </xsl:if> </xsl:otherwise> <!-- end inline --> - + </xsl:choose> </fo:block-container> </fo:block-container> - </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"> <xsl:param name="fo_element">block</xsl:param> - + <xsl:choose> <xsl:when test="ancestor::*[local-name() = 'appendix']"> <fo:inline> <xsl:apply-templates/> </fo:inline> @@ -7007,48 +7317,56 @@ <xsl:apply-templates/> </fo:inline> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']"> <xsl:param name="fo_element">block</xsl:param> - + <xsl:variable name="num"><xsl:number/></xsl:variable> <xsl:variable name="element"> - + <xsl:value-of select="$fo_element"/> - </xsl:variable> - <xsl:choose> + </xsl:variable> + <xsl:choose> <xsl:when test="starts-with(normalize-space($element), 'block')"> <fo:block-container> <xsl:if test="ancestor::*[local-name() = 'li'] and contains(normalize-space($fo_element), 'block')"> <xsl:attribute name="margin-left">0mm</xsl:attribute> <xsl:attribute name="margin-right">0mm</xsl:attribute> </xsl:if> <fo:block xsl:use-attribute-sets="example-p-style"> - - + <xsl:if test="$num = 1"> <xsl:attribute name="margin-left">5mm</xsl:attribute> </xsl:if> - + <xsl:apply-templates/> </fo:block> </fo:block-container> </xsl:when> <xsl:otherwise> <fo:inline xsl:use-attribute-sets="example-p-style"> - <xsl:apply-templates/> + <xsl:apply-templates/> </fo:inline> </xsl:otherwise> - </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource"> + </xsl:choose> + </xsl:template> <!-- example/p --> + <!-- ====== --> + <!-- ====== --> + + <!-- ====== --> + <!-- termsource --> + <!-- origin --> + <!-- modification --> + <!-- ====== --> + <xsl:template match="*[local-name() = 'termsource']" name="termsource"> <fo:block xsl:use-attribute-sets="termsource-style"> - - - - <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] --> + + <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] --> <xsl:variable name="termsource_text"> <xsl:apply-templates/> </xsl:variable> <xsl:copy-of select="$termsource_text"/> <!-- <xsl:choose> @@ -7076,99 +7394,141 @@ <xsl:text>]</xsl:text> </xsl:if> </xsl:otherwise> </xsl:choose> --> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2"> <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/> - </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()"> + </xsl:template> + + <xsl:template match="*[local-name() = 'termsource']/text()"> <xsl:if test="normalize-space() != ''"> <xsl:value-of select="."/> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()"> + </xsl:template> + + <!-- text SOURCE: --> + <xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()"> <fo:inline xsl:use-attribute-sets="termsource-text-style"> <xsl:value-of select="."/> </fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'origin']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'origin']"> <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> <xsl:if test="normalize-space(@citeas) = ''"> <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute> </xsl:if> <fo:inline xsl:use-attribute-sets="origin-style"> <xsl:apply-templates/> </fo:inline> </fo:basic-link> - </xsl:template><xsl:template match="*[local-name() = 'modification']"> + </xsl:template> + + <!-- not using, see https://github.com/glossarist/iev-document/issues/23 --> + <xsl:template match="*[local-name() = 'modification']"> <xsl:variable name="title-modified"> <xsl:call-template name="getLocalizedString"> <xsl:with-param name="key">modified</xsl:with-param> </xsl:call-template> </xsl:variable> - + <xsl:variable name="text"><xsl:apply-templates/></xsl:variable> <xsl:choose> <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when> <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise> </xsl:choose> <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']"> <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'modification']/text()"> + </xsl:template> + + <xsl:template match="*[local-name() = 'modification']/text()"> <xsl:if test="normalize-space() != ''"> <!-- <xsl:value-of select="."/> --> <xsl:call-template name="text"/> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'quote']"> + </xsl:template> + + <!-- ====== --> + <!-- ====== --> + + <!-- ====== --> + <!-- qoute --> + <!-- source --> + <!-- author --> + <!-- ====== --> + <xsl:template match="*[local-name() = 'quote']"> <fo:block-container margin-left="0mm"> <xsl:if test="parent::*[local-name() = 'note']"> <xsl:if test="not(ancestor::*[local-name() = 'table'])"> <xsl:attribute name="margin-left">5mm</xsl:attribute> </xsl:if> </xsl:if> - - + <fo:block-container margin-left="0mm"> <fo:block-container xsl:use-attribute-sets="quote-style"> - + <fo:block-container margin-left="0mm" margin-right="0mm"> <fo:block role="BlockQuote"> <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source --> </fo:block> </fo:block-container> </fo:block-container> <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']"> <fo:block xsl:use-attribute-sets="quote-source-style"> <!-- — ISO, ISO 7301:2011, Clause 1 --> <xsl:apply-templates select="*[local-name() = 'author']"/> - <xsl:apply-templates select="*[local-name() = 'source']"/> + <xsl:apply-templates select="*[local-name() = 'source']"/> </fo:block> </xsl:if> - + </fo:block-container> </fo:block-container> - </xsl:template><xsl:template match="*[local-name() = 'source']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'source']"> <xsl:if test="../*[local-name() = 'author']"> <xsl:text>, </xsl:text> </xsl:if> <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> <xsl:apply-templates/> </fo:basic-link> - </xsl:template><xsl:template match="*[local-name() = 'author']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'author']"> <xsl:text>— </xsl:text> <xsl:apply-templates/> - </xsl:template><xsl:variable name="bibitems_"> + </xsl:template> + <!-- ====== --> + <!-- ====== --> + + <xsl:variable name="bibitems_"> <xsl:for-each select="//*[local-name() = 'bibitem']"> <xsl:copy-of select="."/> </xsl:for-each> - </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_"> + </xsl:variable> + <xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/> + + <!-- get all hidden bibitems to exclude them from eref/origin processing --> + <xsl:variable name="bibitems_hidden_"> <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']"> <xsl:copy-of select="."/> </xsl:for-each> <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']"> <xsl:copy-of select="."/> </xsl:for-each> - </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']"> + </xsl:variable> + <xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/> + <!-- ====== --> + <!-- eref --> + <!-- ====== --> + <xsl:template match="*[local-name() = 'eref']"> <xsl:variable name="current_bibitemid" select="@bibitemid"/> <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> --> <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/> <xsl:choose> <!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) --> @@ -7177,104 +7537,85 @@ <xsl:if test="@type = 'footnote'"> <xsl:attribute name="keep-together.within-line">always</xsl:attribute> <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> <xsl:attribute name="vertical-align">super</xsl:attribute> <xsl:attribute name="font-size">80%</xsl:attribute> - - </xsl:if> - + + </xsl:if> + <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets --> <xsl:variable name="text" select="normalize-space()"/> - - - - - + <fo:basic-link fox:alt-text="{@citeas}"> <xsl:if test="normalize-space(@citeas) = ''"> <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute> </xsl:if> <xsl:if test="@type = 'inline'"> - - - + <xsl:attribute name="text-decoration">underline</xsl:attribute> - + </xsl:if> - + <xsl:choose> <xsl:when test="$external-destination != ''"> <!-- external hyperlink --> <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute> </xsl:otherwise> </xsl:choose> - + <xsl:apply-templates/> </fo:basic-link> - + </fo:inline> </xsl:when> <xsl:otherwise> <!-- if there is key('bibitems_hidden', $current_bibitemid) --> - + <!-- if in bibitem[@hidden='true'] there is url[@type='src'], then create hyperlink --> <xsl:variable name="uri_src" select="normalize-space($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'src'])"/> <xsl:choose> <xsl:when test="$uri_src != ''"> <fo:basic-link external-destination="{$uri_src}" fox:alt-text="{$uri_src}"><xsl:apply-templates/></fo:basic-link> </xsl:when> <xsl:otherwise><fo:inline><xsl:apply-templates/></fo:inline></xsl:otherwise> </xsl:choose> - + </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'tab']"> + </xsl:template> + <!-- ====== --> + <!-- END eref --> + <!-- ====== --> + + <!-- Tabulation processing --> + <xsl:template match="*[local-name() = 'tab']"> <!-- zero-space char --> <xsl:variable name="depth"> <xsl:call-template name="getLevel"> <xsl:with-param name="depth" select="../@depth"/> </xsl:call-template> </xsl:variable> - + <xsl:variable name="padding"> - - - - - - - - - - - - - - - - - + <xsl:choose> <xsl:when test="ancestor::un:sections and $depth = 1">12</xsl:when> - <xsl:when test="ancestor::un:sections">8</xsl:when> + <xsl:when test="ancestor::un:sections">8</xsl:when> </xsl:choose> - - - - + </xsl:variable> - + <xsl:variable name="padding-right"> <xsl:choose> <xsl:when test="normalize-space($padding) = ''">0</xsl:when> <xsl:otherwise> <xsl:value-of select="normalize-space($padding)"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:choose> <xsl:when test="$lang = 'zh'"> <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline> </xsl:when> <xsl:when test="../../@inline-header = 'true'"> @@ -7287,133 +7628,160 @@ <xsl:otherwise> <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable> <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline> </xsl:otherwise> </xsl:choose> - - </xsl:template><xsl:template name="insertNonBreakSpaces"> + + </xsl:template> <!-- tab --> + + <xsl:template name="insertNonBreakSpaces"> <xsl:param name="count"/> <xsl:if test="$count &gt; 0"> <xsl:text> </xsl:text> <xsl:call-template name="insertNonBreakSpaces"> <xsl:with-param name="count" select="$count - 1"/> </xsl:call-template> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'preferred']"> + </xsl:template> + + <!-- Preferred, admitted, deprecated --> + <xsl:template match="*[local-name() = 'preferred']"> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> <xsl:variable name="font-size"> inherit </xsl:variable> <xsl:variable name="levelTerm"> <xsl:call-template name="getLevelTermName"/> </xsl:variable> <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style"> - - - + <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name --> <fo:block xsl:use-attribute-sets="term-name-style"> <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/> </fo:block> </xsl:if> - + <fo:block xsl:use-attribute-sets="preferred-term-style"> <xsl:call-template name="setStyle_preferred"/> <xsl:apply-templates/> </fo:block> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'domain']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'domain']"> <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline> <xsl:text> </xsl:text> - </xsl:template><xsl:template match="*[local-name() = 'admitted']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'admitted']"> <fo:block xsl:use-attribute-sets="admitted-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'deprecates']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'deprecates']"> <xsl:variable name="title-deprecated"> <xsl:call-template name="getLocalizedString"> <xsl:with-param name="key">deprecated</xsl:with-param> </xsl:call-template> </xsl:variable> <fo:block xsl:use-attribute-sets="deprecates-style"> <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template name="setStyle_preferred"> + </xsl:template> + + <xsl:template name="setStyle_preferred"> <xsl:if test="*[local-name() = 'strong']"> <xsl:attribute name="font-weight">normal</xsl:attribute> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'preferred']/text()[contains(., ';')] | *[local-name() = 'preferred']/*[local-name() = 'strong']/text()[contains(., ';')]"> + </xsl:template> + + <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. --> + <!-- in metanorma xml preferred terms delimited by semicolons --> + <xsl:template match="*[local-name() = 'preferred']/text()[contains(., ';')] | *[local-name() = 'preferred']/*[local-name() = 'strong']/text()[contains(., ';')]"> <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), ';', $linebreak)"/> - </xsl:template><xsl:template match="*[local-name() = 'definition']"> + </xsl:template> + <!-- End Preferred, admitted, deprecated --> + + <!-- ========== --> + <!-- definition --> + <!-- ========== --> + <xsl:template match="*[local-name() = 'definition']"> <fo:block xsl:use-attribute-sets="definition-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]"> + </xsl:template> + + <xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]"> <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]"> + </xsl:template> + <xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]"> <fo:inline> <xsl:apply-templates/></fo:inline> <fo:block/> - </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2"> - + </xsl:template> + <!-- ========== --> + <!-- END definition --> + <!-- ========== --> + + <!-- main sections --> + <xsl:template match="/*/*[local-name() = 'sections']/*" priority="2"> + <fo:block> <xsl:call-template name="setId"/> - - - - - - - - - + <xsl:variable name="num"><xsl:number/></xsl:variable> <xsl:if test="$num = 1"> <xsl:attribute name="margin-top">20pt</xsl:attribute> </xsl:if> - - + <xsl:apply-templates/> </fo:block> - - - - </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* --> + + </xsl:template> + + <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* --> <fo:block break-after="page"/> <fo:block> <xsl:call-template name="setId"/> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'clause']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'clause']"> <fo:block> <xsl:call-template name="setId"/> - - - + <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'definitions']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'definitions']"> <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'annex']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'annex']"> <fo:block break-after="page"/> <fo:block id="{@id}"> - + <xsl:variable name="num"><xsl:number/></xsl:variable> <xsl:if test="$num = 1"> <xsl:attribute name="margin-top">3pt</xsl:attribute> </xsl:if> - + </fo:block> <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl --> + </xsl:template> + + <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl --> <!-- comment 2019-11-29 --> <!-- <fo:block font-weight="bold">Review:</fo:block> <xsl:apply-templates /> --> - + <xsl:variable name="id_from" select="normalize-space(current()/@from)"/> <xsl:choose> <!-- if there isn't the attribute '@from', then --> <xsl:when test="$id_from = ''"> @@ -7422,19 +7790,29 @@ <!-- if there isn't element with id 'from', then create 'bookmark' here --> <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])"> <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block> </xsl:when> </xsl:choose> - - </xsl:template><xsl:template match="*[local-name() = 'name']/text()"> + + </xsl:template> + + <xsl:template match="*[local-name() = 'name']/text()"> <!-- 0xA0 to space replacement --> <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/> - </xsl:template><xsl:variable name="ul_labels_"> - + </xsl:template> + + <!-- ===================================== --> + <!-- Lists processing --> + <!-- ===================================== --> + <xsl:variable name="ul_labels_"> + <label>•</label> - - </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel"> + + </xsl:variable> + <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/> + + <xsl:template name="setULLabel"> <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/> <xsl:variable name="list_level"> <xsl:choose> <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when> <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise> @@ -7452,25 +7830,28 @@ </xsl:when> <xsl:otherwise> <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="label" mode="ul_labels"> + </xsl:template> + <xsl:template match="label" mode="ul_labels"> <xsl:copy-of select="@*[not(local-name() = 'level')]"/> <xsl:value-of select="."/> - </xsl:template><xsl:template name="getListItemFormat"> + </xsl:template> + + <xsl:template name="getListItemFormat"> <!-- Example: for BSI <?list-type loweralpha?> --> <xsl:variable name="processing_instruction_type" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-type'))"/> <xsl:choose> <xsl:when test="local-name(..) = 'ul'"> <xsl:choose> <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/> <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <!-- for ordered lists 'ol' --> - + <!-- Example: for BSI <?list-start 2?> --> <xsl:variable name="processing_instruction_start" select="normalize-space(../preceding-sibling::*[1]/processing-instruction('list-start'))"/> <xsl:variable name="start_value"> <xsl:choose> @@ -7481,28 +7862,28 @@ <xsl:value-of select="number(../@start) - 1"/><!-- if start="3" then start_value=2 + xsl:number(1) = 3 --> </xsl:when> <xsl:otherwise>0</xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="curr_value"><xsl:number/></xsl:variable> - + <xsl:variable name="type"> <xsl:choose> <xsl:when test="normalize-space($processing_instruction_type) != ''"><xsl:value-of select="$processing_instruction_type"/></xsl:when> <xsl:when test="normalize-space(../@type) != ''"><xsl:value-of select="../@type"/></xsl:when> - + <xsl:otherwise> <!-- if no @type or @class = 'steps' --> - + <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/> <xsl:variable name="list_level"> <xsl:choose> <xsl:when test="$list_level_ &lt;= 5"><xsl:value-of select="$list_level_"/></xsl:when> <xsl:otherwise><xsl:value-of select="$list_level_ mod 5"/></xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:choose> <xsl:when test="$list_level mod 5 = 0">roman_upper</xsl:when> <!-- level 5 --> <xsl:when test="$list_level mod 4 = 0">alphabet_upper</xsl:when> <!-- level 4 --> <xsl:when test="$list_level mod 3 = 0">roman</xsl:when> <!-- level 3 --> <xsl:when test="$list_level mod 2 = 0 and ancestor::*/@class = 'steps'">alphabet</xsl:when> <!-- level 2 and @class = 'steps'--> @@ -7512,15 +7893,15 @@ <xsl:when test="ancestor::*/@class = 'steps'">arabic</xsl:when> <xsl:otherwise>alphabet</xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> - + </xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="format"> <xsl:choose> <xsl:when test="$type = 'arabic'"> 1. </xsl:when> @@ -7535,28 +7916,28 @@ </xsl:when> <xsl:when test="$type = 'roman_upper'">I.</xsl:when> <xsl:otherwise>1.</xsl:otherwise> <!-- for any case, if $type has non-determined value, not using --> </xsl:choose> </xsl:variable> - + <xsl:number value="$start_value + $curr_value" format="{normalize-space($format)}" lang="en"/> - + </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']"> <xsl:choose> <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']"> <fo:block-container> <xsl:attribute name="margin-left"> <xsl:choose> <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when> <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise> </xsl:choose> </xsl:attribute> - - - + <fo:block-container margin-left="0mm"> <fo:block> <xsl:apply-templates select="." mode="list"/> </fo:block> </fo:block-container> @@ -7566,90 +7947,94 @@ <fo:block> <xsl:apply-templates select="." mode="list"/> </fo:block> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list"> - + </xsl:template> + + <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list"> + <xsl:apply-templates select="*[local-name() = 'name']"> <xsl:with-param name="process">true</xsl:with-param> </xsl:apply-templates> - + <fo:list-block xsl:use-attribute-sets="list-style"> - - - - - - - - <xsl:if test="*[local-name() = 'name']"> <xsl:attribute name="margin-top">0pt</xsl:attribute> </xsl:if> - + <xsl:apply-templates select="node()[not(local-name() = 'note')]"/> </fo:list-block> <!-- <xsl:for-each select="./iho:note"> <xsl:call-template name="note"/> </xsl:for-each> --> <xsl:apply-templates select="./*[local-name() = 'note']"/> - </xsl:template><xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']"> <xsl:param name="process">false</xsl:param> <xsl:if test="$process = 'true'"> <fo:block xsl:use-attribute-sets="list-name-style"> <xsl:apply-templates/> </fo:block> </xsl:if> - </xsl:template><xsl:template match="*[local-name()='li']"> + </xsl:template> + + <xsl:template match="*[local-name()='li']"> <fo:list-item xsl:use-attribute-sets="list-item-style"> <xsl:copy-of select="@id"/> - - - + <fo:list-item-label end-indent="label-end()"> <fo:block xsl:use-attribute-sets="list-item-label-style"> - - - - - + <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' --> <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]"> <xsl:call-template name="append_add-style"/> </xsl:if> - + <xsl:call-template name="getListItemFormat"/> </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style"> <fo:block> - - - - - + <xsl:apply-templates/> - + <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" /> <xsl:for-each select="./bsi:note"> <xsl:call-template name="note"/> </xsl:for-each> --> </fo:block> </fo:list-item-body> </fo:list-item> - </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="bookmark_in_fn"> + </xsl:template> + + <!-- ===================================== --> + <!-- END Lists processing --> + <!-- ===================================== --> + + <!-- =================== --> + <!-- Index section processing --> + <!-- =================== --> + + <xsl:variable name="index" select="document($external_index)"/> + + <xsl:variable name="bookmark_in_fn"> <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]"> <bookmark><xsl:value-of select="@id"/></bookmark> </xsl:for-each> - </xsl:variable><xsl:template match="@*|node()" mode="index_add_id"> + </xsl:variable> + + <xsl:template match="@*|node()" mode="index_add_id"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="index_add_id"/> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id"> + </xsl:template> + + <xsl:template match="*[local-name() = 'xref']" mode="index_add_id"> <xsl:variable name="id"> <xsl:call-template name="generateIndexXrefId"/> </xsl:variable> <xsl:copy> <!-- add id to xref --> <xsl:apply-templates select="@*" mode="index_add_id"/> @@ -7669,20 +8054,26 @@ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text> </xsl:attribute> <xsl:apply-templates mode="index_add_id"/> </xsl:copy> </xsl:if> - </xsl:template><xsl:template match="@*|node()" mode="index_update"> + </xsl:template> + + <xsl:template match="@*|node()" mode="index_update"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="index_update"/> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update"> + </xsl:template> + + <xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update"> <xsl:copy> <xsl:apply-templates select="@*" mode="index_update"/> <xsl:apply-templates select="node()[1]" mode="process_li_element"/> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2"> <xsl:param name="element"/> <xsl:param name="remove" select="'false'"/> <xsl:param name="target"/> <!-- <node></node> --> <xsl:choose> @@ -7700,32 +8091,32 @@ <xsl:when test="self::* and local-name(.) = 'xref'"> <xsl:variable name="id" select="@id"/> <xsl:variable name="page" select="$index//item[@id = $id]"/> <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/> <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/> - + <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/> <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/> - + <xsl:choose> <!-- 2nd pass --> <!-- if page is equal to page for next and page is not the end of range --> <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 --> <!-- skip element (i.e. remove it) and remove next text ',' --> <!-- [removed_xref] --> - + <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"> <xsl:with-param name="remove">true</xsl:with-param> <xsl:with-param name="target"> <xsl:choose> <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when> <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> </xsl:choose> </xsl:with-param> </xsl:apply-templates> </xsl:when> - + <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... --> <!-- remove xref --> <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"> <xsl:with-param name="remove">true</xsl:with-param> </xsl:apply-templates> @@ -7748,64 +8139,92 @@ <xsl:with-param name="target" select="$target"/> </xsl:apply-templates> <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="@*|node()" mode="xref_copy"> + </xsl:template> + + <xsl:template match="@*|node()" mode="xref_copy"> <xsl:param name="target"/> <xsl:copy> <xsl:apply-templates select="@*" mode="xref_copy"/> <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])"> <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute> </xsl:if> <xsl:apply-templates select="node()" mode="xref_copy"/> </xsl:copy> - </xsl:template><xsl:template name="generateIndexXrefId"> + </xsl:template> + + <xsl:template name="generateIndexXrefId"> <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/> - + <xsl:variable name="docid"> <xsl:call-template name="getDocumentId"/> </xsl:variable> <xsl:variable name="item_number"> <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/> </xsl:variable> <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable> <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', --> - </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4"> + </xsl:template> + + <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4"> <fo:block xsl:use-attribute-sets="indexsect-title-style"> <!-- Index --> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']/*[local-name() = 'title']" priority="4"> + </xsl:template> + + <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']/*[local-name() = 'title']" priority="4"> <!-- Letter A, B, C, ... --> <fo:block xsl:use-attribute-sets="indexsect-clause-title-style"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4"> + </xsl:template> + + <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4"> <xsl:apply-templates/> <fo:block> <xsl:if test="following-sibling::*[local-name() = 'clause']"> <fo:block> </fo:block> </xsl:if> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4"> + </xsl:template> + + <xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4"> <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4"> + </xsl:template> + + <xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4"> <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/> <fo:block start-indent="{5 * $level}mm" text-indent="-5mm"> - + <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/text()"> + </xsl:template> + + <xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/text()"> <!-- to split by '_' and other chars --> <xsl:call-template name="add-zero-spaces-java"/> - </xsl:template><xsl:template match="*[local-name() = 'table']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'bookmark']" name="bookmark"> + </xsl:template> + + <xsl:template match="*[local-name() = 'table']/*[local-name() = 'bookmark']" priority="2"/> + + <xsl:template match="*[local-name() = 'bookmark']" name="bookmark"> <!-- <fo:inline id="{@id}" font-size="1pt"/> --> <fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline> <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml --> <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'errata']"> + </xsl:template> + <!-- =================== --> + <!-- End of Index processing --> + <!-- =================== --> + + <!-- ============ --> + <!-- errata --> + <!-- ============ --> + <xsl:template match="*[local-name() = 'errata']"> <!-- <row> <date>05-07-2013</date> <type>Editorial</type> <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change> <pages>D-3</pages> @@ -7816,79 +8235,107 @@ <fo:table-column column-width="23mm"/> <fo:table-column column-width="107mm"/> <fo:table-column column-width="15mm"/> <fo:table-body> <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white"> - + <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell> <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell> <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell> <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell> </fo:table-row> <xsl:apply-templates/> </fo:table-body> </fo:table> - </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']"> <fo:table-row> <xsl:apply-templates/> </fo:table-row> - </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*"> + </xsl:template> + + <xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*"> <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm"> <fo:block><xsl:apply-templates/></fo:block> </fo:table-cell> - </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/><xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2"> - - - + </xsl:template> + <!-- ============ --> + <!-- END errata --> + <!-- ============ --> + + <!-- ======================= --> + <!-- Bibliography rendering --> + <!-- ======================= --> + + <!-- ========================================================== --> + <!-- Reference sections (Normative References and Bibliography) --> + <!-- ========================================================== --> + <xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/> + <xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/> + <!-- don't display bibitem with @id starts with '_hidden', that was introduced for references integrity --> + <xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/> + + <!-- Normative references --> + <xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2"> + <fo:block id="{@id}"> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'references']"> + </xsl:template> + + <!-- Bibliography (non-normative references) --> + <xsl:template match="*[local-name() = 'references']"> <xsl:if test="not(ancestor::*[local-name() = 'annex'])"> - + </xsl:if> - + <!-- <xsl:if test="ancestor::*[local-name() = 'annex']"> <xsl:if test="$namespace = 'csa' or $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'itu'"> <fo:block break-after="page"/> </xsl:if> </xsl:if> --> - + <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style"> <xsl:apply-templates/> </fo:block> - - - - - </xsl:template><xsl:template match="*[local-name() = 'bibitem']"> + + </xsl:template> <!-- references --> + + <xsl:template match="*[local-name() = 'bibitem']"> <xsl:call-template name="bibitem"/> - </xsl:template><xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2"> - + </xsl:template> + + <!-- Normative references --> + <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2"> + <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style"> <xsl:call-template name="processBibitem"/> </fo:block> - - </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2"> - - + </xsl:template> <!-- bibitem --> + + <!-- Bibliography (non-normative references) --> + <xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" name="bibitem_non_normative" priority="2"> + <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style"> <xsl:call-template name="processBibitem"/> </fo:block> - - - </xsl:template><xsl:template name="processBibitem"> - - + + </xsl:template> <!-- references[not(@normative='true')]/bibitem --> + + <xsl:template name="processBibitem"> + <!-- start UNECE bibitem processing --> <fo:inline padding-right="5mm">[<xsl:value-of select="un:docidentifier"/>]</fo:inline><xsl:value-of select="un:docidentifier"/> <xsl:text> </xsl:text> <xsl:apply-templates select="un:formattedref"/> <!-- END UNECE bibitem processing --> - - </xsl:template><xsl:template name="processBibitemDocId"> + + </xsl:template> <!-- processBibitem (bibitem) --> + + <xsl:template name="processBibitemDocId"> <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/> <xsl:choose> <xsl:when test="normalize-space($_doc_ident) != ''"> <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/> <xsl:if test="$type != '' and not(contains($_doc_ident, $type))"> @@ -7902,11 +8349,13 @@ <xsl:value-of select="$type"/><xsl:text> </xsl:text> </xsl:if> --> <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="processPersonalAuthor"> + </xsl:template> <!-- processBibitemDocId --> + + <xsl:template name="processPersonalAuthor"> <xsl:choose> <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']"> <author> <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/> </author> @@ -7927,30 +8376,43 @@ </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="renderDate"> + </xsl:template> <!-- processPersonalAuthor --> + + <xsl:template name="renderDate"> <xsl:if test="normalize-space(*[local-name() = 'on']) != ''"> <xsl:value-of select="*[local-name() = 'on']"/> </xsl:if> <xsl:if test="normalize-space(*[local-name() = 'from']) != ''"> <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip"> + </xsl:template> + + <xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip"> <xsl:value-of select="translate(.,'. ','')"/> - </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip"> + </xsl:template> + + <xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip"> <xsl:value-of select="substring(.,1,1)"/> - </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title"> + </xsl:template> + + <xsl:template match="*[local-name() = 'title']" mode="title"> <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2"> <!-- <fo:inline><xsl:apply-templates /></fo:inline> --> <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM --> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2"> - + </xsl:template> + + <!-- bibitem/note renders as footnote --> + <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2"> + <!-- list of footnotes to calculate actual footnotes number --> <xsl:variable name="p_fn_"> <xsl:call-template name="get_fn_list"/> </xsl:variable> <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/> @@ -7966,20 +8428,20 @@ </xsl:otherwise> </xsl:choose> </xsl:variable> <fo:footnote> <xsl:variable name="number"> - + <xsl:value-of select="$current_fn_number"/> - + </xsl:variable> - + <xsl:variable name="current_fn_number_text"> <xsl:value-of select="$number"/> - + </xsl:variable> - + <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style"> <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}"> <xsl:value-of select="$current_fn_number_text"/> </fo:basic-link> </fo:inline> @@ -7990,37 +8452,64 @@ </fo:inline> <xsl:apply-templates/> </fo:block> </fo:footnote-body> </fo:footnote> - </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho --> + </xsl:template> + + <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho --> <xsl:text> edition </xsl:text> <xsl:value-of select="."/> - </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho --> + </xsl:template> + + <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho --> <xsl:text> (</xsl:text> <fo:inline xsl:use-attribute-sets="link-style"> <fo:basic-link external-destination="." fox:alt-text="."> - <xsl:value-of select="."/> + <xsl:value-of select="."/> </fo:basic-link> </fo:inline> <xsl:text>)</xsl:text> - </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/><xsl:template match="*[local-name() = 'formattedref']"> - + </xsl:template> + + <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/> + + <xsl:template match="*[local-name() = 'formattedref']"> + <xsl:text>, </xsl:text> - + <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name() = 'form']"> + </xsl:template> + + <!-- ======================= --> + <!-- END Bibliography rendering --> + <!-- ======================= --> + + <!-- ========================================================== --> + <!-- END Reference sections (Normative References and Bibliography) --> + <!-- ========================================================== --> + + <!-- =================== --> + <!-- Form's elements processing --> + <!-- =================== --> + <xsl:template match="*[local-name() = 'form']"> <fo:block> <xsl:apply-templates/> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']"> <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']"> <fo:inline> <xsl:call-template name="text_input"/> </fo:inline> - </xsl:template><xsl:template name="text_input"> + </xsl:template> + + <xsl:template name="text_input"> <xsl:variable name="count"> <xsl:choose> <xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when> <xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when> <xsl:otherwise>10</xsl:otherwise> @@ -8029,19 +8518,23 @@ <xsl:call-template name="repeat"> <xsl:with-param name="char" select="'_'"/> <xsl:with-param name="count" select="$count"/> </xsl:call-template> <xsl:text> </xsl:text> - </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']"> <xsl:variable name="caption"> <xsl:choose> <xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when> <xsl:otherwise>BUTTON</xsl:otherwise> </xsl:choose> </xsl:variable> <fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']"> <fo:inline padding-right="1mm"> <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%"> <xsl:attribute name="height">3.5mm</xsl:attribute> <xsl:attribute name="content-width">100%</xsl:attribute> <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute> @@ -8049,11 +8542,13 @@ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80"> <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/> </svg> </fo:instream-foreign-object> </fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']"> <fo:inline padding-right="1mm"> <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%"> <xsl:attribute name="height">3.5mm</xsl:attribute> <xsl:attribute name="content-width">100%</xsl:attribute> <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute> @@ -8062,30 +8557,46 @@ <circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/> <circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/> </svg> </fo:instream-foreign-object> </fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']"> <fo:inline> <xsl:call-template name="text_input"/> </fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']"> <fo:block-container border="1pt solid black" width="50%"> <fo:block> </fo:block> </fo:block-container> - </xsl:template><xsl:variable name="toc_level"> + </xsl:template> + + <!-- =================== --> + <!-- End Form's elements processing --> + <!-- =================== --> + + <!-- =================== --> + <!-- Table of Contents (ToC) processing --> + <!-- =================== --> + + <xsl:variable name="toc_level"> <!-- https://www.metanorma.org/author/ref/document-attributes/ --> <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:--> <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render --> <xsl:choose> <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml --> <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml --> <xsl:otherwise><!-- default value --> 3 </xsl:otherwise> </xsl:choose> - </xsl:variable><xsl:template match="*[local-name() = 'toc']"> + </xsl:variable> + + <xsl:template match="*[local-name() = 'toc']"> <xsl:param name="colwidths"/> <xsl:variable name="colwidths_"> <xsl:choose> <xsl:when test="not($colwidths)"> <xsl:variable name="toc_table_simple"> @@ -8112,17 +8623,23 @@ <fo:table-body> <xsl:apply-templates/> </fo:table-body> </fo:table> </fo:block> - </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']" priority="2"> + </xsl:template> + + <xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']" priority="2"> <fo:table-row min-height="5mm"> <xsl:apply-templates/> </fo:table-row> - </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']"> <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3"> + </xsl:template> + + <xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3"> <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> --> <xsl:variable name="target" select="@target"/> <xsl:for-each select="*[local-name() = 'tab']"> <xsl:variable name="current_id" select="generate-id()"/> <fo:table-cell> @@ -8144,77 +8661,101 @@ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}"> <fo:page-number-citation ref-id="{$target}"/> </fo:basic-link> </fo:block> </fo:table-cell> - </xsl:template><xsl:template match="*" mode="toc_table_width"> + </xsl:template> + + <!-- ================================== --> + <!-- calculate ToC table columns widths --> + <!-- ================================== --> + <xsl:template match="*" mode="toc_table_width"> <xsl:apply-templates mode="toc_table_width"/> - </xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width"> + </xsl:template> + + <xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/> + <xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/> + + <xsl:template match="*[local-name() = 'li']" mode="toc_table_width"> <tr> <xsl:apply-templates mode="toc_table_width"/> </tr> - </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width"> + </xsl:template> + + <xsl:template match="*[local-name() = 'xref']" mode="toc_table_width"> <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> --> <xsl:for-each select="*[local-name() = 'tab']"> <xsl:variable name="current_id" select="generate-id()"/> <td> <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]"> <xsl:copy-of select="."/> </xsl:for-each> </td> </xsl:for-each> <td>333</td> <!-- page number, just for fill --> - </xsl:template><xsl:template match="*[local-name() = 'variant-title']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"> + </xsl:template> + + <!-- ================================== --> + <!-- END: calculate ToC table columns widths --> + <!-- ================================== --> + + <!-- =================== --> + <!-- End Table of Contents (ToC) processing --> + <!-- =================== --> + + <xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] --> + <xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"> <fo:inline padding-right="5mm"> </fo:inline> <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare"> + </xsl:template> + + <xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare"> <fo:inline padding-right="2.5mm" baseline-shift="5%"> <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2"> <rect x="0" y="0" width="2" height="2" fill="black"/> </svg> - </fo:instream-foreign-object> + </fo:instream-foreign-object> </fo:inline> - </xsl:template><xsl:template match="@language"> + </xsl:template> + + <xsl:template match="@language"> <xsl:copy-of select="."/> - </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="4"> + </xsl:template> + + <xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="4"> <xsl:call-template name="title"/> - </xsl:template><xsl:template match="*[local-name() = 'admonition']"> - - - + </xsl:template> + + <!-- ================ --> + <!-- Admonition --> + <!-- ================ --> + <xsl:template match="*[local-name() = 'admonition']"> + <!-- display name before box --> <fo:block xsl:use-attribute-sets="admonition-name-style"> <xsl:call-template name="displayAdmonitionName"/> </fo:block> - - + <!-- text in the box --> <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style"> - - - - - - - + <fo:block-container xsl:use-attribute-sets="admonition-container-style"> - - - - + <fo:block-container margin-left="0mm" margin-right="0mm"> <fo:block> <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> </fo:block> </fo:block-container> - + </fo:block-container> - + </fo:block-container> - - </xsl:template><xsl:template name="displayAdmonitionName"> + + </xsl:template> + + <xsl:template name="displayAdmonitionName"> <xsl:param name="sep"/> <!-- Example: ' - ' --> <!-- <xsl:choose> <xsl:when test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'"> <xsl:choose> <xsl:when test="@type='important'"><xsl:apply-templates select="@type"/></xsl:when> @@ -8235,120 +8776,174 @@ </xsl:variable> <xsl:copy-of select="$name"/> <xsl:if test="normalize-space($name) != ''"> <xsl:value-of select="$sep"/> </xsl:if> - </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']"> + </xsl:template> + + <xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']"> <xsl:apply-templates/> - </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']"> - + </xsl:template> + + <!-- <xsl:template match="*[local-name() = 'admonition']/@type"> + <xsl:variable name="admonition_type_"> + <xsl:call-template name="getLocalizedString"> + <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/> + <xsl:value-of select="$admonition_type"/> + <xsl:if test="$admonition_type = ''"> + <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/> + </xsl:if> + </xsl:template> --> + + <xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']"> + <fo:block xsl:use-attribute-sets="admonition-p-style"> - - - + <xsl:apply-templates/> </fo:block> - - </xsl:template><xsl:template match="@*|node()" mode="update_xml_step1"> + + </xsl:template> + + <!-- ================ --> + <!-- END Admonition --> + <!-- ================ --> + + <!-- ===================================== --> + <!-- Update xml --> + <!-- ===================================== --> + <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder --> + <xsl:template match="@*|node()" mode="update_xml_step1"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1"> + </xsl:template> + + <!-- change section's order based on @displayorder value --> + <xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1"> <xsl:copy> <xsl:copy-of select="@*"/> - + <xsl:variable name="nodes_preface_"> <xsl:for-each select="*"> <node id="{@id}"/> </xsl:for-each> </xsl:variable> <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/> - + <xsl:for-each select="*"> <xsl:sort select="@displayorder" data-type="number"/> - + <!-- process Section's title --> <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/> <xsl:if test="$preceding-sibling_id != ''"> <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/> </xsl:if> - + <xsl:choose> <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when> <xsl:otherwise> <xsl:apply-templates select="." mode="update_xml_step1"/> </xsl:otherwise> </xsl:choose> - + </xsl:for-each> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'sections']" mode="update_xml_step1"> + </xsl:template> + + <xsl:template match="*[local-name() = 'sections']" mode="update_xml_step1"> <xsl:copy> <xsl:copy-of select="@*"/> - + <xsl:variable name="nodes_sections_"> <xsl:for-each select="*"> <node id="{@id}"/> </xsl:for-each> </xsl:variable> <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/> - + <!-- move section 'Normative references' inside 'sections' --> <xsl:for-each select="* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]"> <xsl:sort select="@displayorder" data-type="number"/> - + <!-- process Section's title --> <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/> <xsl:if test="$preceding-sibling_id != ''"> <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/> </xsl:if> - + <xsl:choose> <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when> <xsl:otherwise> <xsl:apply-templates select="." mode="update_xml_step1"/> </xsl:otherwise> </xsl:choose> - + </xsl:for-each> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'bibliography']" mode="update_xml_step1"> + </xsl:template> + + <xsl:template match="*[local-name() = 'bibliography']" mode="update_xml_step1"> <xsl:copy> <xsl:copy-of select="@*"/> <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') --> <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="." mode="update_xml_step1"/> </xsl:for-each> </xsl:copy> - </xsl:template><xsl:template match="*[local-name() = 'span']" mode="update_xml_step1"> + </xsl:template> + + <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2"> + <xsl:copy> + <xsl:copy-of select="@*"/> + <xsl:apply-templates mode="update_xml_step1"/> + </xsl:copy> + </xsl:template> + <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output --> + <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1"> <xsl:apply-templates mode="update_xml_step1"/> - </xsl:template><xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line"> + </xsl:template> + + <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder --> + + <!-- XML UPDATE STEP: enclose standard's name into tag 'keep-together_within-line' --> + <!-- Example: <keep-together_within-line>ISO 10303-51</keep-together_within-line> --> + <xsl:template match="@*|node()" mode="update_xml_enclose_keep-together_within-line"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="update_xml_enclose_keep-together_within-line"/> </xsl:copy> - </xsl:template><xsl:variable name="express_reference_separators">_.\</xsl:variable><xsl:variable name="express_reference_characters" select="concat($upper,$lower,'1234567890',$express_reference_separators)"/><xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable><xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line"> - + </xsl:template> + + <xsl:variable name="express_reference_separators">_.\</xsl:variable> + <xsl:variable name="express_reference_characters" select="concat($upper,$lower,'1234567890',$express_reference_separators)"/> + + <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable> + + <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line"> + <!-- enclose standard's number into tag 'keep-together_within-line' --> <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable> <xsl:variable name="tag_keep-together_within-line_open">###<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable> <xsl:variable name="tag_keep-together_within-line_close">###/<xsl:value-of select="$element_name_keep-together_within-line"/>###</xsl:variable> <xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/> <xsl:variable name="text"><text><xsl:call-template name="replace_text_tags"> <xsl:with-param name="tag_open" select="$tag_keep-together_within-line_open"/> <xsl:with-param name="tag_close" select="$tag_keep-together_within-line_close"/> <xsl:with-param name="text" select="$text_"/> </xsl:call-template></text></xsl:variable> - + <xsl:variable name="parent" select="local-name(..)"/> - + <xsl:variable name="text2"> <text><xsl:for-each select="xalan:nodeset($text)/text/node()"> <xsl:copy-of select="."/> </xsl:for-each></text> </xsl:variable> - + <!-- keep-together_within-line for: a/b, aaa/b, a/bbb, /b --> <xsl:variable name="regex_solidus_units">((\b((\S{1,3}\/\S+)|(\S+\/\S{1,3}))\b)|(\/\S{1,3})\b)</xsl:variable> <xsl:variable name="text3"> <text><xsl:for-each select="xalan:nodeset($text2)/text/node()"> <xsl:choose> @@ -8363,11 +8958,11 @@ </xsl:when> <xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise> <!-- copy 'as-is' for <fo:inline keep-together.within-line="always" ... --> </xsl:choose> </xsl:for-each></text> </xsl:variable> - + <xsl:choose> <xsl:when test="ancestor::*[local-name() = 'td' or local-name() = 'th']"> <!-- keep-together_within-line for: a.b, aaa.b, a.bbb, .b in table's cell ONLY --> <xsl:variable name="regex_dots_units">((\b((\S{1,3}\.\S+)|(\S+\.\S{1,3}))\b)|(\.\S{1,3})\b)</xsl:variable> <xsl:for-each select="xalan:nodeset($text3)/text/node()"> @@ -8385,35 +8980,46 @@ </xsl:choose> </xsl:for-each> </xsl:when> <xsl:otherwise><xsl:copy-of select="xalan:nodeset($text3)/text/node()"/></xsl:otherwise> </xsl:choose> - - </xsl:template><xsl:template name="replace_text_tags"> + + </xsl:template> + + <xsl:template name="replace_text_tags"> <xsl:param name="tag_open"/> <xsl:param name="tag_close"/> <xsl:param name="text"/> <xsl:choose> <xsl:when test="contains($text, $tag_open)"> <xsl:value-of select="substring-before($text, $tag_open)"/> <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/> - + <xsl:element name="{substring-before(substring-after($tag_open, '###'),'###')}"> <xsl:value-of select="substring-before($text_after, $tag_close)"/> </xsl:element> - + <xsl:call-template name="replace_text_tags"> <xsl:with-param name="tag_open" select="$tag_open"/> <xsl:with-param name="tag_close" select="$tag_close"/> <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/> </xsl:call-template> </xsl:when> <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*[local-name() = 'lang_none']"> + </xsl:template> + + <!-- ===================================== --> + <!-- End Update xml --> + <!-- ===================================== --> + + <!-- for correct rendering combining chars --> + <xsl:template match="*[local-name() = 'lang_none']"> <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline> - </xsl:template><xsl:template name="printEdition"> + </xsl:template> + + <xsl:template name="printEdition"> <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/> <xsl:text> </xsl:text> <xsl:choose> <xsl:when test="$edition_i18n != ''"> <!-- Example: <edition language="fr">deuxième édition</edition> --> @@ -8434,11 +9040,14 @@ <xsl:text> </xsl:text> <xsl:value-of select="$edition"/> </xsl:if> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="convertDate"> + </xsl:template> + + <!-- convert YYYY-MM-DD to 'Month YYYY' or 'Month DD, YYYY' or DD Month YYYY --> + <xsl:template name="convertDate"> <xsl:param name="date"/> <xsl:param name="format" select="'short'"/> <xsl:variable name="year" select="substring($date, 1, 4)"/> <xsl:variable name="month" select="substring($date, 6, 2)"/> <xsl:variable name="day" select="substring($date, 9, 2)"/> @@ -8469,11 +9078,14 @@ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/> <!-- January 01, 2022 --> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="$result"/> - </xsl:template><xsl:template name="getMonthByNum"> + </xsl:template> <!-- convertDate --> + + <!-- return Month's name by number --> + <xsl:template name="getMonthByNum"> <xsl:param name="num"/> <xsl:param name="lang">en</xsl:param> <xsl:param name="lowercase">false</xsl:param> <!-- return 'january' instead of 'January' --> <xsl:variable name="monthStr_"> <xsl:choose> @@ -8515,11 +9127,14 @@ <xsl:when test="normalize-space($lowercase) = 'true'"> <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($monthStr_))"/> </xsl:when> <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="getMonthLocalizedByNum"> + </xsl:template> <!-- getMonthByNum --> + + <!-- return Month's name by number from localized strings --> + <xsl:template name="getMonthLocalizedByNum"> <xsl:param name="num"/> <xsl:variable name="monthStr"> <xsl:choose> <xsl:when test="$num = '01'">january</xsl:when> <xsl:when test="$num = '02'">february</xsl:when> @@ -8536,11 +9151,13 @@ </xsl:choose> </xsl:variable> <xsl:call-template name="getLocalizedString"> <xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param> </xsl:call-template> - </xsl:template><xsl:template name="insertKeywords"> + </xsl:template> <!-- getMonthLocalizedByNum --> + + <xsl:template name="insertKeywords"> <xsl:param name="sorting" select="'true'"/> <xsl:param name="meta" select="'false'"/> <xsl:param name="charAtEnd" select="'.'"/> <xsl:param name="charDelim" select="', '"/> <xsl:choose> @@ -8562,11 +9179,13 @@ <xsl:with-param name="charDelim" select="$charDelim"/> </xsl:call-template> </xsl:for-each> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="insertKeyword"> + </xsl:template> + + <xsl:template name="insertKeyword"> <xsl:param name="charAtEnd"/> <xsl:param name="charDelim"/> <xsl:param name="meta"/> <xsl:choose> <xsl:when test="$meta = 'true'"> @@ -8578,11 +9197,13 @@ </xsl:choose> <xsl:choose> <xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when> <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="addPDFUAmeta"> + </xsl:template> + + <xsl:template name="addPDFUAmeta"> <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf"> <pdf:dictionary type="normal" key="ViewerPreferences"> <pdf:boolean key="DisplayDocTitle">true</pdf:boolean> </pdf:dictionary> </pdf:catalog> @@ -8591,39 +9212,39 @@ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about=""> <!-- Dublin Core properties go here --> <dc:title> <xsl:variable name="title"> <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']"> - + <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/> - + </xsl:for-each> </xsl:variable> <xsl:choose> <xsl:when test="normalize-space($title) != ''"> <xsl:value-of select="$title"/> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> - </xsl:choose> + </xsl:choose> </dc:title> <dc:creator> <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']"> - + <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']"> <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/> <xsl:if test="position() != last()">; </xsl:if> </xsl:for-each> - + </xsl:for-each> </dc:creator> <dc:description> <xsl:variable name="abstract"> - - <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/> - + + <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/> + </xsl:variable> <xsl:value-of select="normalize-space($abstract)"/> </dc:description> <pdf:Keywords> <xsl:call-template name="insertKeywords"> @@ -8635,20 +9256,25 @@ <!-- XMP properties go here --> <xmp:CreatorTool/> </rdf:Description> </rdf:RDF> </x:xmpmeta> - </xsl:template><xsl:template name="getId"> + </xsl:template> <!-- addPDFUAmeta --> + + <xsl:template name="getId"> <xsl:choose> <xsl:when test="../@id"> <xsl:value-of select="../@id"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="concat(generate-id(..), '_', text())"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="getLevel"> + </xsl:template> + + <!-- Get or calculate depth of the element --> + <xsl:template name="getLevel"> <xsl:param name="depth"/> <xsl:choose> <xsl:when test="normalize-space(@depth) != ''"> <xsl:value-of select="@depth"/> </xsl:when> @@ -8688,11 +9314,14 @@ </xsl:choose> </xsl:variable> <xsl:value-of select="$level"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="getLevelTermName"> + </xsl:template> <!-- getLevel --> + + <!-- Get or calculate depth of term's name --> + <xsl:template name="getLevelTermName"> <xsl:choose> <xsl:when test="normalize-space(../@depth) != ''"> <xsl:value-of select="../@depth"/> </xsl:when> <xsl:otherwise> @@ -8708,11 +9337,14 @@ <xsl:call-template name="getLevel"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="split"> + </xsl:template> <!-- getLevelTermName --> + + <!-- split string by separator --> + <xsl:template name="split"> <xsl:param name="pText" select="."/> <xsl:param name="sep" select="','"/> <xsl:param name="normalize-space" select="'true'"/> <xsl:param name="keep_sep" select="'false'"/> <xsl:if test="string-length($pText) &gt;0"> @@ -8732,113 +9364,111 @@ <xsl:with-param name="sep" select="$sep"/> <xsl:with-param name="normalize-space" select="$normalize-space"/> <xsl:with-param name="keep_sep" select="$keep_sep"/> </xsl:call-template> </xsl:if> - </xsl:template><xsl:template name="getDocumentId"> + </xsl:template> <!-- split --> + + <xsl:template name="getDocumentId"> <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/> - </xsl:template><xsl:template name="namespaceCheck"> + </xsl:template> + + <xsl:template name="namespaceCheck"> <xsl:variable name="documentNS" select="namespace-uri(/*)"/> - <xsl:variable name="XSLNS"> - - - - - - + <xsl:variable name="XSLNS"> + <xsl:value-of select="document('')//*/namespace::un"/> - - - - - - - - - - - - + </xsl:variable> <xsl:if test="$documentNS != $XSLNS"> <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message> </xsl:if> - </xsl:template><xsl:template name="getLanguage"> - <xsl:param name="lang"/> + </xsl:template> <!-- namespaceCheck --> + + <xsl:template name="getLanguage"> + <xsl:param name="lang"/> <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/> <xsl:choose> <xsl:when test="$language = 'en'">English</xsl:when> <xsl:when test="$language = 'fr'">French</xsl:when> <xsl:when test="$language = 'de'">Deutsch</xsl:when> <xsl:when test="$language = 'cn'">Chinese</xsl:when> <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="setId"> + </xsl:template> + + <xsl:template name="setId"> <xsl:attribute name="id"> <xsl:choose> <xsl:when test="@id"> <xsl:value-of select="@id"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="generate-id()"/> </xsl:otherwise> - </xsl:choose> + </xsl:choose> </xsl:attribute> - </xsl:template><xsl:template name="add-letter-spacing"> + </xsl:template> + + <xsl:template name="add-letter-spacing"> <xsl:param name="text"/> <xsl:param name="letter-spacing" select="'0.15'"/> <xsl:if test="string-length($text) &gt; 0"> <xsl:variable name="char" select="substring($text, 1, 1)"/> <fo:inline padding-right="{$letter-spacing}mm"> <xsl:if test="$char = '®'"> <xsl:attribute name="font-size">58%</xsl:attribute> <xsl:attribute name="baseline-shift">30%</xsl:attribute> - </xsl:if> + </xsl:if> <xsl:value-of select="$char"/> </fo:inline> <xsl:call-template name="add-letter-spacing"> <xsl:with-param name="text" select="substring($text, 2)"/> <xsl:with-param name="letter-spacing" select="$letter-spacing"/> </xsl:call-template> </xsl:if> - </xsl:template><xsl:template name="repeat"> + </xsl:template> + + <xsl:template name="repeat"> <xsl:param name="char" select="'*'"/> <xsl:param name="count"/> <xsl:if test="$count &gt; 0"> <xsl:value-of select="$char"/> <xsl:call-template name="repeat"> <xsl:with-param name="char" select="$char"/> <xsl:with-param name="count" select="$count - 1"/> </xsl:call-template> </xsl:if> - </xsl:template><xsl:template name="getLocalizedString"> + </xsl:template> + + <xsl:template name="getLocalizedString"> <xsl:param name="key"/> <xsl:param name="formatted">false</xsl:param> <xsl:param name="lang"/> <xsl:param name="returnEmptyIfNotFound">false</xsl:param> - + <xsl:variable name="curr_lang"> <xsl:choose> <xsl:when test="$lang != ''"><xsl:value-of select="$lang"/></xsl:when> <xsl:when test="$returnEmptyIfNotFound = 'true'"/> <xsl:otherwise> <xsl:call-template name="getLang"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:variable name="data_value"> <xsl:choose> <xsl:when test="$formatted = 'true'"> <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/> </xsl:otherwise> </xsl:choose> </xsl:variable> - + <xsl:choose> <xsl:when test="normalize-space($data_value) != ''"> <xsl:choose> <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when> <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise> @@ -8862,11 +9492,13 @@ </xsl:call-template> </xsl:variable> <xsl:value-of select="$key_"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="setTrackChangesStyles"> + </xsl:template> <!-- getLocalizedString --> + + <xsl:template name="setTrackChangesStyles"> <xsl:param name="isAdded"/> <xsl:param name="isDeleted"/> <xsl:choose> <xsl:when test="local-name() = 'math'"> <xsl:if test="$isAdded = 'true'"> @@ -8888,24 +9520,33 @@ </xsl:if> <xsl:attribute name="padding">2mm</xsl:attribute> </xsl:if> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:variable name="LRM" select="'‎'"/><xsl:variable name="RLM" select="'‏'"/><xsl:template name="setWritingMode"> + </xsl:template> <!-- setTrackChangesStyles --> + + <!-- see https://xmlgraphics.apache.org/fop/2.5/complexscripts.html#bidi_controls--> + <xsl:variable name="LRM" select="'‎'"/> <!-- U+200E - LEFT-TO-RIGHT MARK (LRM) --> + <xsl:variable name="RLM" select="'‏'"/> <!-- U+200F - RIGHT-TO-LEFT MARK (RLM) --> + <xsl:template name="setWritingMode"> <xsl:if test="$lang = 'ar'"> <xsl:attribute name="writing-mode">rl-tb</xsl:attribute> </xsl:if> - </xsl:template><xsl:template name="setAlignment"> + </xsl:template> + + <xsl:template name="setAlignment"> <xsl:param name="align" select="normalize-space(@align)"/> <xsl:choose> <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when> <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when> <xsl:when test="$align != ''"> <xsl:value-of select="$align"/> </xsl:when> </xsl:choose> - </xsl:template><xsl:template name="setTextAlignment"> + </xsl:template> + + <xsl:template name="setTextAlignment"> <xsl:param name="default">left</xsl:param> <xsl:variable name="align" select="normalize-space(@align)"/> <xsl:attribute name="text-align"> <xsl:choose> <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when> @@ -8917,11 +9558,13 @@ </xsl:choose> </xsl:attribute> <xsl:if test="$align = 'indent'"> <xsl:attribute name="margin-left">7mm</xsl:attribute> </xsl:if> - </xsl:template><xsl:template name="number-to-words"> + </xsl:template> + + <xsl:template name="number-to-words"> <xsl:param name="number"/> <xsl:param name="first"/> <xsl:if test="$number != ''"> <xsl:variable name="words"> <words> @@ -9073,11 +9716,11 @@ </xsl:choose> </words> </xsl:variable> <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/> - + <xsl:variable name="value"> <xsl:choose> <xsl:when test="$ordinal != ''"> <xsl:value-of select="$ordinal"/> </xsl:when> @@ -9113,16 +9756,19 @@ <xsl:otherwise> <xsl:value-of select="$value"/> </xsl:otherwise> </xsl:choose> </xsl:if> - </xsl:template><xsl:template name="number-to-ordinal"> + </xsl:template> <!-- number-to-words --> + + <!-- st for 1, nd for 2, rd for 3, th for 4, 5, 6, ... --> + <xsl:template name="number-to-ordinal"> <xsl:param name="number"/> <xsl:param name="curr_lang"/> <xsl:choose> <xsl:when test="$curr_lang = 'fr'"> - <xsl:choose> + <xsl:choose> <xsl:when test="$number = '1'">re</xsl:when> <xsl:otherwise>e</xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> @@ -9132,21 +9778,26 @@ <xsl:when test="$number = 3">rd</xsl:when> <xsl:otherwise>th</xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template name="setAltText"> + </xsl:template> <!-- number-to-ordinal --> + + <!-- add the attribute fox:alt-text, required for PDF/UA --> + <xsl:template name="setAltText"> <xsl:param name="value"/> <xsl:attribute name="fox:alt-text"> <xsl:choose> <xsl:when test="normalize-space($value) != ''"> <xsl:value-of select="$value"/> </xsl:when> <xsl:otherwise>_</xsl:otherwise> </xsl:choose> </xsl:attribute> - </xsl:template><xsl:template name="substring-after-last"> + </xsl:template> + + <xsl:template name="substring-after-last"> <xsl:param name="value"/> <xsl:param name="delimiter"/> <xsl:choose> <xsl:when test="contains($value, $delimiter)"> <xsl:call-template name="substring-after-last"> @@ -9156,11 +9807,13 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="$value"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template match="*" mode="print_as_xml"> + </xsl:template> + + <xsl:template match="*" mode="print_as_xml"> <xsl:param name="level">0</xsl:param> <fo:block margin-left="{2*$level}mm"> <xsl:text> &lt;</xsl:text> @@ -9171,19 +9824,19 @@ <xsl:text>="</xsl:text> <xsl:value-of select="."/> <xsl:text>"</xsl:text> </xsl:for-each> <xsl:text>&gt;</xsl:text> - + <xsl:if test="not(*)"> <fo:inline font-weight="bold"><xsl:value-of select="."/></fo:inline> <xsl:text>&lt;/</xsl:text> <xsl:value-of select="local-name()"/> <xsl:text>&gt;</xsl:text> </xsl:if> </fo:block> - + <xsl:if test="*"> <fo:block> <xsl:apply-templates mode="print_as_xml"> <xsl:with-param name="level" select="$level + 1"/> </xsl:apply-templates> @@ -9192,6 +9845,8 @@ <xsl:text>&lt;/</xsl:text> <xsl:value-of select="local-name()"/> <xsl:text>&gt;</xsl:text> </fo:block> </xsl:if> - </xsl:template></xsl:stylesheet> + </xsl:template> + +</xsl:stylesheet> \ No newline at end of file