lib/isodoc/ogc/ogc.reference-model.xsl in metanorma-ogc-1.0.9 vs lib/isodoc/ogc/ogc.reference-model.xsl in metanorma-ogc-1.1.0

- old
+ new

@@ -1,6 +1,6 @@ -<?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:ogc="https://www.metanorma.org/ns/ogc" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" version="1.0"> +<?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:ogc="https://www.metanorma.org/ns/ogc" 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: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:variable name="pageWidth" select="'210mm'"/> <xsl:variable name="pageHeight" select="'297mm'"/> @@ -159,48 +159,11 @@ </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </fo:layout-master-set> - <fo:declarations> - <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> - <x:xmpmeta xmlns:x="adobe:ns:meta/"> - <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> - <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:choose> - <xsl:when test="$doctitle != ''"> - <xsl:value-of select="$doctitle"/> - </xsl:when> - <xsl:otherwise> - <xsl:text> </xsl:text> - </xsl:otherwise> - </xsl:choose> - </dc:title> - <dc:creator/> - <dc:description> - <xsl:variable name="abstract"> - <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: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/> - </rdf:Description> - </rdf:RDF> - </x:xmpmeta> - </fo:declarations> + <xsl:call-template name="addPDFUAmeta"/> <!-- Cover Page --> <fo:page-sequence master-reference="cover-page" force-page-count="no-force"> <fo:static-content flow-name="xsl-footnote-separator"> <fo:block> @@ -300,12 +263,13 @@ <fo:block>Document stage: </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:variable name="stage" select="/ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage"/> - <xsl:value-of select="translate(substring($stage, 1, 1), $lower, $upper)"/> - <xsl:value-of select="substring($stage, 2)"/> + <xsl:call-template name="capitalize"> + <xsl:with-param name="str" select="$stage"/> + </xsl:call-template> </fo:block> </fo:table-cell> </fo:table-row> <fo:table-row height="9mm"> <fo:table-cell> @@ -347,11 +311,16 @@ <fo:block break-after="page"/> <fo:block> </fo:block> <fo:block break-after="page"/> <fo:block-container font-weight="bold" line-height="115%"> - <fo:block font-size="14pt" margin-top="2pt" margin-bottom="15.5pt">Contents</fo:block> + <xsl:variable name="title-toc"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-toc'"/> + </xsl:call-template> + </xsl:variable> + <fo:block font-size="14pt" margin-top="2pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block> <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true' and @level &lt;= 2]"><!-- skip clause from preface [not(@level = 2 and starts-with(@section, '0'))] --> <fo:block> <xsl:if test="@level = 1"> @@ -396,11 +365,16 @@ </xsl:for-each> <xsl:if test="xalan:nodeset($contents)//item[@type = 'table']"> <fo:block font-size="12pt"> </fo:block> <fo:block font-size="12pt"> </fo:block> - <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt">List of Tables</fo:block> + <xsl:variable name="title-list-tables"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-list-tables'"/> + </xsl:call-template> + </xsl:variable> + <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-tables"/></fo:block> <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'table']"> <fo:block text-align-last="justify" margin-top="6pt"> <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}"> <xsl:value-of select="@section"/> <xsl:if test="text() != ''"> @@ -418,11 +392,16 @@ </xsl:if> <xsl:if test="xalan:nodeset($contents)//item[@type = 'figure']"> <fo:block font-size="12pt"> </fo:block> <fo:block font-size="12pt"> </fo:block> - <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt">List of Figures</fo:block> + <xsl:variable name="title-list-figures"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-list-figures'"/> + </xsl:call-template> + </xsl:variable> + <fo:block font-size="14pt" font-weight="bold" space-before="48pt" margin-bottom="15.5pt"><xsl:value-of select="$title-list-figures"/></fo:block> <xsl:for-each select="xalan:nodeset($contents)//item[@type = 'figure']"> <fo:block text-align-last="justify" margin-top="6pt"> <fo:basic-link internal-destination="{@id}" fox:alt-text="{@section}"> <xsl:value-of select="@section"/> <xsl:if test="text() != ''"> @@ -662,11 +641,13 @@ <xsl:attribute name="display">false</xsl:attribute> </xsl:if> <xsl:choose> <xsl:when test="not(ogc:title)"> <xsl:variable name="name" select="local-name()"/> - <xsl:value-of select="translate(substring($name, 1, 1), $lower, $upper)"/><xsl:value-of select="substring($name, 2)"/> + <xsl:call-template name="capitalize"> + <xsl:with-param name="str" select="$name"/> + </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:value-of select="ogc:title"/> </xsl:otherwise> </xsl:choose> @@ -682,29 +663,44 @@ <xsl:param name="sectionNum" select="'1'"/> <xsl:variable name="section"> <xsl:number format="i" value="$sectionNum"/> </xsl:variable> <item id="keywords" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface"> - <xsl:text>Keywords</xsl:text> + <xsl:variable name="title-keywords"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-keywords'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-keywords"/> </item> </xsl:template> <!-- Submitting Organizations --> <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:organization/ogc:name" mode="contents"> <xsl:param name="sectionNum" select="'1'"/> <xsl:variable name="section"> <xsl:number format="i" value="$sectionNum"/> </xsl:variable> <item id="submitting_orgs" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface"> - <xsl:text>Submitting Organizations</xsl:text> + <xsl:variable name="title-submitting-organizations"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-submitting-organizations'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-submitting-organizations"/> </item> </xsl:template> <xsl:template match="ogc:figure" mode="contents"> <xsl:param name="sectionNum"/> <item level="" id="{@id}" type="figure"> <xsl:attribute name="section"> - <xsl:text>Figure </xsl:text> + <xsl:variable name="title-figure"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-figure'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-figure"/> <xsl:choose> <xsl:when test="ancestor::ogc:annex"> <xsl:choose> <xsl:when test="count(//ogc:annex) = 1"> <xsl:value-of select="/ogc:nist-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/><xsl:number format="-1" level="any" count="ogc:annex//ogc:figure"/> @@ -735,11 +731,16 @@ <xsl:template match="ogc:table[not(@unnumbered='true')]" mode="contents"> <xsl:param name="sectionNum"/> <xsl:variable name="annex-id" select="ancestor::ogc:annex/@id"/> <item level="" id="{@id}" display="false" type="table"> <xsl:attribute name="section"> - <xsl:text>Table </xsl:text> + <xsl:variable name="title-table"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-table'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-table"/> <xsl:choose> <xsl:when test="ancestor::*[local-name()='executivesummary']"> <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered='true')]"/> </xsl:when> <xsl:when test="ancestor::*[local-name()='annex']"> @@ -758,11 +759,16 @@ <xsl:template match="ogc:formula" mode="contents"> <item level="" id="{@id}" display="false"> <xsl:attribute name="section"> - <xsl:text>Formula (</xsl:text><xsl:number format="A.1" level="multiple" count="ogc:annex | ogc:formula"/><xsl:text>)</xsl:text> + <xsl:variable name="title-formula"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-formula'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="ogc:annex | ogc:formula"/> </xsl:attribute> </item> </xsl:template> <xsl:template match="ogc:fn" mode="contents"/> @@ -776,11 +782,16 @@ </fo:block> </xsl:template> <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:edition"> <fo:block margin-bottom="12pt"> - <xsl:text>Version: </xsl:text> + <xsl:variable name="title-edition"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-edition'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-edition"/><xsl:text>: </xsl:text> <xsl:value-of select="."/><xsl:text> </xsl:text> </fo:block> </xsl:template> <xsl:template match="ogc:license-statement//ogc:title"> @@ -890,21 +901,28 @@ </xsl:choose> </xsl:variable> <fo:block id="{$id}" font-size="13pt" font-weight="bold" margin-bottom="12pt" color="rgb(14, 26, 133)"> <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline> <xsl:variable name="name" select="local-name()"/> - <xsl:value-of select="translate(substring($name, 1, 1), $lower, $upper)"/><xsl:value-of select="substring($name, 2)"/> + <xsl:call-template name="capitalize"> + <xsl:with-param name="str" select="$name"/> + </xsl:call-template> </fo:block> </xsl:if> <xsl:apply-templates/> </xsl:template> <!-- Keywords --> <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:keyword"> <xsl:param name="sectionNum" select="'1'"/> <fo:block id="keywords" font-size="13pt" font-weight="bold" margin-top="13.5pt" margin-bottom="12pt" color="rgb(14, 26, 133)"> <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="2mm"> </fo:inline> - <xsl:text>Keywords</xsl:text> + <xsl:variable name="title-keywords"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-keywords'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-keywords"/> </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:call-template name="insertKeywords"> <xsl:with-param name="sorting">no</xsl:with-param> @@ -919,11 +937,16 @@ <!-- 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'"/> <fo:block id="submitting_orgs" font-size="13pt" font-weight="bold" color="rgb(14, 26, 133)" margin-top="13.5pt" margin-bottom="12pt"> <xsl:number format="i." value="$sectionNum"/><fo:inline padding-right="3mm"> </fo:inline> - <xsl:text>Submitting Organizations</xsl:text> + <xsl:variable name="title-submitting-organizations"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-submitting-organizations'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-submitting-organizations"/> </fo:block> <fo:block margin-bottom="12pt">The following organizations submitted this Document to the Open Geospatial Consortium (OGC):</fo:block> <fo:list-block provisional-distance-between-starts="6.5mm" margin-bottom="12pt" line-height="115%"> <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author']/ogc:organization/ogc:name"> <fo:list-item> @@ -1112,14 +1135,17 @@ <xsl:otherwise>left</xsl:otherwise><!-- justify --> </xsl:choose> </xsl:attribute> <xsl:attribute name="space-after"> <xsl:choose> - <xsl:when test="ancestor::ogc:li">0pt</xsl:when> + <xsl:when test="ancestor::ogc:li">0pt</xsl:when> <xsl:otherwise>12pt</xsl:otherwise> </xsl:choose> </xsl:attribute> + <xsl:if test="ancestor::ogc:dd and not(ancestor::ogc:table)"> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + </xsl:if> <xsl:attribute name="line-height">115%</xsl:attribute> <xsl:apply-templates/> </xsl:element> <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')"> <fo:block margin-bottom="12pt"> @@ -1137,11 +1163,11 @@ <!-- <fn reference="1"> <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p> </fn> --> - <xsl:template match="ogc:title/ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)]" priority="2"> + <xsl:template match="ogc:title/ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)] | ogc:p/*/ogc:fn[not(ancestor::ogc:table)] | ogc:sourcecode/ogc:fn[not(ancestor::ogc:table)]" priority="2"> <fo:footnote keep-with-previous.within-line="always"> <xsl:variable name="number" select="@reference"/> <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super"> <fo:basic-link internal-destination="footnote_{@reference}" fox:alt-text="footnote {@reference}"> @@ -1183,38 +1209,38 @@ <fo:external-graphic src="{@src}" width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- content-width="75%" --> </fo:block> </xsl:template> <xsl:template match="ogc:figure"> - <xsl:variable name="title"> - <xsl:text>Figure </xsl:text> - </xsl:variable> - <fo:block-container id="{@id}"> <fo:block> <xsl:apply-templates/> </fo:block> <xsl:call-template name="fn_display_figure"/> <xsl:for-each select="ogc:note//ogc:p"> <xsl:call-template name="note"/> </xsl:for-each> <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-top="12pt" margin-bottom="6pt" keep-with-previous="always"> - + <xsl:variable name="title-figure"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-figure'"/> + </xsl:call-template> + </xsl:variable> <xsl:choose> <xsl:when test="ancestor::ogc:annex"> <xsl:choose> <xsl:when test="local-name(..) = 'figure'"> <xsl:number format="a) "/> </xsl:when> <xsl:otherwise> - <xsl:value-of select="$title"/><xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/> + <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> - <xsl:value-of select="$title"/><xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/> + <xsl:value-of select="$title-figure"/><xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/> </xsl:otherwise> </xsl:choose> <xsl:if test="ogc:name"> <xsl:if test="not(local-name(..) = 'figure')"> <xsl:text> — </xsl:text> @@ -1293,17 +1319,17 @@ <xsl:number level="any" count="ogc:bibitem/ogc:note"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super"> <!-- 60% baseline-shift="35%" --> - <fo:basic-link internal-destination="footnote_{../@id}" fox:alt-text="footnote {$number}"> + <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}"> <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> --> </fo:basic-link> </fo:inline> <fo:footnote-body> <fo:block font-size="10pt" margin-bottom="12pt" start-indent="0pt"> - <fo:inline id="footnote_{../@id}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"><!-- baseline-shift="30%" padding-right="9mm" alignment-baseline="hanging" --> + <fo:inline id="{generate-id()}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"><!-- baseline-shift="30%" padding-right="9mm" alignment-baseline="hanging" --> <xsl:value-of select="$number"/><!-- <xsl:text>)</xsl:text> --> </fo:inline> <xsl:apply-templates/> </fo:block> </fo:footnote-body> @@ -1366,10 +1392,18 @@ <xsl:apply-templates/> </fo:list-item-body> </fo:list-item> </xsl:template> + <xsl:template match="ogc:term"> + <xsl:param name="sectionNum"/> + <fo:block id="{@id}"> + <xsl:apply-templates> + <xsl:with-param name="sectionNum" select="$sectionNum"/> + </xsl:apply-templates> + </fo:block> + </xsl:template> <xsl:template match="ogc:preferred"> <xsl:param name="sectionNum"/> <xsl:variable name="section"> <xsl:call-template name="getSection"> @@ -1385,11 +1419,11 @@ <xsl:otherwise>12pt</xsl:otherwise> </xsl:choose> </xsl:variable> <fo:block font-size="{$font-size}"> <fo:block font-weight="bold" keep-with-next="always"> - <fo:inline id="{../@id}"> + <fo:inline> <xsl:value-of select="$section"/><xsl:text>.</xsl:text> </fo:inline> </fo:block> <fo:block font-weight="bold" keep-with-next="always" line-height="1"> <xsl:apply-templates/> @@ -1402,11 +1436,16 @@ <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="ogc:deprecates"> - <fo:block>DEPRECATED: <xsl:apply-templates/></fo:block> + <xsl:variable name="title-deprecated"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-deprecated'"/> + </xsl:call-template> + </xsl:variable> + <fo:block><xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/></fo:block> </xsl:template> <xsl:template match="ogc:definition[preceding-sibling::ogc:domain]"> <xsl:apply-templates/> </xsl:template> @@ -1423,11 +1462,18 @@ <xsl:template match="ogc:termsource"> <fo:block margin-bottom="12pt" keep-with-previous="always"> <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] --> <fo:basic-link internal-destination="{ogc:origin/@bibitemid}" fox:alt-text="{ogc:origin/@citeas}"> - <xsl:text>[SOURCE: </xsl:text> + <xsl:text>[</xsl:text> + <xsl:variable name="title-source"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-source'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-source"/> + <xsl:text>: </xsl:text> <fo:inline color="blue" text-decoration="underline"> <xsl:value-of select="ogc:origin/@citeas"/> <xsl:apply-templates select="ogc:origin/ogc:localityStack"/> @@ -1436,23 +1482,24 @@ <xsl:apply-templates select="ogc:modification"/> <xsl:text>]</xsl:text> </fo:block> </xsl:template> - <xsl:template match="ogc:modification"> - <xsl:text>, modified — </xsl:text> - <xsl:apply-templates/> - </xsl:template> + <xsl:template match="ogc:modification/ogc:p"> <fo:inline><xsl:apply-templates/></fo:inline> </xsl:template> <xsl:template match="ogc:termnote"> <fo:block font-size="10pt" margin-bottom="12pt"> - <xsl:text>Note </xsl:text> - <xsl:number/> - <xsl:text> to entry: </xsl:text> + <xsl:variable name="num"><xsl:number/></xsl:variable> + <xsl:variable name="title-note-to-entry"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-note-to-entry'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="ogc:termnote/ogc:p"> @@ -1464,11 +1511,16 @@ </xsl:template> <xsl:template match="ogc:termexample"> <fo:block font-size="10pt" margin-bottom="12pt"> - <fo:inline padding-right="10mm">EXAMPLE</fo:inline> + <xsl:variable name="title-example"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-example'"/> + </xsl:call-template> + </xsl:variable> + <fo:inline padding-right="10mm"><xsl:value-of select="normalize-space($title-example)"/></fo:inline> <xsl:apply-templates/> </fo:block> </xsl:template> <xsl:template match="ogc:termexample/ogc:p"> @@ -1593,11 +1645,11 @@ </xsl:if> </xsl:template> <xsl:template match="ogc:source"> <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> - <xsl:value-of select="@citeas" disable-output-escaping="yes"/> + <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" --> <xsl:apply-templates select="ogc:localityStack"/> </fo:basic-link> </xsl:template> @@ -1608,43 +1660,59 @@ <xsl:attribute name="color">blue</xsl:attribute> <xsl:attribute name="text-decoration">underline</xsl:attribute> <!-- </xsl:if> --> <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = current()/@target]/@type"/> <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id = current()/@target]/@root"/> + + <xsl:variable name="title-clause"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-clause'"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="title-annex"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-annex'"/> + </xsl:call-template> + </xsl:variable> <xsl:choose> <xsl:when test="normalize-space(.) != ''"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:choose> - <xsl:when test="$type = 'clause' and $root != 'annex'">Clause </xsl:when><!-- and not (ancestor::annex) --> - <xsl:when test="$type = 'term' and ($root = 'clause' or $root = 'terms')">Clause </xsl:when> - <xsl:when test="$type = 'clause' and $root = 'annex'">Annex </xsl:when> + <xsl:when test="$type = 'clause' and $root != 'annex'"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) --> + <xsl:when test="$type = 'term' and ($root = 'clause' or $root = 'terms')"><xsl:value-of select="$title-clause"/></xsl:when> + <xsl:when test="$type = 'clause' and $root = 'annex'"><xsl:value-of select="$title-annex"/></xsl:when> <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> --> </xsl:choose> <xsl:value-of select="$section"/> </xsl:otherwise> </xsl:choose> </fo:basic-link> </xsl:template> <xsl:template match="ogc:sourcecode" priority="2"> <xsl:call-template name="sourcecode"/> + <xsl:variable name="title-figure"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-figure'"/> + </xsl:call-template> + </xsl:variable> <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"> - <xsl:variable name="id_annex" select="ancestor::ogc:annex/@id"/> + <xsl:variable name="id_annex" select="ancestor::ogc:annex/@id"/> <xsl:choose> <xsl:when test="count(//ogc:annex) = 1"> <xsl:value-of select="/ogc:nist-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/><xsl:number format="-1" level="any" count="ogc:annex//ogc:sourcecode"/> </xsl:when> <xsl:otherwise> <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt"> - <xsl:text>Figure </xsl:text> + <xsl:value-of select="$title-figure"/> <xsl:number format="A." level="multiple" count="ogc:annex"/> <xsl:number format="1" level="any" count="ogc:sourcecode[ancestor::ogc:annex/@id = $id_annex and not(@unnumbered='true') and not(ancestor::ogc:example)]"/> <xsl:if test="ogc:name"> <xsl:text> — </xsl:text> <xsl:apply-templates select="ogc:name/*"/> @@ -1653,11 +1721,11 @@ </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt"> - <xsl:text>Figure </xsl:text> + <xsl:value-of select="$title-figure"/> <xsl:number format="1" level="any" count="ogc:sourcecode[not(@unnumbered='true') and not(ancestor::ogc:example)] | ogc:figure"/> <xsl:if test="ogc:name"> <xsl:text> — </xsl:text> <xsl:apply-templates select="ogc:name/*"/> </xsl:if> @@ -1678,11 +1746,16 @@ <xsl:template match="ogc:sourcecode/ogc:name"/> <xsl:template match="ogc:example"> <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always"> - <xsl:text>EXAMPLE</xsl:text> + <xsl:variable name="title-example"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-example'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="normalize-space($title-example)"/> <xsl:if test="following-sibling::ogc:example or preceding-sibling::ogc:example"> <xsl:number format=" 1"/> </xsl:if> <xsl:if test="ogc:name"> <xsl:text> — </xsl:text> @@ -1709,11 +1782,16 @@ <xsl:if test="ancestor::ogc:ul or ancestor::ogc:ol and not(ancestor::ogc:note[1]/following-sibling::*)"> <xsl:attribute name="margin-bottom">0pt</xsl:attribute> </xsl:if> <xsl:variable name="clauseid" select="ancestor::ogc:clause[1]/@id"/> <fo:inline padding-right="4mm"> - <xsl:text>NOTE </xsl:text> + <xsl:variable name="title-note"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-note'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-note"/> <xsl:if test="count(//ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]) &gt; 1"> <xsl:number count="ogc:note[ancestor::ogc:clause[1][@id = $clauseid]]" level="any"/> </xsl:if> </fo:inline> <xsl:apply-templates/> @@ -1736,11 +1814,11 @@ <!-- <xsl:if test="@type = 'inline'"> <xsl:attribute name="text-decoration">underline</xsl:attribute> </xsl:if> --> <xsl:choose> <xsl:when test="@citeas and normalize-space(text()) = ''"> - <xsl:value-of select="@citeas" disable-output-escaping="yes"/> + <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" --> </xsl:when> <xsl:when test="@bibitemid and normalize-space(text()) = ''"> <xsl:value-of select="//ogc:bibitem[@id = current()/@bibitemid]/ogc:docidentifier"/> </xsl:when> <xsl:otherwise/> @@ -1749,41 +1827,57 @@ <xsl:apply-templates select="text()"/> </fo:basic-link> </xsl:template> <xsl:template match="ogc:locality"> + <xsl:variable name="title-clause"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-clause'"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="title-annex"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-annex'"/> + </xsl:call-template> + </xsl:variable> <xsl:choose> - <xsl:when test="@type ='clause'">Clause </xsl:when> - <xsl:when test="@type ='annex'">Annex </xsl:when> + <xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when> + <xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when> <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise> </xsl:choose> <xsl:text> </xsl:text><xsl:value-of select="ogc:referenceFrom"/> </xsl:template> <xsl:template match="ogc:admonition"> <fo:block-container border="0.5pt solid rgb(79, 129, 189)" color="rgb(79, 129, 189)" margin-left="16mm" margin-right="16mm" margin-bottom="12pt"> <fo:block-container margin-left="0mm" margin-right="0mm" padding="2mm" padding-top="3mm"> - <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center"> - <xsl:value-of select="translate(@type, $lower, $upper)"/> + <fo:block font-size="11pt" margin-bottom="6pt" font-weight="bold" font-style="italic" text-align="center"> + <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/> </fo:block> <fo:block font-style="italic"> <xsl:apply-templates/> </fo:block> </fo:block-container> </fo:block-container> </xsl:template> + <xsl:template match="ogc:formula"> + <fo:block id="{@id}"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> + <xsl:template match="ogc:formula/ogc:dt/ogc:stem"> <fo:inline> <xsl:apply-templates/> </fo:inline> </xsl:template> <xsl:template match="ogc:formula/ogc:stem"> - <fo:block id="{../@id}" margin-top="6pt" margin-bottom="12pt"> + <fo:block margin-top="6pt" margin-bottom="12pt"> <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> @@ -1794,11 +1888,11 @@ </fo:table-cell> <fo:table-cell display-align="center"> <fo:block text-align="right"> <xsl:choose> <xsl:when test="ancestor::ogc:annex"> - <xsl:text>(</xsl:text><xsl:number format="A.1" level="multiple" count="ogc:annex | ogc:formula"/><xsl:text>)</xsl:text> + <xsl:number format="(A.1)" level="multiple" count="ogc:annex | ogc:formula"/> </xsl:when> <xsl:otherwise> <!-- not(ancestor::ogc:annex) --> <!-- <xsl:text>(</xsl:text><xsl:number level="any" count="ogc:formula"/><xsl:text>)</xsl:text> --> </xsl:otherwise> </xsl:choose> @@ -1879,43 +1973,11 @@ </fo:table> </fo:block-container> </fo:static-content> </xsl:template> - <xsl:template name="getId"> - <xsl:choose> - <xsl:when test="../@id"> - <xsl:value-of select="../@id"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="text()"/> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - <xsl:template name="getLevel"> - <xsl:variable name="level_total" select="count(ancestor::*)"/> - <xsl:variable name="level"> - <xsl:choose> - <xsl:when test="ancestor::ogc:preface"> - <xsl:value-of select="$level_total - 2"/> - </xsl:when> - <xsl:when test="ancestor::ogc:sections"> - <xsl:value-of select="$level_total - 2"/> - </xsl:when> - <xsl:when test="ancestor::ogc:bibliography"> - <xsl:value-of select="$level_total - 2"/> - </xsl:when> - <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when> - <xsl:otherwise> - <xsl:value-of select="$level_total - 1"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:value-of select="$level"/> - </xsl:template> - <xsl:template name="getSection"> <xsl:param name="sectionNum"/> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> @@ -1930,11 +1992,11 @@ <xsl:when test="$level = 1"> <xsl:value-of select="$sectionNum"/> </xsl:when> <xsl:when test="$level &gt;= 2"> <xsl:variable name="num"> - <xsl:number format=".1" level="multiple" count="ogc:clause/ogc:clause | ogc:clause/ogc:terms | ogc:terms/ogc:term | ogc:clause/ogc:term | ogc:clause/ogc:definitions | ogc:definitions/ogc:definitions | ogc:terms/ogc:definitions"/> + <xsl:call-template name="getSubSection"/> </xsl:variable> <xsl:value-of select="concat($sectionNum, $num)"/> </xsl:when> <xsl:otherwise> <!-- z<xsl:value-of select="$sectionNum"/>z --> @@ -1954,11 +2016,16 @@ </xsl:choose> </xsl:when> --> <xsl:when test="ancestor::ogc:annex"> <xsl:choose> <xsl:when test="$level = 1"> - <xsl:text>Annex </xsl:text> + <xsl:variable name="title-annex"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-annex'"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$title-annex"/> <xsl:choose> <xsl:when test="count(//ogc:annex) = 1"> <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:structuredidentifier/ogc:annexid"/> </xsl:when> <xsl:otherwise> @@ -1997,54 +2064,195 @@ </xsl:choose> </xsl:variable> <xsl:value-of select="$section"/> </xsl:template> -<xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-table"> +<xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_"> - <xsl:text>Table </xsl:text> + <title-table lang="en">Table </title-table> + <title-table lang="fr">Tableau </title-table> + + <title-table lang="zh">Table </title-table> - </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-note"> + + <title-note lang="en">NOTE </title-note> + <title-note lang="fr">NOTE </title-note> - <xsl:text>NOTE </xsl:text> + <title-note lang="zh">NOTE </title-note> - </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-figure"> - <xsl:text>Figure </xsl:text> + <title-figure lang="en">Figure </title-figure> + <title-figure lang="fr">Figure </title-figure> + <title-figure lang="zh">Figure </title-figure> - </xsl:variable><xsl:variable xmlns:java="http://xml.apache.org/xalan/java" name="title-example"> - <xsl:text>EXAMPLE </xsl:text> + <title-example lang="en">EXAMPLE </title-example> + <title-example lang="fr">EXEMPLE </title-example> - </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"> + <title-example lang="zh">EXAMPLE </title-example> - <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"> + <title-example-xref lang="en">Example </title-example-xref> + <title-example-xref lang="fr">Exemple </title-example-xref> + + <title-section lang="en">Section </title-section> + <title-section lang="fr">Section </title-section> - <xsl:text>Clause </xsl:text> + <title-inequality lang="en">Inequality </title-inequality> + <title-inequality lang="fr">Inequality </title-inequality> + <title-equation lang="en">Equation </title-equation> + <title-equation lang="fr">Equation </title-equation> + + <title-annex lang="en">Annex </title-annex> + <title-annex lang="fr">Annexe </title-annex> - </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"> + <title-annex lang="zh">Annex </title-annex> - </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"> + <title-appendix lang="en">Appendix </title-appendix> + <title-appendix lang="fr">Appendix </title-appendix> + + <title-clause lang="en">Clause </title-clause> + <title-clause lang="fr">Article </title-clause> + + <title-clause lang="zh">Clause </title-clause> + + + + <title-edition lang="en"> + + + <xsl:text>Version</xsl:text> + + </title-edition> + + <title-formula lang="en">Formula </title-formula> + <title-formula lang="fr">Formula </title-formula> + + <title-toc lang="en"> + + <xsl:text>Contents</xsl:text> + + + + </title-toc> + <title-toc lang="fr">Sommaire</title-toc> + + <title-toc lang="zh">Contents</title-toc> + + + + <title-page lang="en">Page</title-page> + <title-page lang="fr">Page</title-page> + + <title-key lang="en">Key</title-key> + <title-key lang="fr">Légende</title-key> + + <title-where lang="en">where</title-where> + <title-where lang="fr">où</title-where> + + <title-descriptors lang="en">Descriptors</title-descriptors> + + <title-part lang="en"> + + + </title-part> + <title-part lang="fr"> + + + </title-part> + <title-part lang="zh">第 # 部分:</title-part> + + <title-note-to-entry lang="en">Note # to entry: </title-note-to-entry> + <title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry> + + <title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry> + + + + <title-modified lang="en">modified</title-modified> + <title-modified lang="fr">modifiée</title-modified> + + <title-modified lang="zh">modified</title-modified> + + + + <title-source lang="en">SOURCE</title-source> + + <title-keywords lang="en">Keywords</title-keywords> + + <title-deprecated lang="en">DEPRECATED</title-deprecated> + <title-deprecated lang="fr">DEPRECATED</title-deprecated> + + <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations> + + <title-list-tables lang="en">List of Tables</title-list-tables> + + <title-list-figures lang="en">List of Figures</title-list-figures> + + <title-recommendation lang="en">Recommendation </title-recommendation> + + <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements> + + <title-abstract lang="en">Abstract</title-abstract> + + <title-summary lang="en">Summary</title-summary> + + <title-in lang="en">in </title-in> + + <title-box lang="en">Box </title-box> + + <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes> + <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes> + + <title-completion-date lang="en">Completion date for this manuscript</title-completion-date> + <title-completion-date lang="zh">本稿完成日期</title-completion-date> + + <title-issuance-date lang="en">Issuance Date: #</title-issuance-date> + <title-issuance-date lang="zh"># 发布</title-issuance-date> + + <title-implementation-date lang="en">Implementation Date: #</title-implementation-date> + <title-implementation-date lang="zh"># 实施</title-implementation-date> + + <title-obligation-normative lang="en">normative</title-obligation-normative> + <title-obligation-normative lang="zh">规范性附录</title-obligation-normative> + + <title-caution lang="en">CAUTION</title-caution> + <title-caution lang="zh">注意</title-caution> + + <title-warning lang="en">WARNING</title-warning> + <title-warning lang="zh">警告</title-warning> + + <title-amendment lang="en">AMENDMENT</title-amendment> + </xsl:variable><xsl:template name="getTitle"> + <xsl:param name="name"/> + <xsl:variable name="lang"> + <xsl:call-template name="getLang"/> + </xsl:variable> + <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/> + <xsl:choose> + <xsl:when test="normalize-space($title_) != ''"> + <xsl:value-of select="$title_"/> + </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="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style"> + <xsl:attribute name="color">blue</xsl:attribute> <xsl:attribute name="text-decoration">underline</xsl:attribute> - </xsl:attribute-set><xsl:attribute-set xmlns:java="http://xml.apache.org/xalan/java" name="sourcecode-style"> + </xsl:attribute-set><xsl:attribute-set name="sourcecode-style"> @@ -2055,35 +2263,35 @@ <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-set><xsl:attribute-set 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-set><xsl:attribute-set 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:attribute-set><xsl:template match="text()"> <xsl:value-of select="."/> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='br']"> + </xsl:template><xsl:template match="*[local-name()='br']"> <xsl:value-of select="$linebreak"/> - </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:template><xsl:template 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:template><xsl:template match="*[local-name()='table']"> <xsl:variable name="simple-table"> <!-- <xsl:copy> --> <xsl:call-template name="getSimpleTable"/> <!-- </xsl:copy> --> @@ -2115,11 +2323,15 @@ <xsl:attribute name="font-weight">normal</xsl:attribute> <xsl:attribute name="font-size">11pt</xsl:attribute> - + <xsl:variable name="title-table"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-table'"/> + </xsl:call-template> + </xsl:variable> <xsl:value-of select="$title-table"/> <xsl:call-template name="getTableNumber"/> @@ -2222,17 +2434,26 @@ <xsl:otherwise> <fo:table-column column-width="proportional-column-width({.})"/> </xsl:otherwise> </xsl:choose> </xsl:for-each> - <xsl:apply-templates/> + + <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/> + </xsl:otherwise> + </xsl:choose> + </fo:table> </fo:block-container> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getTableNumber"> + </xsl:template><xsl:template 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']"> @@ -2253,19 +2474,19 @@ <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:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process"> <xsl:apply-templates/> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="calculate-columns-numbers"> + </xsl:template><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 xmlns:java="http://xml.apache.org/xalan/java" name="calculate-column-widths"> + </xsl:template><xsl:template 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"/> @@ -2359,27 +2580,31 @@ <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:java="http://xml.apache.org/xalan/java" match="text()" mode="td_text"> + </xsl:template><xsl:template 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:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" 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 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:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process"> <xsl:param name="cols-count"/> <!-- font-weight="bold" --> <fo:table-header> <xsl:apply-templates/> </fo:table-header> - </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:template><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 match="*[local-name()='tfoot']" mode="process"> <xsl:apply-templates/> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="insertTableFooter"> + </xsl:template><xsl:template 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> @@ -2415,11 +2640,11 @@ </xsl:if> </fo:table-footer> </xsl:if> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tbody']"> + </xsl:template><xsl:template match="*[local-name()='tbody']"> <xsl:variable name="cols-count"> <xsl:choose> <xsl:when test="../*[local-name()='thead']"> <xsl:call-template name="calculate-columns-numbers"> @@ -2446,11 +2671,11 @@ <xsl:apply-templates/> <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> --> </fo:table-body> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tr']"> + </xsl:template><xsl:template 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> @@ -2466,11 +2691,11 @@ </xsl:if> <xsl:apply-templates/> </fo:table-row> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='th']"> + </xsl:template><xsl:template match="*[local-name()='th']"> <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center"> @@ -2489,11 +2714,11 @@ </xsl:if> <fo:block> <xsl:apply-templates/> </fo:block> </fo:table-cell> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='td']"> + </xsl:template><xsl:template match="*[local-name()='td']"> <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm"> @@ -2527,21 +2752,26 @@ </xsl:otherwise> </xsl:choose> --> </fo:table-cell> - </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"> + </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process"> <fo:block font-size="10pt" margin-bottom="12pt"> <fo:inline padding-right="2mm"> + <xsl:variable name="title-note"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-note'"/> + </xsl:call-template> + </xsl:variable> <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"/> @@ -2552,13 +2782,13 @@ </fo:inline> <xsl:apply-templates mode="process"/> </fo:block> - </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:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process"> <xsl:apply-templates/> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_display"> + </xsl:template><xsl:template 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}"> @@ -2597,11 +2827,11 @@ <xsl:apply-templates/> </fo:inline> </fo:block> </xsl:if> </xsl:for-each> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="fn_name_display"> + </xsl:template><xsl:template 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> @@ -2613,30 +2843,71 @@ <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:java="http://xml.apache.org/xalan/java" name="fn_display_figure"> + </xsl:template><xsl:template 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']"> <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> <xsl:apply-templates/> </fn> </xsl:for-each> </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="html-table"> + <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> + <xsl:element name="{$ns}:table"> + <xsl:for-each select="*[local-name() = 'dl'][1]"> + <tbody> + <xsl:apply-templates mode="dl"/> + </tbody> + </xsl:for-each> + </xsl:element> + </xsl:variable> + + <xsl:call-template name="calculate-column-widths"> + <xsl:with-param name="cols-count" select="2"/> + <xsl:with-param name="table" select="$html-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:for-each> + </xsl:variable> + <xsl:if test="xalan:nodeset($references)//fn"> <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> - <fo:table-column column-width="15%"/> - <fo:table-column column-width="85%"/> + <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:call-template> + </xsl:when> + <xsl:otherwise> + <fo:table-column column-width="15%"/> + <fo:table-column column-width="85%"/> + </xsl:otherwise> + </xsl:choose> <fo:table-body> <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:table-row> @@ -2664,11 +2935,11 @@ </fo:table-body> </fo:table> </fo:block> </xsl:if> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='fn']"> + </xsl:template><xsl:template match="*[local-name()='fn']"> <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> --> <fo:inline font-size="80%" keep-with-previous.within-line="always"> @@ -2686,15 +2957,15 @@ </xsl:attribute> <xsl:value-of select="@reference"/> </fo:basic-link> </fo:inline> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']"> + </xsl:template><xsl:template match="*[local-name()='dl']"> <xsl:variable name="parent" select="local-name(..)"/> <xsl:variable name="key_iso"> <!-- and (not(../@class) or ../@class !='pseudocode') --> </xsl:variable> @@ -2703,10 +2974,15 @@ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component --> <fo:block margin-bottom="12pt" text-align="left"> + <xsl:variable name="title-where"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-where'"/> + </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> @@ -2716,18 +2992,28 @@ <fo:block margin-bottom="12pt" text-align="left"> + <xsl:variable name="title-where"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-where'"/> + </xsl:call-template> + </xsl:variable> <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"> + <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always"> + <xsl:variable name="title-key"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-key'"/> + </xsl:call-template> + </xsl:variable> <xsl:value-of select="$title-key"/> </fo:block> </xsl:when> </xsl:choose> @@ -2740,27 +3026,10 @@ <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> - <xsl:apply-templates mode="dl"/> - </tbody> - </xsl:element> - </xsl:variable> - <!-- html-table<xsl:copy-of select="$html-table"/> --> - <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="$html-table"/> - </xsl:call-template> - </xsl:variable> - <!-- colwidths=<xsl:value-of select="$colwidths"/> --> <fo:table width="95%" table-layout="fixed"> <xsl:choose> <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"> @@ -2769,56 +3038,98 @@ <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="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table --> - <fo:table-column column-width="50%"/> - <fo:table-column column-width="50%"/> - </xsl:when> - <xsl:otherwise> - <xsl:choose> - <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7"> - <fo:table-column column-width="60%"/> - <fo:table-column column-width="40%"/> - </xsl:when> --> - <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3"> - <fo:table-column column-width="50%"/> - <fo:table-column column-width="50%"/> - </xsl:when> - <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5"> - <fo:table-column column-width="40%"/> - <fo:table-column column-width="60%"/> - </xsl:when> - <xsl:otherwise> - <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> - <xsl:otherwise> - <fo:table-column column-width="proportional-column-width({.})"/> - </xsl:otherwise> - </xsl:choose> - </xsl:for-each> - </xsl:otherwise> - </xsl:choose> - <!-- <fo:table-column column-width="15%"/> - <fo:table-column column-width="85%"/> --> - </xsl:otherwise> - </xsl:choose> + <!-- 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> + <xsl:apply-templates mode="dl"/> + </tbody> + </xsl:element> + </xsl:variable> + <!-- html-table<xsl:copy-of select="$html-table"/> --> + <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="$html-table"/> + </xsl:call-template> + </xsl:variable> + <!-- colwidths=<xsl:value-of select="$colwidths"/> --> + <xsl:variable name="maxlength_dt"> + <xsl:call-template name="getMaxLength_dt"/> + </xsl:variable> + <xsl:call-template name="setColumnWidth_dl"> + <xsl:with-param name="colwidths" select="$colwidths"/> + <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/> + </xsl:call-template> <fo:table-body> <xsl:apply-templates> <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/> </xsl:apply-templates> </fo:table-body> </fo:table> </fo:block> </fo:block> </xsl:if> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dl']/*[local-name()='note']"> + </xsl:template><xsl:template name="setColumnWidth_dl"> + <xsl:param name="colwidths"/> + <xsl:param name="maxlength_dt"/> + <xsl:choose> + <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table --> + <fo:table-column column-width="50%"/> + <fo:table-column column-width="50%"/> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc --> + <fo:table-column column-width="5%"/> + <fo:table-column column-width="95%"/> + </xsl:when> + <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc --> + <fo:table-column column-width="10%"/> + <fo:table-column column-width="90%"/> + </xsl:when> + <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7"> + <fo:table-column column-width="60%"/> + <fo:table-column column-width="40%"/> + </xsl:when> --> + <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.3"> + <fo:table-column column-width="50%"/> + <fo:table-column column-width="50%"/> + </xsl:when> + <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 0.5"> + <fo:table-column column-width="40%"/> + <fo:table-column column-width="60%"/> + </xsl:when> + <xsl:otherwise> + <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> + <xsl:otherwise> + <fo:table-column column-width="proportional-column-width({.})"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> + <!-- <fo:table-column column-width="15%"/> + <fo:table-column column-width="85%"/> --> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template name="getMaxLength_dt"> + <xsl:for-each select="*[local-name()='dt']"> + <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/> + <xsl:if test="position() = 1"> + <xsl:value-of select="string-length(normalize-space(.))"/> + </xsl:if> + </xsl:for-each> + </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']"> <xsl:param name="key_iso"/> <!-- <tr> <td>NOTE</td> <td> @@ -2830,20 +3141,25 @@ <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:variable name="title-note"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-note'"/> + </xsl:call-template> + </xsl:variable> <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:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']" mode="dl"> + </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl"> <tr> <td> <xsl:apply-templates/> </td> <td> @@ -2852,11 +3168,11 @@ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/> </td> </tr> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='dt']"> + </xsl:template><xsl:template match="*[local-name()='dt']"> <xsl:param name="key_iso"/> <fo:table-row> <fo:table-cell> @@ -2870,12 +3186,19 @@ - <xsl:apply-templates/> + <xsl:attribute name="margin-top">0pt</xsl:attribute> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + <xsl:apply-templates/> + <!-- <xsl:if test="$namespace = 'gb'"> + <xsl:if test="ancestor::*[local-name()='formula']"> + <xsl:text>—</xsl:text> + </xsl:if> + </xsl:if> --> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> @@ -2885,53 +3208,54 @@ </fo:block> </fo:table-cell> </fo:table-row> - </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:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process"> <xsl:apply-templates/> - </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:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process"> <xsl:apply-templates/> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='em']"> + </xsl:template><xsl:template match="*[local-name()='em']"> <fo:inline font-style="italic"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='strong']"> + </xsl:template><xsl:template match="*[local-name()='strong']"> <fo:inline font-weight="bold"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='tt']"> + </xsl:template><xsl:template match="*[local-name()='tt']"> <fo:inline font-family="Courier" font-size="10pt"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='del']"> + </xsl:template><xsl:template 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:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" name="recursiveSmallCaps"> + </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="translate($char, $lower, $upper)"/> --> + <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/> <xsl:choose> <xsl:when test="$char=$upperCase"> <fo:inline font-size="{100 div 0.75}%"> <xsl:value-of select="$upperCase"/> </fo:inline> @@ -2943,11 +3267,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:java="http://xml.apache.org/xalan/java" name="tokenize"> + </xsl:template><xsl:template name="tokenize"> <xsl:param name="text"/> <xsl:param name="separator" select="' '"/> <xsl:choose> <xsl:when test="not(contains($text, $separator))"> <word> @@ -2991,23 +3315,23 @@ <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:java="http://xml.apache.org/xalan/java" name="max_length"> + </xsl:template><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 xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" name="add-zero-spaces"> + </xsl:template><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> @@ -3056,11 +3380,11 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="$text"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" 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="zero-space-after-equal">=</xsl:variable> <xsl:variable name="zero-space">​</xsl:variable> <xsl:choose> @@ -3082,11 +3406,11 @@ </xsl:when> <xsl:otherwise> <xsl:value-of select="$text"/> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" name="getSimpleTable"> + </xsl:template><xsl:template name="getSimpleTable"> <xsl:variable name="simple-table"> <!-- Step 1. colspan processing --> <xsl:variable name="simple-table-colspan"> <tbody> @@ -3109,13 +3433,13 @@ <xsl:copy-of select="current()"/> </xsl:otherwise> </xsl:choose> --> </xsl:variable> <xsl:copy-of select="$simple-table"/> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan"> + </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan"> <xsl:apply-templates 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: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> @@ -3133,42 +3457,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: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: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 xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" name="repeatNode"> + </xsl:template><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 xmlns:java="http://xml.apache.org/xalan/java" match="@*|node()" mode="simple-table-rowspan"> + </xsl:template><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 xmlns:java="http://xml.apache.org/xalan/java" 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 xmlns:java="http://xml.apache.org/xalan/java" 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"> @@ -3198,47 +3522,57 @@ <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:java="http://xml.apache.org/xalan/java" name="getLang"> + </xsl:template><xsl:template 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:java="http://xml.apache.org/xalan/java" 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, ' ')"/> - <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/> - <xsl:value-of select="substring($substr, 2)"/> + <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/> + <xsl:value-of select="substring($substr, 2)"/> --> + <xsl:call-template name="capitalize"> + <xsl:with-param name="str" select="$substr"/> + </xsl:call-template> <xsl:text> </xsl:text> <xsl:call-template name="capitalizeWords"> <xsl:with-param name="str" select="substring-after($str2, ' ')"/> </xsl:call-template> </xsl:when> <xsl:otherwise> - <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/> - <xsl:value-of select="substring($str2, 2)"/> + <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/> + <xsl:value-of select="substring($str2, 2)"/> --> + <xsl:call-template name="capitalize"> + <xsl:with-param name="str" select="$str2"/> + </xsl:call-template> </xsl:otherwise> </xsl:choose> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="mathml:math"> + </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"> <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:java="http://xml.apache.org/xalan/java" match="*[local-name()='localityStack']"> + </xsl:template><xsl:template 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:java="http://xml.apache.org/xalan/java" match="*[local-name()='link']" name="link"> + </xsl:template><xsl:template 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> @@ -3264,65 +3598,86 @@ </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"> + </xsl:template><xsl:template 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']"> + </xsl:template><xsl:template match="*[local-name()='bookmark']"> <fo:inline id="{@id}"/> - </xsl:template><xsl:template xmlns:java="http://xml.apache.org/xalan/java" match="*[local-name()='appendix']"> + </xsl:template><xsl:template match="*[local-name()='appendix']"> <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style"> + <xsl:variable name="title-appendix"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-appendix'"/> + </xsl:call-template> + </xsl:variable> <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"> + </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template 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']"> + </xsl:template><xsl:template 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:variable name="title-example"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-example'"/> + </xsl:call-template> + </xsl:variable> <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"> + </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template 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']"> + </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 xmlns:java="http://xml.apache.org/xalan/java" 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: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: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 xmlns:java="http://xml.apache.org/xalan/java" name="convertDate"> + </xsl:template><xsl:template match="*[local-name() = 'modification']"> + <xsl:variable name="title-modified"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-modified'"/> + </xsl:call-template> + </xsl:variable> + <xsl:choose> + <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when> + <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise> + </xsl:choose> + <xsl:apply-templates/> + </xsl:template><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)"/> @@ -3351,11 +3706,11 @@ <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:template><xsl:template 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'"> @@ -3374,14 +3729,115 @@ <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:template><xsl:template 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:template name="addPDFUAmeta"> + <fo:declarations> + <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> + <x:xmpmeta xmlns:x="adobe:ns:meta/"> + <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <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:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/> + + + + </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> + </dc:title> + <dc:creator> + + + </dc:creator> + <dc:description> + <xsl:variable name="abstract"> + + + + + <xsl:copy-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'abstract']//text()"/> + + </xsl:variable> + <xsl:value-of select="normalize-space($abstract)"/> + </dc:description> + <pdf:Keywords> + <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/> + </rdf:Description> + </rdf:RDF> + </x:xmpmeta> + </fo:declarations> + </xsl:template><xsl:template name="getId"> + <xsl:choose> + <xsl:when test="../@id"> + <xsl:value-of select="../@id"/> + </xsl:when> + <xsl:otherwise> + <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> --> + <xsl:value-of select="concat(generate-id(..), '_', text())"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template name="getLevel"> + <xsl:variable name="level_total" select="count(ancestor::*)"/> + <xsl:variable name="level"> + <xsl:choose> + <xsl:when test="ancestor::*[local-name() = 'preface']"> + <xsl:value-of select="$level_total - 2"/> + </xsl:when> + <xsl:when test="ancestor::*[local-name() = 'sections']"> + <xsl:value-of select="$level_total - 2"/> + </xsl:when> + <xsl:when test="ancestor::*[local-name() = 'bibliography']"> + <xsl:value-of select="$level_total - 2"/> + </xsl:when> + <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when> + <xsl:otherwise> + <xsl:value-of select="$level_total - 1"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:value-of select="$level"/> + </xsl:template><xsl:template name="getSubSection"> + <xsl:number format=".1" level="multiple" count="*[local-name() = 'clause']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'terms'] | *[local-name() = 'terms']/*[local-name() = 'term'] | *[local-name() = 'clause']/*[local-name() = 'term'] | *[local-name() = 'terms']/*[local-name() = 'clause'] | *[local-name() = 'terms']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'definitions'] | *[local-name() = 'clause']/*[local-name() = 'references']"/> + </xsl:template><xsl:template name="split"> + <xsl:param name="pText" select="."/> + <xsl:param name="sep" select="','"/> + <xsl:if test="string-length($pText) &gt;0"> + <item> + <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/> + </item> + <xsl:call-template name="split"> + <xsl:with-param name="pText" select="substring-after($pText, $sep)"/> + <xsl:with-param name="sep" select="$sep"/> + </xsl:call-template> + </xsl:if> + </xsl:template><xsl:template name="getDocumentId"> + <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/> </xsl:template></xsl:stylesheet> \ No newline at end of file