lib/isodoc/ogc/ogc.reference-model.xsl in metanorma-ogc-1.0.7 vs lib/isodoc/ogc/ogc.reference-model.xsl in metanorma-ogc-1.0.8

- old
+ new

@@ -187,18 +187,11 @@ <xsl:copy-of select="/ogc:ogc-standard/ogc:bibdata/ogc:abstract//text()"/> </xsl:variable> <xsl:value-of select="normalize-space($abstract)"/> </dc:description> <pdf:Keywords> - <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata//ogc:keyword"> - <xsl:sort data-type="text" order="ascending"/> - <xsl:apply-templates/> - <xsl:choose> - <xsl:when test="position() != last()">, </xsl:when> - <xsl:otherwise>.</xsl:otherwise> - </xsl:choose> - </xsl:for-each> + <xsl:call-template name="insertKeywords"/> </pdf:Keywords> </rdf:Description> <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about=""> <!-- XMP properties go here --> <xmp:CreatorTool/> @@ -911,14 +904,18 @@ <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="2mm"> </fo:inline> <xsl:text>Keywords</xsl:text> </fo:block> <fo:block margin-bottom="12pt">The following are keywords to be used by search engines and document catalogues.</fo:block> <fo:block margin-bottom="12pt"> - <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:keyword"> + <xsl:call-template name="insertKeywords"> + <xsl:with-param name="sorting">no</xsl:with-param> + <xsl:with-param name="charAtEnd"/> + </xsl:call-template> + <!-- <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:keyword"> <xsl:value-of select="."/> <xsl:if test="position() != last()">, </xsl:if> - </xsl:for-each> + </xsl:for-each> --> </fo:block> </xsl:template> <!-- Submitting Organizations --> <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:organization/ogc:name"> <xsl:param name="sectionNum" select="'1'"/> @@ -1600,63 +1597,12 @@ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> <xsl:value-of select="@citeas" disable-output-escaping="yes"/> <xsl:apply-templates select="ogc:localityStack"/> </fo:basic-link> </xsl:template> + - <xsl:template match="ogc:appendix"> - <fo:block font-size="12pt" font-weight="bold" margin-top="12pt" margin-bottom="12pt"> - <fo:inline padding-right="5mm">Appendix <xsl:number/></fo:inline> - <xsl:apply-templates select="ogc:title" mode="process"/> - </fo:block> - <xsl:apply-templates/> - </xsl:template> - - <xsl:template match="ogc:appendix//ogc:example"> - <fo:block font-size="10pt" margin-bottom="12pt"> - <xsl:text>EXAMPLE</xsl:text> - <xsl:if test="ogc:name"> - <xsl:text> — </xsl:text><xsl:apply-templates select="ogc:name" mode="process"/> - </xsl:if> - </fo:block> - <xsl:apply-templates/> - </xsl:template> - - <xsl:template match="ogc:appendix//ogc:example/ogc:name"/> - <xsl:template match="ogc:appendix//ogc:example/ogc:name" mode="process"> - <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template> - - <xsl:template match="ogc:callout"> - <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link> - </xsl:template> - - <xsl:template match="ogc:annotation"> - <fo:block> - - </fo:block> - <xsl:apply-templates/> - </xsl:template> - - <xsl:template match="ogc:annotation/text()"/> - - <xsl:template match="ogc:annotation/ogc:p"> - <xsl:variable name="annotation-id" select="../@id"/> - <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/> - <fo:block id="{$annotation-id}"> - <xsl:value-of select="concat('&lt;', $callout, '&gt; ')"/> - <xsl:apply-templates/> - </fo:block> - </xsl:template> - - - <xsl:template match="ogc:appendix/ogc:title"/> - <xsl:template match="ogc:appendix/ogc:title" mode="process"> - <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template> - - <xsl:template match="ogc:xref"> <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}"> <xsl:variable name="section" select="xalan:nodeset($contents)//item[@id = current()/@target]/@section"/> <!-- <xsl:if test="not(starts-with($section, 'Figure') or starts-with($section, 'Table'))"> --> <xsl:attribute name="color">blue</xsl:attribute> @@ -1680,21 +1626,12 @@ </xsl:otherwise> </xsl:choose> </fo:basic-link> </xsl:template> - <xsl:template match="ogc:sourcecode"> - <fo:block font-family="Courier" font-size="10pt" margin-bottom="6pt" keep-with-next="always" line-height="113%"> - <xsl:choose> - <xsl:when test="@lang = 'en'"/> - <xsl:otherwise> - <xsl:attribute name="white-space">pre</xsl:attribute> - <xsl:attribute name="wrap-option">wrap</xsl:attribute> - </xsl:otherwise> - </xsl:choose> - <xsl:apply-templates/> - </fo:block> + <xsl:template match="ogc:sourcecode" priority="2"> + <xsl:call-template name="sourcecode"/> <xsl:choose> <xsl:when test="@unnumbered='true'"/> <xsl:when test="ancestor::ogc:example"/> <xsl:when test="ancestor::ogc:td"/> <xsl:when test="ancestor::ogc:annex"> @@ -1884,15 +1821,11 @@ <xsl:template match="ogc:pagebreak"> <fo:block break-after="page"/> <fo:block> </fo:block> <fo:block break-after="page"/> </xsl:template> - - <xsl:template match="ogc:bookmark"> - <fo:inline id="{@id}"/> - </xsl:template> - + <xsl:template name="insertHeaderFooter"> <xsl:param name="pagenum-font-weight" select="'normal'"/> <fo:static-content flow-name="header-even"> <fo:block-container height="17mm" display-align="before"> <fo:block padding-top="12.5mm"> @@ -2064,23 +1997,93 @@ </xsl:choose> </xsl:variable> <xsl:value-of select="$section"/> </xsl:template> -<xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="linebreak" select="'&#8232;'"/><xsl:attribute-set xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="link-style"> +<xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-table"> + <xsl:text>Table </xsl:text> + + + </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-note"> + + <xsl:text>NOTE </xsl:text> + + + </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-figure"> + + <xsl:text>Figure </xsl:text> + + + </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-example"> + + <xsl:text>EXAMPLE </xsl:text> + + + </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-inequality">Inequality </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-equation">Equation </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-annex"> + + <xsl:text>Annex </xsl:text> + + + </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-appendix"> + <xsl:text>Appendix </xsl:text> + </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-clause"> + + <xsl:text>Clause </xsl:text> + + + </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-edition"> + <xsl:text>Edition </xsl:text> + </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-toc"> + + + </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-page">Page</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-key">Key</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-where">where</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-descriptors">Descriptors</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-part-en">Part </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-part-fr">Partie </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-note-to-entry">Note # to entry: </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-modified">modified</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-source">SOURCE</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-keywords">Keywords</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="linebreak" select="'&#8232;'"/><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="link-style"> + <xsl:attribute name="color">blue</xsl:attribute> <xsl:attribute name="text-decoration">underline</xsl:attribute> - </xsl:attribute-set><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="text()"> + </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="sourcecode-style"> + + + + + + + + <xsl:attribute name="font-family">Courier</xsl:attribute> + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + <xsl:attribute name="line-height">113%</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-style"> + + <xsl:attribute name="font-size">12pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="margin-top">12pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + + + </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="appendix-example-style"> + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-top">8pt</xsl:attribute> + <xsl:attribute name="margin-bottom">8pt</xsl:attribute> + + + + </xsl:attribute-set><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()"> <xsl:value-of select="."/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='br']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='br']"> <xsl:value-of select="$linebreak"/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1"> - <xsl:call-template name="add-zero-spaces"/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='table']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1"> + <!-- <xsl:call-template name="add-zero-spaces"/> --> + <xsl:call-template name="add-zero-spaces-java"/> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']"> <xsl:variable name="simple-table"> <!-- <xsl:copy> --> <xsl:call-template name="getSimpleTable"/> <!-- </xsl:copy> --> @@ -2111,35 +2114,17 @@ <xsl:attribute name="font-weight">normal</xsl:attribute> <xsl:attribute name="font-size">11pt</xsl:attribute> - <xsl:text>Table </xsl:text> - <xsl:choose> - <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST --> - <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/> - </xsl:when> - <xsl:when test="ancestor::*[local-name()='annex']"> - - - - <xsl:number format="A." count="*[local-name()='annex']"/><xsl:number format="1"/> - - - - - - - </xsl:when> - <xsl:otherwise> - - - <xsl:number format="A." count="*[local-name()='annex']"/> - <xsl:number format="1" level="any" count="//*[local-name()='table'] [not(ancestor::*[local-name()='annex']) and not(ancestor::*[local-name()='executivesummary']) and not(ancestor::*[local-name()='bibdata'])] [not(@unnumbered) or @unnumbered != 'true']"/> - - </xsl:otherwise> - </xsl:choose> + + + <xsl:value-of select="$title-table"/> + + <xsl:call-template name="getTableNumber"/> + + <xsl:if test="*[local-name()='name']"> <xsl:text> — </xsl:text> @@ -2209,10 +2194,11 @@ <xsl:attribute name="margin-left">0mm</xsl:attribute> <xsl:attribute name="margin-right">0mm</xsl:attribute> <xsl:attribute name="space-after">12pt</xsl:attribute> + <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true"> @@ -2225,13 +2211,14 @@ <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:for-each select="xalan:nodeset($colwidths)//column"> <xsl:choose> - <xsl:when test=". = 1"> + <xsl:when test=". = 1 or . = 0"> <fo:table-column column-width="proportional-column-width(2)"/> </xsl:when> <xsl:otherwise> <fo:table-column column-width="proportional-column-width({.})"/> </xsl:otherwise> @@ -2241,28 +2228,53 @@ </fo:table> </fo:block-container> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='table']/*[local-name()='name']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='table']/*[local-name()='name']" mode="process"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getTableNumber"> + <xsl:choose> + <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST --> + <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/> + </xsl:when> + <xsl:when test="ancestor::*[local-name()='annex']"> + + + + <xsl:number format="A." count="*[local-name()='annex']"/><xsl:number format="1"/> + + + + + + + </xsl:when> + <xsl:otherwise> + + + <xsl:number format="A." count="*[local-name()='annex']"/> + <xsl:number format="1" level="any" count="//*[local-name()='table'] [not(ancestor::*[local-name()='annex']) and not(ancestor::*[local-name()='executivesummary']) and not(ancestor::*[local-name()='bibdata'])] [not(@unnumbered) or @unnumbered != 'true']"/> + + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='name']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='name']" mode="process"> <xsl:apply-templates/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="calculate-columns-numbers"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="calculate-column-widths"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="calculate-column-widths"> <xsl:param name="table"/> <xsl:param name="cols-count"/> <xsl:param name="curr-col" select="1"/> <xsl:param name="width" select="0"/> <xsl:if test="$curr-col &lt;= $cols-count"> <xsl:variable name="widths"> <xsl:choose> - <xsl:when test="not($table)"> + <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']"> <xsl:variable name="words"> <xsl:call-template name="tokenize"> <xsl:with-param name="text" select="translate(*[local-name()='th'][$curr-col],'- —:', ' ')"/> </xsl:call-template> @@ -2297,13 +2309,20 @@ <xsl:for-each select="xalan:nodeset($table)//tr"> <xsl:variable name="td_text"> <xsl:apply-templates select="td[$curr-col]" mode="td_text"/> </xsl:variable> <xsl:variable name="words"> + <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:call-template name="tokenize"> <!-- <xsl:with-param name="text" select="translate(td[$curr-col],'- —:', ' ')"/> --> - <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> + <!-- 2009 thinspace --> + <!-- <xsl:with-param name="text" select="translate(normalize-space($td_text),'- —:', ' ')"/> --> + <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​', ' '))"/> </xsl:call-template> </xsl:variable> <xsl:variable name="max_length"> <xsl:call-template name="max_length"> <xsl:with-param name="words" select="xalan:nodeset($words)"/> @@ -2340,47 +2359,39 @@ <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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="text()" mode="td_text"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="text()" mode="td_text"> <xsl:variable name="zero-space">​</xsl:variable> <xsl:value-of select="translate(., $zero-space, ' ')"/><xsl:text> </xsl:text> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='table2']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='thead']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='thead']" mode="process"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='termsource']" mode="td_text"> + <xsl:value-of select="*[local-name()='origin']/@citeas"/> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" mode="td_text"> + <xsl:value-of select="@target"/> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table2']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead']" mode="process"> + <xsl:param name="cols-count"/> <!-- font-weight="bold" --> - <fo:table-header> + <fo:table-header> + <xsl:apply-templates/> </fo:table-header> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='tfoot']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='tfoot']" mode="process"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tfoot']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tfoot']" mode="process"> <xsl:apply-templates/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="insertTableFooter"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertTableFooter"> + <xsl:param name="cols-count"/> <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/> <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'"> <fo:table-footer> <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> <!-- if there are note(s) or fn(s) then create footer row --> <xsl:if test="$isNoteOrFnExist = 'true'"> - <xsl:variable name="cols-count"> - <xsl:choose> - <xsl:when test="../*[local-name()='thead']"> - <!-- <xsl:value-of select="count(../*[local-name()='thead']/*[local-name()='tr']/*[local-name()='th'])"/> --> - <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:value-of select="count(./*[local-name()='tr'][1]/*[local-name()='td'])"/> --> - <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> + <fo:table-row> <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}"> @@ -2404,23 +2415,42 @@ </xsl:if> </fo:table-footer> </xsl:if> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='tbody']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tbody']"> - <xsl:apply-templates select="../*[local-name()='thead']" mode="process"/> + <xsl:variable name="cols-count"> + <xsl:choose> + <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: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:call-template name="insertTableFooter"/> + <xsl:apply-templates select="../*[local-name()='thead']" mode="process"> + <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/> <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> --> </fo:table-body> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='tr']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tr']"> <xsl:variable name="parent-name" select="local-name(..)"/> <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> --> <fo:table-row min-height="4mm"> <xsl:if test="$parent-name = 'thead'"> <xsl:attribute name="font-weight">bold</xsl:attribute> @@ -2436,11 +2466,11 @@ </xsl:if> <xsl:apply-templates/> </fo:table-row> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='th']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='th']"> <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center"> @@ -2459,11 +2489,11 @@ </xsl:if> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='td']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='td']"> <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm"> @@ -2481,10 +2511,11 @@ <xsl:attribute name="number-rows-spanned"> <xsl:value-of select="@rowspan"/> </xsl:attribute> </xsl:if> <fo:block> + <xsl:apply-templates/> </fo:block> <!-- <xsl:choose> <xsl:when test="count(*) = 1 and *[local-name() = 'p']"> <xsl:apply-templates /> @@ -2496,21 +2527,23 @@ </xsl:otherwise> </xsl:choose> --> </fo:table-cell> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='table']/*[local-name()='note']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='table']/*[local-name()='note']" mode="process"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']" mode="process"> <fo:block font-size="10pt" margin-bottom="12pt"> + <fo:inline padding-right="2mm"> - <xsl:text>NOTE </xsl:text> + <xsl:value-of select="$title-note"/> + <xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/> <xsl:if test="count(//*[local-name()='note'][ancestor::*[@id = $id]]) &gt; 1"> <xsl:number count="*[local-name()='note'][ancestor::*[@id = $id]]" level="any"/> </xsl:if> @@ -2519,13 +2552,13 @@ </fo:inline> <xsl:apply-templates mode="process"/> </fo:block> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process"> <xsl:apply-templates/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="fn_display"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display"> <xsl:variable name="references"> <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']"> <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> @@ -2544,10 +2577,11 @@ <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note--> <fo:block margin-bottom="12pt"> + <fo:inline font-size="80%" padding-right="5mm" id="{@id}"> <xsl:attribute name="vertical-align">super</xsl:attribute> @@ -2563,11 +2597,11 @@ <xsl:apply-templates/> </fo:inline> </fo:block> </xsl:if> </xsl:for-each> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="fn_name_display"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_name_display"> <!-- <xsl:variable name="references"> <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']"> <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> <xsl:apply-templates /> </fn> @@ -2579,11 +2613,11 @@ <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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="fn_display_figure"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display_figure"> <xsl:variable name="key_iso"> <!-- and (not(@class) or @class !='pseudocode') --> </xsl:variable> <xsl:variable name="references"> <xsl:for-each select=".//*[local-name()='fn']"> @@ -2630,11 +2664,11 @@ </fo:table-body> </fo:table> </fo:block> </xsl:if> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='fn']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']"> <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> --> <fo:inline font-size="80%" keep-with-previous.within-line="always"> @@ -2652,15 +2686,15 @@ </xsl:attribute> <xsl:value-of select="@reference"/> </fo:basic-link> </fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='fn']/*[local-name()='p']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']/*[local-name()='p']"> <fo:inline> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='dl']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']"> <xsl:variable name="parent" select="local-name(..)"/> <xsl:variable name="key_iso"> <!-- and (not(../@class) or ../@class !='pseudocode') --> </xsl:variable> @@ -2668,12 +2702,12 @@ <xsl:choose> <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component --> <fo:block margin-bottom="12pt" text-align="left"> - - <xsl:text>where </xsl:text> + + <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> @@ -2682,32 +2716,34 @@ <fo:block margin-bottom="12pt" text-align="left"> - <xsl:text>where</xsl:text> + <xsl:value-of select="$title-where"/> </fo:block> </xsl:when> <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <fo:block font-weight="bold" text-align="left" margin-bottom="12pt"> - <xsl:text>Key</xsl:text> + <xsl:value-of select="$title-key"/> </fo:block> </xsl:when> </xsl:choose> <!-- a few components --> <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)"> <fo:block> + <fo:block> + <!-- create virtual html table for dl/[dt and dd] --> <xsl:variable name="html-table"> <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> <xsl:element name="{$ns}:table"> <tbody> @@ -2755,11 +2791,11 @@ <fo:table-column column-width="60%"/> </xsl:when> <xsl:otherwise> <xsl:for-each select="xalan:nodeset($colwidths)//column"> <xsl:choose> - <xsl:when test=". = 1"> + <xsl:when test=". = 1 or . = 0"> <fo:table-column column-width="proportional-column-width(2)"/> </xsl:when> <xsl:otherwise> <fo:table-column column-width="proportional-column-width({.})"/> </xsl:otherwise> @@ -2778,11 +2814,11 @@ </fo:table-body> </fo:table> </fo:block> </fo:block> </xsl:if> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='dl']/*[local-name()='note']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']/*[local-name()='note']"> <xsl:param name="key_iso"/> <!-- <tr> <td>NOTE</td> <td> @@ -2794,20 +2830,20 @@ <fo:table-cell> <fo:block margin-top="6pt"> <xsl:if test="normalize-space($key_iso) = 'true'"> <xsl:attribute name="margin-top">0</xsl:attribute> </xsl:if> - NOTE + <xsl:value-of select="$title-note"/> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> </fo:table-row> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='dt']" mode="dl"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']" mode="dl"> <tr> <td> <xsl:apply-templates/> </td> <td> @@ -2816,24 +2852,28 @@ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> </td> </tr> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='dt']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']"> <xsl:param name="key_iso"/> <fo:table-row> <fo:table-cell> + <fo:block margin-top="6pt"> <xsl:if test="normalize-space($key_iso) = 'true'"> <xsl:attribute name="margin-top">0</xsl:attribute> </xsl:if> + + + <xsl:apply-templates/> </fo:block> </fo:table-cell> <fo:table-cell> @@ -2845,50 +2885,50 @@ </fo:block> </fo:table-cell> </fo:table-row> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='dd']" mode="dl"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='dd']" mode="dl_process"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']" mode="dl"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']" mode="dl_process"> <xsl:apply-templates/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='dd']"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='dd']" mode="process"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']" mode="process"> <xsl:apply-templates/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='dd']/*[local-name()='p']" mode="inline"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dd']/*[local-name()='p']" mode="inline"> <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='em']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='em']"> <fo:inline font-style="italic"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='strong']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='strong']"> <fo:inline font-weight="bold"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='sup']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sup']"> <fo:inline font-size="80%" vertical-align="super"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='sub']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sub']"> <fo:inline font-size="80%" vertical-align="sub"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='tt']"> - <fo:inline font-family="Courier" font-size="10pt"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tt']"> + <fo:inline font-family="Courier" font-size="10pt"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='del']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='del']"> <fo:inline font-size="10pt" color="red" text-decoration="line-through"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="text()[ancestor::*[local-name()='smallcap']]"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="recursiveSmallCaps"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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:choose> <xsl:when test="$char=$upperCase"> @@ -2903,11 +2943,11 @@ <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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="tokenize"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="tokenize"> <xsl:param name="text"/> <xsl:param name="separator" select="' '"/> <xsl:choose> <xsl:when test="not(contains($text, $separator))"> <word> @@ -2951,20 +2991,24 @@ <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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="max_length"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="add-zero-spaces"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" 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> <xsl:variable name="zero-space-after-underscore">_</xsl:variable> @@ -3012,11 +3056,11 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="$text"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="add-zero-spaces-equal"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces-equal"> <xsl:param name="text" select="."/> <xsl:variable name="zero-space-after-equals">==========</xsl:variable> <xsl:variable name="zero-space-after-equal">=</xsl:variable> <xsl:variable name="zero-space">​</xsl:variable> <xsl:choose> @@ -3038,11 +3082,11 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="$text"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="getSimpleTable"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getSimpleTable"> <xsl:variable name="simple-table"> <!-- Step 1. colspan processing --> <xsl:variable name="simple-table-colspan"> <tbody> @@ -3065,13 +3109,13 @@ <xsl:copy-of select="current()"/> </xsl:otherwise> </xsl:choose> --> </xsl:variable> <xsl:copy-of select="$simple-table"/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan"> <xsl:apply-templates mode="simple-table-colspan"/> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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> @@ -3089,42 +3133,42 @@ <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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="@colspan" mode="simple-table-colspan"/><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='tr']" mode="simple-table-colspan"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@colspan" mode="simple-table-colspan"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="@*|node()" mode="simple-table-colspan"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-colspan"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="simple-table-colspan"/> </xsl:copy> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="repeatNode"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="@*|node()" mode="simple-table-rowspan"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-rowspan"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="simple-table-rowspan"/> </xsl:copy> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="tbody" mode="simple-table-rowspan"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="tr" mode="simple-table-rowspan"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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"> @@ -3154,17 +3198,17 @@ <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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="getLang"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getLang"> <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> <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 xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" name="capitalizeWords"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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, ' ')"/> @@ -3178,23 +3222,23 @@ <xsl:otherwise> <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/> <xsl:value-of select="substring($str2, 2)"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="mathml:math"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="mathml:math"> <fo:inline font-family="STIX2Math"> <fo:instream-foreign-object fox:alt-text="Math"> <xsl:copy-of select="."/> </fo:instream-foreign-object> </fo:inline> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='localityStack']"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='localityStack']"> <xsl:for-each select="*[local-name()='locality']"> <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if> <xsl:apply-templates select="."/> <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if> </xsl:for-each> - </xsl:template><xsl:template xmlns:iso="https://www.metanorma.org/ns/iso" xmlns:iec="https://www.metanorma.org/ns/iec" xmlns:itu="https://www.metanorma.org/ns/itu" xmlns:nist="https://www.metanorma.org/ns/nist" xmlns:un="https://www.metanorma.org/ns/un" xmlns:csd="https://www.metanorma.org/ns/csd" match="*[local-name()='link']" name="link"> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" name="link"> <xsl:variable name="target"> <xsl:choose> <xsl:when test="starts-with(normalize-space(@target), 'mailto:')"> <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/> </xsl:when> @@ -3220,6 +3264,124 @@ </xsl:choose> </fo:basic-link> </xsl:otherwise> </xsl:choose> </fo:inline> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='sourcecode']" name="sourcecode"> + <fo:block xsl:use-attribute-sets="sourcecode-style"> + <!-- <xsl:choose> + <xsl:when test="@lang = 'en'"></xsl:when> + <xsl:otherwise> --> + <xsl:attribute name="white-space">pre</xsl:attribute> + <xsl:attribute name="wrap-option">wrap</xsl:attribute> + <!-- </xsl:otherwise> + </xsl:choose> --> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='bookmark']"> + <fo:inline id="{@id}"/> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']"> + <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style"> + <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline> + <xsl:apply-templates select="*[local-name()='title']" mode="process"/> + </fo:block> + <xsl:apply-templates/> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']/*[local-name()='title']" mode="process"> + <fo:inline><xsl:apply-templates/></fo:inline> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']"> + <fo:block xsl:use-attribute-sets="appendix-example-style"> + <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/> + <xsl:value-of select="$title-example"/> + <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1"> + <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text> + </xsl:if> + <xsl:if test="*[local-name()='name']"> + <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/> + </xsl:if> + </fo:block> + <xsl:apply-templates/> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']" mode="process"> + <fo:inline><xsl:apply-templates/></fo:inline> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" 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:apply-templates> + <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/> + </xsl:apply-templates> + </fo:inline> + </fo:block> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" 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)"/> + <xsl:variable name="monthStr"> + <xsl:choose> + <xsl:when test="$month = '01'">January</xsl:when> + <xsl:when test="$month = '02'">February</xsl:when> + <xsl:when test="$month = '03'">March</xsl:when> + <xsl:when test="$month = '04'">April</xsl:when> + <xsl:when test="$month = '05'">May</xsl:when> + <xsl:when test="$month = '06'">June</xsl:when> + <xsl:when test="$month = '07'">July</xsl:when> + <xsl:when test="$month = '08'">August</xsl:when> + <xsl:when test="$month = '09'">September</xsl:when> + <xsl:when test="$month = '10'">October</xsl:when> + <xsl:when test="$month = '11'">November</xsl:when> + <xsl:when test="$month = '12'">December</xsl:when> + </xsl:choose> + </xsl:variable> + <xsl:variable name="result"> + <xsl:choose> + <xsl:when test="$format = 'short' or $day = ''"> + <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:value-of select="$result"/> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeywords"> + <xsl:param name="sorting" select="'true'"/> + <xsl:param name="charAtEnd" select="'.'"/> + <xsl:param name="charDelim" select="', '"/> + <xsl:choose> + <xsl:when test="$sorting = 'true' or $sorting = 'yes'"> + <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']"> + <xsl:sort data-type="text" order="ascending"/> + <xsl:call-template name="insertKeyword"> + <xsl:with-param name="charAtEnd" select="$charAtEnd"/> + <xsl:with-param name="charDelim" select="$charDelim"/> + </xsl:call-template> + </xsl:for-each> + </xsl:when> + <xsl:otherwise> + <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']"> + <xsl:call-template name="insertKeyword"> + <xsl:with-param name="charAtEnd" select="$charAtEnd"/> + <xsl:with-param name="charDelim" select="$charDelim"/> + </xsl:call-template> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertKeyword"> + <xsl:param name="charAtEnd"/> + <xsl:param name="charDelim"/> + <xsl:apply-templates/> + <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:stylesheet> \ No newline at end of file