lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-1.1.3 vs lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-1.2.0

- old
+ new

@@ -1,9 +1,12 @@ <?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:param name="svg_images"/> + <xsl:variable name="images" select="document($svg_images)"/> + <xsl:variable name="pageWidth" select="'210mm'"/> <xsl:variable name="pageHeight" select="'297mm'"/> @@ -33,62 +36,35 @@ <xsl:text>Open Geospatial Consortium </xsl:text> <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:docidentifier[@type = 'ogc-internal']"/> <xsl:text>:</xsl:text> <xsl:value-of select="/ogc:ogc-standard/ogc:bibdata/ogc:copyright/ogc:from"/> </xsl:variable> + + <xsl:variable name="color" select="'rgb(14, 26, 133)'"/> <xsl:variable name="contents"> <contents> - <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters --> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract" mode="contents"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1]" mode="contents"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + 1"/> - </xsl:apply-templates> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ 1"/> - - </xsl:apply-templates> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="contents"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name" mode="contents"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + 1"/> - </xsl:apply-templates> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters" mode="contents"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + 1"/> - </xsl:apply-templates> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'submitters']" mode="contents"> - <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:preface/ogc:introduction) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + count(/ogc:ogc-standard/ogc:preface/ogc:submitters)"/> - </xsl:apply-templates> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="contents"/> - - - <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']" mode="contents"> - <xsl:with-param name="sectionNum" select="'1'"/> - </xsl:apply-templates> - - <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']" mode="contents"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + 1"/> - </xsl:apply-templates> - + <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']" mode="contents"/> + + <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']" mode="contents"/> + <!-- Normative references --> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']" mode="contents"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + 1"/> - </xsl:apply-templates> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']" mode="contents"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents"> <!-- Terms and definitions --> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + 1"/> - </xsl:apply-templates> - + <!-- Terms and definitions --> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]" mode="contents"> - <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/> - </xsl:apply-templates> - - + <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]" mode="contents"/> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:annex" mode="contents"/> + + <!-- Bibliography --> <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']" mode="contents"/> <!-- [position() &gt; 1] --> </contents> </xsl:variable> @@ -96,11 +72,11 @@ <xsl:variable name="lang"> <xsl:call-template name="getLang"/> </xsl:variable> <xsl:template match="/"> - <xsl:call-template name="namespaceCheck"/> + <xsl:call-template name="namespaceCheck"/> <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10.5pt" xml:lang="{$lang}"> <fo:layout-master-set> <!-- Cover page --> <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}"> <fo:region-body margin-top="23.5mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/> @@ -351,42 +327,35 @@ <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'))] --> + <xsl:for-each select="xalan:nodeset($contents)//item"> <fo:block> <xsl:if test="@level = 1"> <xsl:attribute name="margin-top">6pt</xsl:attribute> </xsl:if> <fo:list-block> <xsl:attribute name="provisional-distance-between-starts"> - <xsl:choose> - <!-- skip 0 section without subsections --> - <xsl:when test="@section != '' and not(@display-section = 'false')">8mm</xsl:when> + <xsl:choose> + <xsl:when test="@section != ''">8mm</xsl:when> <xsl:otherwise>0mm</xsl:otherwise> </xsl:choose> </xsl:attribute> <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block> - <xsl:if test="@section and not(@display-section = 'false')"> <!-- output below --> - <xsl:value-of select="@section"/><xsl:text>.</xsl:text> - </xsl:if> + <xsl:value-of select="@section"/> </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm"> <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}"> - <xsl:if test="@section and @display-section = 'false' and not(@section = '0')"> - <xsl:value-of select="@section"/><xsl:text> </xsl:text> - </xsl:if> - <xsl:if test="@addon != ''"> - <xsl:text>(</xsl:text><xsl:value-of select="@addon"/><xsl:text>)</xsl:text> - </xsl:if> - <xsl:text> </xsl:text><xsl:value-of select="text()"/> + + <xsl:apply-templates/> + <fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots"/> <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline> </fo:inline> </fo:basic-link> @@ -395,88 +364,82 @@ </fo:list-item> </fo:list-block> </fo:block> </xsl:for-each> - <xsl:if test="xalan:nodeset($contents)//item[@type = 'table']"> + <xsl:if test="//ogc:table[@id and ogc:name]"> <fo:block font-size="12pt"> </fo:block> <fo:block font-size="12pt"> </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']"> + <xsl:for-each select="//ogc:table[@id and ogc:name]"> <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() != ''"> - <xsl:text> — </xsl:text> - <xsl:value-of select="text()"/> - </xsl:if> - <xsl:text> </xsl:text> + <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}"> + <xsl:apply-templates select="ogc:name" mode="contents"/> <fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots"/> <fo:page-number-citation ref-id="{@id}"/> </fo:inline> </fo:basic-link> </fo:block> </xsl:for-each> </xsl:if> - <xsl:if test="xalan:nodeset($contents)//item[@type = 'figure']"> + <xsl:if test="//ogc:figure[@id and ogc:name]"> <fo:block font-size="12pt"> </fo:block> <fo:block font-size="12pt"> </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']"> + <xsl:for-each select="//ogc:figure[@id and ogc:name]"> <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() != ''"> - <xsl:text> — </xsl:text> - <xsl:value-of select="text()"/> - </xsl:if> - <xsl:text> </xsl:text> + <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}"> + <xsl:apply-templates select="ogc:name" mode="contents"/> <fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots"/> <fo:page-number-citation ref-id="{@id}"/> </fo:inline> </fo:basic-link> </fo:block> </xsl:for-each> </xsl:if> + <xsl:if test="//ogc:permission[@id and ogc:name] or //ogc:recommendation[@id and ogc:name] or //ogc:requirement[@id and ogc:name]"> + <fo:block font-size="12pt"> </fo:block> + <fo:block font-size="12pt"> </fo:block> + <xsl:variable name="title-list-recommendations"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-list-recommendations'"/> + </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-recommendations"/></fo:block> + <xsl:for-each select="//ogc:permission[@id and ogc:name] | //ogc:recommendation[@id and ogc:name] | //ogc:requirement[@id and ogc:name]"> + <fo:block text-align-last="justify" margin-top="6pt"> + <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}"> + <xsl:apply-templates select="ogc:name" mode="contents"/> + <fo:inline keep-together.within-line="always"> + <fo:leader leader-pattern="dots"/> + <fo:page-number-citation ref-id="{@id}"/> + </fo:inline> + </fo:basic-link> + </fo:block> + </xsl:for-each> + </xsl:if> + + </fo:block-container> - <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters --> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract" mode="abstract"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1]"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + 1"/> - </xsl:apply-templates> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="preface"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ 1"/> - </xsl:apply-templates> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="introduction"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + 1"/> - </xsl:apply-templates> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + 1"/> - </xsl:apply-templates> - - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'submitters']"> - <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:preface/ogc:abstract) + count (/ogc:ogc-standard/ogc:bibdata/ogc:keyword[1])+ count(/ogc:ogc-standard/ogc:preface/ogc:foreword) + count(/ogc:ogc-standard/ogc:preface/ogc:introduction) + count(/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='author'][1]/ogc:organization/ogc:name) + count(/ogc:ogc-standard/ogc:preface/ogc:submitters)"/> - </xsl:apply-templates> - - + <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="preface"/> + </fo:flow> </fo:page-sequence> <!-- Document Pages --> @@ -494,34 +457,25 @@ <xsl:value-of select="$doctitle"/> </fo:block> <fo:block line-height="125%"> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']"> - <xsl:with-param name="sectionNum" select="'1'"/> - </xsl:apply-templates> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + 1"/> - </xsl:apply-templates> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']"/> <!-- Normative references --> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']"> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + 1"/> - </xsl:apply-templates> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']"/> + + <!-- Terms and definitions --> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:terms"> <!-- Terms and definitions --> - <xsl:with-param name="sectionNum" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + 1"/> - </xsl:apply-templates> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/> - - <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/*[local-name() != 'terms' and not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"> - <xsl:with-param name="sectionNumSkew" select="count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='_scope']) + count(/ogc:ogc-standard/ogc:sections/ogc:clause[@id='conformance' or @id='_conformance']) + count(/ogc:ogc-standard/ogc:bibliography/ogc:references[@id = '_normative_references' or @id = '_references' or @id = 'references']) + count(/ogc:ogc-standard/ogc:sections/ogc:terms)"/> - </xsl:apply-templates> - - <xsl:apply-templates select="/ogc:ogc-standard/ogc:annex"/> + + <!-- Bibliography --> <xsl:apply-templates select="/ogc:ogc-standard/ogc:bibliography/ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']"/> <!-- [position() &gt; 1] --> </fo:block> </fo:flow> </fo:page-sequence> @@ -529,306 +483,61 @@ <!-- End Document Pages --> </fo:root> </xsl:template> - <!-- for pass the paremeter 'sectionNum' over templates, like 'tunnel' parameter in XSLT 2.0 --> - <xsl:template match="node()"> - <xsl:param name="sectionNum"/> - <xsl:param name="sectionNumSkew"/> - <xsl:apply-templates> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/> - </xsl:apply-templates> + <xsl:template match="node()"> + <xsl:apply-templates/> </xsl:template> <!-- ============================= --> <!-- CONTENTS --> <!-- ============================= --> - <xsl:template match="node()" mode="contents"> - <xsl:param name="sectionNum"/> - <xsl:param name="sectionNumSkew"/> - <xsl:apply-templates mode="contents"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/> - </xsl:apply-templates> + <xsl:template match="node()" mode="contents"> + <xsl:apply-templates mode="contents"/> </xsl:template> - - <!-- calculate main section number (1,2,3) and pass it deep into templates --> - <!-- it's necessary, because there is itu:bibliography/itu:references from other section, but numbering should be sequental --> - <xsl:template match="ogc:ogc-standard/ogc:sections/*" mode="contents"> - <xsl:param name="sectionNum"/> - <xsl:param name="sectionNumSkew" select="0"/> - <xsl:variable name="sectionNum_"> - <xsl:choose> - <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when> - <xsl:when test="$sectionNumSkew != 0"> - <xsl:variable name="number"><xsl:number count="ogc:sections/ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable> <!-- * ogc:sections/ogc:clause | ogc:sections/ogc:terms --> - <xsl:value-of select="$number + $sectionNumSkew"/> - </xsl:when> - <xsl:otherwise> - <xsl:number count="*"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:apply-templates mode="contents"> - <xsl:with-param name="sectionNum" select="$sectionNum_"/> - </xsl:apply-templates> - </xsl:template> - <xsl:template match="ogc:ogc-standard/ogc:sections/ogc:terms" mode="contents"> - <xsl:param name="sectionNum"/> - <xsl:param name="sectionNumSkew" select="0"/> - <xsl:variable name="sectionNum_"> - <xsl:choose> - <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when> - <xsl:when test="$sectionNumSkew != 0"> - <xsl:variable name="number"><xsl:number count="*"/></xsl:variable> <!-- ogc:sections/ogc:clause | ogc:sections/ogc:terms --> - <xsl:value-of select="$number + $sectionNumSkew"/> - </xsl:when> - <xsl:otherwise> - <xsl:number count="*"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:apply-templates mode="contents"> - <xsl:with-param name="sectionNum" select="$sectionNum_"/> - </xsl:apply-templates> - </xsl:template> - - <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:clause" mode="contents"> - <xsl:param name="sectionNum"/> - <xsl:param name="sectionNumSkew" select="0"/> - <xsl:variable name="sectionNum_"> - <xsl:choose> - <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when> - <xsl:when test="$sectionNumSkew != 0"> - <xsl:variable name="number"><xsl:number count="ogc:clause"/></xsl:variable> - <xsl:value-of select="$number + $sectionNumSkew"/> - </xsl:when> - <xsl:otherwise> - <xsl:number count="*"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:apply-templates mode="contents"> - <xsl:with-param name="sectionNum" select="$sectionNum_"/> - </xsl:apply-templates> - </xsl:template> - - <!-- Any node with title element - clause, definition, annex,... --> - <xsl:template match="ogc:title | ogc:preferred" mode="contents"> - <xsl:param name="sectionNum"/> - <xsl:variable name="id"> - <xsl:call-template name="getId"/> - </xsl:variable> - + <!-- element with title --> + <xsl:template match="*[ogc:title]" mode="contents"> <xsl:variable name="level"> - <xsl:call-template name="getLevel"/> - </xsl:variable> - - <xsl:variable name="section"> - <xsl:call-template name="getSection"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> + <xsl:call-template name="getLevel"> + <xsl:with-param name="depth" select="ogc:title/@depth"/> </xsl:call-template> </xsl:variable> <xsl:variable name="display"> <xsl:choose> - <xsl:when test="ancestor::ogc:bibitem">false</xsl:when> - <xsl:when test="ancestor::ogc:term">false</xsl:when> - <xsl:when test="ancestor::ogc:annex and $level &gt;= 3">false</xsl:when> - <xsl:when test="$level &lt;= 3">true</xsl:when> - <xsl:otherwise>false</xsl:otherwise> - </xsl:choose> - </xsl:variable> - - <xsl:variable name="display-section"> - <xsl:choose> - <xsl:when test="ancestor::ogc:annex and $level &gt;= 2">true</xsl:when> - <xsl:when test="ancestor::ogc:annex">false</xsl:when> - <xsl:when test="$section = '0'">false</xsl:when> + <xsl:when test="ancestor-or-self::ogc:bibitem">false</xsl:when> + <xsl:when test="ancestor-or-self::ogc:term">false</xsl:when> + <xsl:when test="$level &gt;= 3">false</xsl:when> <xsl:otherwise>true</xsl:otherwise> </xsl:choose> </xsl:variable> - <xsl:variable name="type"> - <xsl:value-of select="local-name(..)"/> - </xsl:variable> - - <xsl:variable name="root"> - <xsl:choose> - <xsl:when test="ancestor::ogc:annex">annex</xsl:when> - <xsl:when test="ancestor::ogc:clause">clause</xsl:when> - <xsl:when test="ancestor::ogc:terms">terms</xsl:when> - </xsl:choose> - </xsl:variable> - <item id="{$id}" level="{$level}" section="{$section}" display-section="{$display-section}" display="{$display}" type="{$type}" root="{$root}"> - <xsl:attribute name="addon"> - <xsl:if test="local-name(..) = 'annex'"><xsl:value-of select="../@obligation"/></xsl:if> - </xsl:attribute> - <xsl:apply-templates/> - </item> + <xsl:if test="$display = 'true'"> - <xsl:apply-templates mode="contents"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:apply-templates> - - </xsl:template> - - <xsl:template match="ogc:ogc-standard/ogc:preface/*[not(local-name() = 'clause')]" mode="contents"> - <xsl:param name="sectionNum" select="'1'"/> - <xsl:variable name="section"> - <xsl:number format="i" value="$sectionNum"/> - </xsl:variable> - <xsl:variable name="id"> - <xsl:choose> - <xsl:when test="@id"> - <xsl:value-of select="@id"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="local-name()"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:if test="not(ogc:title)"> - <item id="{$id}" level="1" section="{$section}" display-section="true" display="true" type="abstract" root="preface"> - <xsl:if test="local-name() = 'foreword'"> - <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: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> - </item> - </xsl:if> - <xsl:apply-templates mode="contents"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:apply-templates> - </xsl:template> - - <!-- Keywords --> - <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:keyword" mode="contents"> - <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:variable name="title-keywords"> - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-keywords'"/> - </xsl:call-template> + <xsl:variable name="section"> + <xsl:call-template name="getSection"/> </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:variable name="title-submitting-organizations"> - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-submitting-organizations'"/> - </xsl:call-template> + + <xsl:variable name="title"> + <xsl:call-template name="getName"/> </xsl:variable> - <xsl:value-of select="$title-submitting-organizations"/> - </item> + + <xsl:variable name="type"> + <xsl:value-of select="local-name()"/> + </xsl:variable> + + <item id="{@id}" level="{$level}" section="{$section}" type="{$type}"> + <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/> + </item> + <xsl:apply-templates mode="contents"/> + </xsl:if> + </xsl:template> - <xsl:template match="ogc:figure" mode="contents"> - <xsl:param name="sectionNum"/> - <item level="" id="{@id}" type="figure"> - <xsl:attribute name="section"> - <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"/> - </xsl:when> - <xsl:otherwise> - <xsl:number format="A.1-1" level="multiple" count="ogc:annex | ogc:figure"/> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:when test="ancestor::ogc:figure"> - <xsl:for-each select="parent::*[1]"> - <xsl:number format="1" level="any" count="ogc:figure[not(parent::ogc:figure)]"/> - </xsl:for-each> - <xsl:number format="-a" count="ogc:figure"/> - </xsl:when> - <xsl:otherwise> - <xsl:number format="1" level="any" count="ogc:figure[not(parent::ogc:figure)] | ogc:sourcecode[not(@unnumbered = 'true') and not(ancestor::ogc:example)]"/> - <!-- <xsl:number format="1.1-1" level="multiple" count="ogc:annex | ogc:figure"/> --> - </xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:value-of select="ogc:name"/> - </item> - </xsl:template> - - - <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: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']"> - <xsl:number format="A-" count="ogc:annex"/> - <xsl:number format="1" level="any" count="ogc:table[ancestor::ogc:annex[@id = $annex-id]][not(@unnumbered='true')]"/> - </xsl:when> - <xsl:otherwise> - <xsl:number format="1" level="any" count="*[local-name()='sections']//*[local-name()='table'][not(@unnumbered='true')] | *[local-name()='preface']//*[local-name()='table'][not(@unnumbered='true')]"/> - </xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:value-of select="ogc:name/text()"/> - </item> - </xsl:template> - - - - <xsl:template match="ogc:formula" mode="contents"> - <item level="" id="{@id}" display="false"> - <xsl:attribute name="section"> - <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"/> <!-- ============================= --> <!-- ============================= --> <xsl:template match="/ogc:ogc-standard/ogc:bibdata/ogc:uri[not(@type)]"> <fo:block margin-bottom="12pt"> @@ -920,204 +629,44 @@ </xsl:attribute> <xsl:apply-templates/> </fo:block> </xsl:template> - - <!-- Introduction --> - <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:introduction" mode="introduction"> - <fo:block break-after="page"/> - <xsl:apply-templates select="current()"/> - </xsl:template> - <!-- Abstract --> - <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:abstract" mode="abstract"> - <fo:block break-after="page"/> - <xsl:apply-templates select="current()"/> - </xsl:template> - <!-- Preface --> - <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:foreword" mode="preface"> - <xsl:param name="sectionNum"/> - <fo:block break-after="page"/> - <xsl:apply-templates select="current()"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:apply-templates> - </xsl:template> - <!-- Abstract, Preface --> - <xsl:template match="ogc:ogc-standard/ogc:preface/*"> - <xsl:param name="sectionNum" select="'1'"/> - <xsl:if test="not(ogc:title)"> - <xsl:variable name="id"> - <xsl:choose> - <xsl:when test="@id"> - <xsl:value-of select="@id"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="local-name()"/> - </xsl:otherwise> - </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:call-template name="capitalize"> - <xsl:with-param name="str" select="$name"/> - </xsl:call-template> - </fo:block> - </xsl:if> - <xsl:apply-templates> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </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: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> - <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> --> - </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'"/> - <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: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> - <fo:list-item-label end-indent="label-end()"> - <fo:block>—</fo:block> - </fo:list-item-label> - <fo:list-item-body start-indent="body-start()" line-height-shift-adjustment="disregard-shifts"> - <fo:block> - <xsl:apply-templates/> - </fo:block> - </fo:list-item-body> - </fo:list-item> - </xsl:for-each> - </fo:list-block> - </xsl:template> - - - <!-- clause, terms, clause, ...--> - <xsl:template match="ogc:ogc-standard/ogc:sections/*"> - <xsl:param name="sectionNum"/> - <xsl:param name="sectionNumSkew" select="0"/> + <xsl:template match="/*/*[local-name() = 'preface']/*" priority="3"> <fo:block> - <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms --> - <xsl:if test="$pos &gt;= 2"> - <xsl:attribute name="space-before">18pt</xsl:attribute> - </xsl:if> - <xsl:variable name="sectionNum_"> - <xsl:choose> - <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when> - <xsl:when test="$sectionNumSkew != 0"> - <xsl:variable name="number"><xsl:number count="ogc:sections/ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms --> - <xsl:value-of select="$number + $sectionNumSkew"/> - </xsl:when> - <xsl:otherwise> - <xsl:number count="*"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:if test="not(ogc:title)"> - <fo:block margin-top="3pt" margin-bottom="12pt"> - <xsl:value-of select="$sectionNum_"/><xsl:number format=".1 " level="multiple" count="ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/> - </fo:block> - </xsl:if> - <xsl:apply-templates> - <xsl:with-param name="sectionNum" select="$sectionNum_"/> - </xsl:apply-templates> + <xsl:call-template name="setId"/> + <xsl:apply-templates/> </fo:block> </xsl:template> - <xsl:template match="ogc:ogc-standard/ogc:preface/ogc:clause"> - <xsl:param name="sectionNum"/> - <xsl:param name="sectionNumSkew" select="0"/> - <xsl:variable name="sectionNum_"> - <xsl:choose> - <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when> - <xsl:when test="$sectionNumSkew != 0"> - <xsl:variable name="number"><xsl:number count="ogc:clause"/></xsl:variable> - <xsl:value-of select="$number + $sectionNumSkew"/> - </xsl:when> - <xsl:otherwise> - <xsl:number count="*"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:apply-templates> - <xsl:with-param name="sectionNum" select="$sectionNum_"/> - </xsl:apply-templates> + <xsl:template match="ogc:ogc-standard/ogc:preface/*" mode="preface"> + <xsl:if test="local-name() = 'introduction' or local-name() = 'abstract' or local-name() = 'foreword'"> + <fo:block break-after="page"/> + </xsl:if> + <xsl:apply-templates select="current()"/> </xsl:template> + - <xsl:template match="ogc:clause//ogc:clause[not(ogc:title)]"> - <xsl:param name="sectionNum"/> - <xsl:variable name="section"> - <xsl:call-template name="getSection"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:call-template> - </xsl:variable> - - <fo:block margin-top="3pt"> - <fo:inline font-weight="bold" padding-right="3mm"> - <xsl:value-of select="$section"/> - </fo:inline> - <xsl:apply-templates> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - <xsl:with-param name="inline" select="'true'"/> - </xsl:apply-templates> + + + <!-- ====== --> + <!-- title --> + <!-- ====== --> + + <xsl:template match="ogc:annex/ogc:title"> + <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always" color="{$color}"> + <xsl:apply-templates/> </fo:block> </xsl:template> - <xsl:template match="ogc:title"> - <xsl:param name="sectionNum"/> - <xsl:variable name="parent-name" select="local-name(..)"/> - <xsl:variable name="references_num_current"> - <xsl:number level="any" count="ogc:references"/> - </xsl:variable> - - <xsl:variable name="id"> - <xsl:call-template name="getId"/> - </xsl:variable> - <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> - <xsl:variable name="section"> - <xsl:call-template name="getSection"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:call-template> - </xsl:variable> - <xsl:variable name="font-size"> <xsl:choose> <xsl:when test="ancestor::ogc:preface and $level &gt;= 2">12pt</xsl:when> <xsl:when test="ancestor::ogc:preface">13pt</xsl:when> <xsl:when test="$level = 1">13pt</xsl:when> @@ -1133,64 +682,24 @@ <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when> <xsl:otherwise>fo:block</xsl:otherwise> </xsl:choose> </xsl:variable> - <xsl:variable name="color" select="'rgb(14, 26, 133)'"/> - - <xsl:choose> - <xsl:when test="$parent-name = 'annex'"> - <fo:block id="{$id}" font-size="12pt" font-weight="bold" text-align="center" margin-bottom="12pt" keep-with-next="always" color="{$color}"> - <xsl:value-of select="$section"/> - <xsl:if test=" ../@obligation"> - <xsl:value-of select="$linebreak"/> - <fo:inline font-weight="normal">(<xsl:value-of select="../@obligation"/>)</fo:inline> - </xsl:if> - <xsl:value-of select="$linebreak"/> - <xsl:apply-templates/> - </fo:block> - </xsl:when> - <xsl:otherwise> - <xsl:element name="{$element-name}"> - <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute> - <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute> - <xsl:attribute name="font-weight">bold</xsl:attribute> - <xsl:attribute name="space-before">13.5pt</xsl:attribute> - <xsl:attribute name="margin-bottom">12pt</xsl:attribute> - <xsl:attribute name="keep-with-next">always</xsl:attribute> - <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute> - <xsl:if test="$section != ''"> - <xsl:if test="$section != '0'"> - <xsl:value-of select="$section"/><xsl:text>.</xsl:text> - <xsl:choose> - <xsl:when test="$level &gt;= 5"/> - <xsl:when test="$level &gt;= 4"> - <fo:inline padding-right="4mm"> </fo:inline> - </xsl:when> - <xsl:when test="$level &gt;= 3 and ancestor::ogc:terms"> - <fo:inline padding-right="2mm"> </fo:inline> - </xsl:when> - <xsl:when test="$level &gt;= 2"> - <fo:inline padding-right="3mm"> </fo:inline> - </xsl:when> - <xsl:when test="$level = 1"> - <fo:inline padding-right="3mm"> </fo:inline> - </xsl:when> - <xsl:otherwise> - <fo:inline padding-right="1mm"> </fo:inline> - </xsl:otherwise> - </xsl:choose> - </xsl:if> - </xsl:if> - <xsl:apply-templates/> - </xsl:element> - </xsl:otherwise> - </xsl:choose> - + <xsl:element name="{$element-name}"> + <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="space-before">13.5pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + <xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute> + <xsl:apply-templates/> + </xsl:element> + </xsl:template> + <!-- ====== --> + <!-- ====== --> - <xsl:template match="ogc:p"> <xsl:param name="inline" select="'false'"/> <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/> <xsl:variable name="element-name"> <xsl:choose> @@ -1239,11 +748,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)] | ogc:p/*/ogc:fn[not(ancestor::ogc:table)] | ogc:sourcecode/ogc:fn[not(ancestor::ogc:table)]" priority="2"> + <xsl:template match="ogc:title//ogc:fn | ogc:name//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}"> @@ -1267,80 +776,12 @@ <fo:block> <xsl:apply-templates/> </fo:block> </xsl:template> - <xsl:template match="ogc:review"> - <!-- comment 2019-11-29 --> - <!-- <fo:block font-weight="bold">Review:</fo:block> - <xsl:apply-templates /> --> - </xsl:template> - <xsl:template match="text()"> - <xsl:value-of select="."/> - </xsl:template> - - <xsl:template match="ogc:image"> <!-- only for without outer figure --> - <fo:block margin-top="12pt" margin-bottom="6pt"> - <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"> - <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-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-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> - </xsl:if> - <xsl:value-of select="ogc:name"/> - </xsl:if> - </fo:block> - </fo:block-container> - </xsl:template> - - <xsl:template match="ogc:figure/ogc:name"/> - <xsl:template match="ogc:figure/ogc:fn"/> - <xsl:template match="ogc:figure/ogc:note"/> - - - <xsl:template match="ogc:figure/ogc:image"> - <fo:block text-align="center"> - <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:bibitem"> <fo:block id="{@id}" margin-bottom="12pt" start-indent="12mm" text-indent="-12mm" line-height="115%"> <xsl:if test=".//ogc:fn"> <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute> </xsl:if> @@ -1382,11 +823,11 @@ </xsl:choose> </fo:block> </xsl:template> - <xsl:template match="ogc:bibitem/ogc:note"> + <xsl:template match="ogc:bibitem/ogc:note" priority="2"> <fo:footnote> <xsl:variable name="number"> <xsl:choose> <xsl:when test="ancestor::ogc:references[preceding-sibling::ogc:references]"> <xsl:number level="any" count="ogc:references[preceding-sibling::ogc:references]//ogc:bibitem/ogc:note"/> @@ -1425,11 +866,11 @@ <xsl:apply-templates/> </fo:list-block> </xsl:template> <xsl:template match="ogc:li"> - <fo:list-item> + <fo:list-item id="{@id}"> <fo:list-item-label end-indent="label-end()"> <fo:block> <xsl:choose> <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- dash --> <xsl:otherwise> <!-- for ordered lists --> @@ -1454,40 +895,32 @@ </xsl:otherwise> </xsl:choose> </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()" line-height-shift-adjustment="disregard-shifts"> - <xsl:apply-templates/> + <fo:block> + <xsl:apply-templates/> + </fo:block> </fo:list-item-body> </fo:list-item> </xsl:template> - <xsl:template match="ogc:ul/ogc:note | ogc:ol/ogc:note"> + <xsl:template match="ogc:ul/ogc:note | ogc:ol/ogc:note" priority="2"> <fo:list-item font-size="10pt"> <fo:list-item-label><fo:block/></fo:list-item-label> <fo:list-item-body> - <xsl:apply-templates/> + <fo:block> + <xsl:apply-templates select="ogc:name" mode="presentation"/> + <xsl:apply-templates/> + </fo:block> </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"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:call-template> - </xsl:variable> + <xsl:template match="ogc:preferred"> <xsl:variable name="level"> <xsl:call-template name="getLevel"/> </xsl:variable> <xsl:variable name="font-size"> <xsl:choose> @@ -1495,140 +928,44 @@ <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> - <xsl:value-of select="$section"/><xsl:text>.</xsl:text> - </fo:inline> + <xsl:apply-templates select="ancestor::ogc:term/ogc:name" mode="presentation"/> </fo:block> <fo:block font-weight="bold" keep-with-next="always" line-height="1"> <xsl:apply-templates/> </fo:block> </fo:block> </xsl:template> - <xsl:template match="ogc:admitted"> - <fo:block font-size="11pt"> - <xsl:apply-templates/> - </fo:block> - </xsl:template> - - <xsl:template match="ogc:deprecates"> - <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> - <xsl:template match="ogc:definition[preceding-sibling::ogc:domain]/ogc:p"> - <fo:inline> <xsl:apply-templates/></fo:inline> - <fo:block> </fo:block> - </xsl:template> - - <xsl:template match="ogc:definition"> - <fo:block space-after="6pt"> - <xsl:apply-templates/> - </fo:block> - </xsl:template> - - <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>[</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"/> - - </fo:inline> - </fo:basic-link> - <xsl:apply-templates select="ogc:modification"/> - <xsl:text>]</xsl:text> - </fo:block> - </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: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"> - <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template> - - <xsl:template match="ogc:domain"> - <fo:inline>&lt;<xsl:apply-templates/>&gt;</fo:inline> - </xsl:template> - - - <xsl:template match="ogc:termexample"> - <fo:block font-size="10pt" margin-bottom="12pt"> - <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"> - <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template> - <xsl:template match="ogc:annex"> - <fo:block break-after="page"/> - <xsl:apply-templates/> - </xsl:template> - - <!-- [position() &gt; 1] --> <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']"> <fo:block break-after="page"/> - <fo:block line-height="120%"> + <fo:block id="{@id}" line-height="120%"> <xsl:apply-templates/> </fo:block> </xsl:template> + <xsl:template match="ogc:annex//ogc:references"> + <fo:block id="{@id}"> + <xsl:apply-templates/> + </fo:block> + </xsl:template> <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages --> <!-- <xsl:template match="ogc:references[@id = '_bibliography']/ogc:bibitem"> [position() &gt; 1] --> <xsl:template match="ogc:references[@id != '_normative_references' and @id != '_references' and @id != 'references']/ogc:bibitem"> - <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm"> + <fo:list-block id="{@id}" margin-bottom="12pt" provisional-distance-between-starts="12mm"> <fo:list-item> <fo:list-item-label end-indent="label-end()"> <fo:block> - <fo:inline id="{@id}"> + <fo:inline> <xsl:number format="[1]"/> </fo:inline> </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> @@ -1701,230 +1038,14 @@ <fo:inline font-style="italic"> <xsl:apply-templates/> </fo:inline> </xsl:template> - <xsl:template match="ogc:quote"> - <fo:block margin-top="12pt" margin-left="13mm" margin-right="12mm"> - <xsl:apply-templates select=".//ogc:p"/> - </fo:block> - <xsl:if test="ogc:author or ogc:source"> - <fo:block text-align="right" margin-right="25mm"> - <!-- — ISO, ISO 7301:2011, Clause 1 --> - <xsl:if test="ogc:author"> - <xsl:text>— </xsl:text><xsl:value-of select="ogc:author"/> - </xsl:if> - <xsl:if test="ogc:source"> - <xsl:text>, </xsl:text> - <xsl:apply-templates select="ogc:source"/> - </xsl:if> - </fo:block> - </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:apply-templates select="ogc:localityStack"/> - </fo:basic-link> - </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> - <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'"><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: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: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/*"/> - </xsl:if> - </fo:block> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:otherwise> - <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="12pt"> - <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> - </fo:block> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - - <xsl:template match="ogc:sourcecode/text()"> - <xsl:variable name="text"> - <xsl:call-template name="add-zero-spaces-equal"/> - </xsl:variable> - <xsl:call-template name="add-zero-spaces"> - <xsl:with-param name="text" select="$text"/> - </xsl:call-template> - </xsl:template> - - - <xsl:template match="ogc:sourcecode/ogc:name"/> - - <xsl:template match="ogc:example"> - <fo:block font-size="10pt" text-align="center" margin-top="12pt" margin-bottom="12pt" font-weight="bold" keep-with-next="always"> - <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> - <xsl:apply-templates select="ogc:name/node()"/> - </xsl:if> - </fo:block> - <fo:block font-size="10pt" margin-left="12.5mm" margin-right="12.5mm"> - <xsl:apply-templates/> - </fo:block> - </xsl:template> - - <xsl:template match="ogc:example/ogc:name"/> - - <xsl:template match="ogc:example/ogc:p"> - <fo:block margin-bottom="14pt"> - <xsl:apply-templates/> - </fo:block> - </xsl:template> - - - - <xsl:template match="ogc:note/ogc:p" name="note"> - <fo:block font-size="10pt" margin-top="12pt" margin-bottom="12pt" line-height="115%"> - <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: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/> - </fo:block> - </xsl:template> - <!-- <eref type="inline" bibitemid="ISO20483" citeas="ISO 20483:2013"><locality type="annex"><referenceFrom>C</referenceFrom></locality></eref> --> - <xsl:template match="ogc:eref"> - <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}" color="blue" text-decoration="underline"> <!-- font-size="9pt" color="blue" vertical-align="super" --> - <xsl:if test="@type = 'footnote'"> - <xsl:attribute name="keep-together.within-line">always</xsl:attribute> - <xsl:attribute name="font-size">80%</xsl:attribute> - <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> - <xsl:attribute name="vertical-align">super</xsl:attribute> - </xsl:if> - <xsl:if test="@type = 'inline'"> - <xsl:attribute name="color">blue</xsl:attribute> - <xsl:attribute name="text-decoration">underline</xsl:attribute> - </xsl:if> - <!-- <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:when> - <xsl:when test="@bibitemid and normalize-space(text()) = ''"> - <xsl:value-of select="//ogc:bibitem[@id = current()/@bibitemid]/ogc:docidentifier"/> - </xsl:when> - <xsl:otherwise/> - </xsl:choose> - <xsl:apply-templates select="ogc:localityStack"/> - <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'"><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="java:toUpperCase(java:java.lang.String.new(@type))"/> @@ -1935,23 +1056,12 @@ </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 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%"/> @@ -1962,33 +1072,21 @@ <xsl:apply-templates/> </fo:block> </fo:table-cell> <fo:table-cell display-align="center"> <fo:block text-align="right"> - <xsl:choose> - <xsl:when test="ancestor::ogc:annex"> - <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> + <xsl:apply-templates select="../ogc:name" mode="presentation"/> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> - </fo:table> - <fo:inline keep-together.within-line="always"> - </fo:inline> + </fo:table> </fo:block> </xsl:template> - <xsl:template match="ogc:br" priority="2"> - <!-- <fo:block>&#xA0;</fo:block> --> - <xsl:value-of select="$linebreak"/> - </xsl:template> + <xsl:template match="ogc:pagebreak"> <fo:block break-after="page"/> <fo:block> </fo:block> <fo:block break-after="page"/> </xsl:template> @@ -2047,172 +1145,28 @@ </fo:table-body> </fo:table> </fo:block-container> </fo:static-content> </xsl:template> - - - <xsl:template name="getSection"> - <xsl:param name="sectionNum"/> - <xsl:variable name="level"> - <xsl:call-template name="getLevel"/> - </xsl:variable> - <xsl:variable name="section"> - <xsl:choose> - <xsl:when test="ancestor::ogc:bibliography"> - <xsl:value-of select="$sectionNum"/> - </xsl:when> - <xsl:when test="ancestor::ogc:sections"> - <!-- 1, 2, 3, 4, ... from main section (not annex, bibliography, ...) --> - <xsl:choose> - <xsl:when test="$level = 1"> - <xsl:value-of select="$sectionNum"/> - </xsl:when> - <xsl:when test="$level &gt;= 2"> - <xsl:variable name="num"> - <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 --> - </xsl:otherwise> - </xsl:choose> - <!-- <xsl:text>.</xsl:text> --> - </xsl:when> - <!-- <xsl:when test="ancestor::ogc:annex[@obligation = 'informative']"> - <xsl:choose> - <xsl:when test="$level = 1"> - <xsl:text>Annex </xsl:text> - <xsl:number format="I" level="any" count="ogc:annex[@obligation = 'informative']"/> - </xsl:when> - <xsl:otherwise> - <xsl:number format="I.1" level="multiple" count="ogc:annex[@obligation = 'informative'] | ogc:clause"/> - </xsl:otherwise> - </xsl:choose> - </xsl:when> --> - <xsl:when test="ancestor::ogc:annex"> - <xsl:choose> - <xsl:when test="$level = 1"> - <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> - <xsl:number format="A" level="any" count="ogc:annex"/> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:otherwise> - <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:number format=".1" level="multiple" count="ogc:clause"/> - </xsl:when> - <xsl:otherwise> - <xsl:number format="A.1" level="multiple" count="ogc:annex | ogc:clause"/> - </xsl:otherwise> - </xsl:choose> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:when test="ancestor::ogc:preface"> <!-- if preface and there is clause(s) --> - <xsl:choose> - <xsl:when test="$level = 1"> <!-- and ancestor::ogc:foreword --> - <xsl:number format="i" value="$sectionNum"/> - </xsl:when> - <!-- <xsl:when test="$level = 1 and ..//ogc:clause">0</xsl:when> --> - <xsl:when test="$level &gt;= 2"> - <xsl:number format="i.1" level="multiple" count="ogc:clause"/> - <!-- <xsl:value-of select="concat('0', $num)"/> --> - </xsl:when> - <xsl:otherwise> - <!-- z<xsl:value-of select="$sectionNum"/>z --> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:otherwise> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:value-of select="$section"/> - </xsl:template> <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_"> - - <title-table lang="en">Table </title-table> - <title-table lang="fr">Tableau </title-table> - - <title-table lang="zh">Table </title-table> - - - - <title-note lang="en">NOTE </title-note> - <title-note lang="fr">NOTE </title-note> - - <title-note lang="zh">NOTE </title-note> - - - - <title-figure lang="en">Figure </title-figure> - <title-figure lang="fr">Figure </title-figure> - - <title-figure lang="zh">Figure </title-figure> - - - - <title-example lang="en">EXAMPLE </title-example> - <title-example lang="fr">EXEMPLE </title-example> - - <title-example lang="zh">EXAMPLE </title-example> - - - - <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> - - <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> <title-annex lang="zh">Annex </title-annex> - - <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> @@ -2243,17 +1197,10 @@ </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> @@ -2263,29 +1210,25 @@ <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-list-recommendations lang="en">List of Recommendations</title-list-recommendations> <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> @@ -2304,11 +1247,11 @@ <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:variable><xsl:variable name="tab_zh"> </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]"/> @@ -2325,10 +1268,12 @@ <xsl:attribute name="color">blue</xsl:attribute> <xsl:attribute name="text-decoration">underline</xsl:attribute> </xsl:attribute-set><xsl:attribute-set name="sourcecode-style"> + <xsl:attribute name="white-space">pre</xsl:attribute> + <xsl:attribute name="wrap-option">wrap</xsl:attribute> @@ -2339,10 +1284,161 @@ <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 name="permission-style"> + + <xsl:attribute name="margin-top">6pt</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="permission-name-style"> + + <xsl:attribute name="font-size">11pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="padding-top">0.5mm</xsl:attribute> + <xsl:attribute name="padding-bottom">1mm</xsl:attribute> + <xsl:attribute name="margin-bottom">1mm</xsl:attribute> + <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="permission-label-style"> + + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="requirement-style"> + + <xsl:attribute name="margin-top">6pt</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="requirement-name-style"> + + <xsl:attribute name="font-size">11pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="padding-top">0.5mm</xsl:attribute> + <xsl:attribute name="padding-bottom">1mm</xsl:attribute> + <xsl:attribute name="margin-bottom">1mm</xsl:attribute> + <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="requirement-label-style"> + + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style"> + </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style"> + </xsl:attribute-set><xsl:attribute-set name="recommendation-style"> + + <xsl:attribute name="margin-top">6pt</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style"> + + <xsl:attribute name="font-size">11pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="padding-top">0.5mm</xsl:attribute> + <xsl:attribute name="padding-bottom">1mm</xsl:attribute> + <xsl:attribute name="margin-bottom">1mm</xsl:attribute> + <xsl:attribute name="background-color">rgb(165,165,165)</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style"> + + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="termexample-style"> + + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + + + + + + </xsl:attribute-set><xsl:attribute-set name="example-style"> + + + + + + + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-left">12.5mm</xsl:attribute> + <xsl:attribute name="margin-right">12.5mm</xsl:attribute> + + + + + </xsl:attribute-set><xsl:attribute-set name="example-body-style"> + + + </xsl:attribute-set><xsl:attribute-set name="example-name-style"> + + + + + + + + + + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="margin-top">12pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + + + + + + + </xsl:attribute-set><xsl:attribute-set name="example-p-style"> + + + + + + + + + <xsl:attribute name="margin-bottom">14pt</xsl:attribute> + + + + + </xsl:attribute-set><xsl:attribute-set name="termexample-name-style"> + + <xsl:attribute name="padding-right">10mm</xsl:attribute> + + + + + </xsl:attribute-set><xsl:attribute-set name="table-name-style"> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + + + + + + + + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + <xsl:attribute name="font-weight">normal</xsl:attribute> + <xsl:attribute name="font-size">11pt</xsl:attribute> + + + + </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> @@ -2356,79 +1452,216 @@ <xsl:attribute name="margin-top">8pt</xsl:attribute> <xsl:attribute name="margin-bottom">8pt</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="xref-style"> + + + <xsl:attribute name="color">blue</xsl:attribute> + <xsl:attribute name="text-decoration">underline</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="eref-style"> + + + <xsl:attribute name="color">blue</xsl:attribute> + <xsl:attribute name="text-decoration">underline</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="note-style"> + + + + + + + + + + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-top">12pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + <xsl:attribute name="line-height">115%</xsl:attribute> + + + + + + + </xsl:attribute-set><xsl:attribute-set name="note-name-style"> + + + + + + + + + + <xsl:attribute name="padding-right">4mm</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="note-p-style"> + + + + + + + + + + <xsl:attribute name="margin-top">12pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + + + + + </xsl:attribute-set><xsl:attribute-set name="termnote-style"> + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + + + + + + </xsl:attribute-set><xsl:attribute-set name="quote-style"> + + <xsl:attribute name="margin-top">12pt</xsl:attribute> + <xsl:attribute name="margin-left">13mm</xsl:attribute> + <xsl:attribute name="margin-right">12mm</xsl:attribute> + + + + + + + </xsl:attribute-set><xsl:attribute-set name="quote-source-style"> + + <xsl:attribute name="text-align">right</xsl:attribute> + <xsl:attribute name="margin-right">25mm</xsl:attribute> + + + + </xsl:attribute-set><xsl:attribute-set name="termsource-style"> + + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + <xsl:attribute name="keep-with-previous">always</xsl:attribute> + + + + + + </xsl:attribute-set><xsl:attribute-set name="origin-style"> + + + <xsl:attribute name="color">blue</xsl:attribute> + <xsl:attribute name="text-decoration">underline</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="term-style"> + + </xsl:attribute-set><xsl:attribute-set name="figure-name-style"> + + <xsl:attribute name="font-size">11pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="margin-top">12pt</xsl:attribute> + <xsl:attribute name="margin-bottom">6pt</xsl:attribute> + <xsl:attribute name="keep-with-previous">always</xsl:attribute> + + + + + + + + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="formula-style"> + + </xsl:attribute-set><xsl:attribute-set name="image-style"> + <xsl:attribute name="text-align">center</xsl:attribute> + + <xsl:attribute name="space-before">12pt</xsl:attribute> + <xsl:attribute name="space-after">6pt</xsl:attribute> + + + + + + </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style"> + + </xsl:attribute-set><xsl:attribute-set name="image-graphic-style"> + + <xsl:attribute name="width">100%</xsl:attribute> + <xsl:attribute name="content-height">scale-to-fit</xsl:attribute> + <xsl:attribute name="scaling">uniform</xsl:attribute> + + + + + + </xsl:attribute-set><xsl:attribute-set name="tt-style"> + + + <xsl:attribute name="font-family">Courier</xsl:attribute> + <xsl:attribute name="font-size">10pt</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style"> + <xsl:attribute name="font-size">11pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="domain-style"> + + </xsl:attribute-set><xsl:attribute-set name="admitted-style"> + + <xsl:attribute name="font-size">11pt</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="deprecates-style"> + + </xsl:attribute-set><xsl:attribute-set name="definition-style"> + + <xsl:attribute name="space-after">6pt</xsl:attribute> + + </xsl:attribute-set><xsl:template match="text()"> <xsl:value-of select="."/> </xsl:template><xsl:template match="*[local-name()='br']"> <xsl:value-of select="$linebreak"/> </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 match="*[local-name()='table']"> - <xsl:variable name="simple-table"> - <!-- <xsl:copy> --> - <xsl:call-template name="getSimpleTable"/> - <!-- </xsl:copy> --> + <xsl:variable name="simple-table"> + <xsl:call-template name="getSimpleTable"/> </xsl:variable> - <!-- DEBUG --> - <!-- SourceTable=<xsl:copy-of select="current()"/>EndSourceTable --> - <!-- Simpletable=<xsl:copy-of select="$simple-table"/>EndSimpltable --> - - <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> --> - <!-- <xsl:if test="$namespace = 'iso'"> - <fo:block space-before="6pt">&#xA0;</fo:block> - </xsl:if> --> - <xsl:choose> - <xsl:when test="@unnumbered = 'true'"/> - <xsl:otherwise> + + + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + - - - <fo:block font-weight="bold" text-align="center" margin-bottom="6pt" keep-with-next="always"> - - - - - - - <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"/> - - - <xsl:if test="*[local-name()='name']"> - - - - <xsl:text> — </xsl:text> - - <xsl:apply-templates select="*[local-name()='name']" mode="process"/> - </xsl:if> - </fo:block> - - - <xsl:call-template name="fn_name_display"/> - - </xsl:otherwise> - </xsl:choose> + <xsl:call-template name="fn_name_display"/> + + + <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/> <!-- <xsl:variable name="cols-count"> <xsl:choose> <xsl:when test="*[local-name()='thead']"> @@ -2524,38 +1757,19 @@ </fo:table> + + </fo:block-container> - </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']"> - - - - <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 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 match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation"> + <xsl:if test="normalize-space() != ''"> + <fo:block xsl:use-attribute-sets="table-name-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:if> </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])"/> @@ -2776,10 +1990,11 @@ + <xsl:if test="@colspan"> <xsl:attribute name="number-columns-spanned"> <xsl:value-of select="@colspan"/> </xsl:attribute> </xsl:if> @@ -2795,16 +2010,16 @@ </xsl:template><xsl:template match="*[local-name()='td']"> <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm"> + - <xsl:if test="@colspan"> <xsl:attribute name="number-columns-spanned"> <xsl:value-of select="@colspan"/> </xsl:attribute> </xsl:if> @@ -2814,25 +2029,13 @@ </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 /> - </xsl:when> - <xsl:otherwise> - <fo:block> - <xsl:apply-templates /> - </fo:block> - </xsl:otherwise> - </xsl:choose> --> - - + </fo:block> </fo:table-cell> - </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process"> + </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process"> <fo:block font-size="10pt" margin-bottom="12pt"> @@ -2840,30 +2043,18 @@ <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"/> - </xsl:if> + + <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> - - - </fo:inline> <xsl:apply-templates mode="process"/> </fo:block> - </xsl:template><xsl:template 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()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process"> <xsl:apply-templates/> </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}"> @@ -2925,11 +2116,11 @@ </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']"> + <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]"> <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}"> <xsl:apply-templates/> </fn> </xsl:for-each> </xsl:variable> @@ -3202,11 +2393,11 @@ <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:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2"> <xsl:param name="key_iso"/> <!-- <tr> <td>NOTE</td> <td> @@ -3218,16 +2409,11 @@ <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"/> + <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:apply-templates/> @@ -3295,11 +2481,11 @@ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline> </xsl:template><xsl:template match="*[local-name()='em']"> <fo:inline font-style="italic"> <xsl:apply-templates/> </fo:inline> - </xsl:template><xsl:template match="*[local-name()='strong']"> + </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']"> <fo:inline font-weight="bold"> <xsl:apply-templates/> </fo:inline> </xsl:template><xsl:template match="*[local-name()='sup']"> <fo:inline font-size="80%" vertical-align="super"> @@ -3308,11 +2494,11 @@ </xsl:template><xsl:template match="*[local-name()='sub']"> <fo:inline font-size="80%" vertical-align="sub"> <xsl:apply-templates/> </fo:inline> </xsl:template><xsl:template match="*[local-name()='tt']"> - <fo:inline font-family="Courier" font-size="10pt"> + <fo:inline xsl:use-attribute-sets="tt-style"> <xsl:apply-templates/> </fo:inline> </xsl:template><xsl:template match="*[local-name()='del']"> <fo:inline font-size="10pt" color="red" text-decoration="line-through"> <xsl:apply-templates/> @@ -3639,17 +2825,11 @@ <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 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 match="*[local-name()='link']" name="link"> + </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link"> <xsl:variable name="target"> <xsl:choose> <xsl:when test="starts-with(normalize-space(@target), 'mailto:')"> <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/> </xsl:when> @@ -3675,55 +2855,24 @@ </xsl:choose> </fo:basic-link> </xsl:otherwise> </xsl:choose> </fo:inline> - </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 match="*[local-name()='bookmark']"> <fo:inline id="{@id}"/> </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 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 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> + </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2"> + <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style"> + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> </fo:block> <xsl:apply-templates/> - </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 match="*[local-name() = 'callout']"> <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link> </xsl:template><xsl:template match="*[local-name() = 'annotation']"> <xsl:variable name="annotation-id" select="@id"/> <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/> @@ -3750,10 +2899,679 @@ <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 match="*[local-name() = 'xref']"> + <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style"> + + <xsl:apply-templates/> + </fo:basic-link> + </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula"> + <fo:block id="{@id}" xsl:use-attribute-sets="formula-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']"> + <fo:inline> + <xsl:apply-templates/> + </fo:inline> + </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']"> + <fo:inline> + <xsl:apply-templates/> + </fo:inline> + </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation"> + <xsl:if test="normalize-space() != ''"> + <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'note']" name="note"> + + <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style"> + + + <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> + + + + <fo:block-container margin-left="0mm"> + + + + + + + + + <fo:block> + + + + + <fo:inline xsl:use-attribute-sets="note-name-style"> + <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> + </fo:inline> + <xsl:apply-templates/> + </fo:block> + + + </fo:block-container> + </fo:block-container> + + </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']"> + <xsl:variable name="num"><xsl:number/></xsl:variable> + <xsl:choose> + <xsl:when test="$num = 1"> + <fo:inline xsl:use-attribute-sets="note-p-style"> + <xsl:apply-templates/> + </fo:inline> + </xsl:when> + <xsl:otherwise> + <fo:block xsl:use-attribute-sets="note-p-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template match="*[local-name() = 'termnote']"> + <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style"> + <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation"> + <xsl:param name="sfx"/> + <xsl:variable name="suffix"> + <xsl:choose> + <xsl:when test="$sfx != ''"> + <xsl:value-of select="$sfx"/> + </xsl:when> + <xsl:otherwise> + + + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:if test="normalize-space() != ''"> + <xsl:apply-templates/> + <xsl:value-of select="$suffix"/> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation"> + <xsl:param name="sfx"/> + <xsl:variable name="suffix"> + <xsl:choose> + <xsl:when test="$sfx != ''"> + <xsl:value-of select="$sfx"/> + </xsl:when> + <xsl:otherwise> + + <xsl:text>:</xsl:text> + + + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:if test="normalize-space() != ''"> + <xsl:apply-templates/> + <xsl:value-of select="$suffix"/> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']"> + <fo:inline><xsl:apply-templates/></fo:inline> + </xsl:template><xsl:template match="*[local-name() = 'terms']"> + <fo:block id="{@id}"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'term']"> + <fo:block id="{@id}" xsl:use-attribute-sets="term-style"> + + + + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation"> + <xsl:if test="normalize-space() != ''"> + <fo:inline> + <xsl:apply-templates/> + <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'"> + <xsl:text>.</xsl:text> + </xsl:if> --> + </fo:inline> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'figure']"> + <fo:block-container id="{@id}"> + <fo:block> + <xsl:apply-templates/> + </fo:block> + <xsl:call-template name="fn_display_figure"/> + <xsl:for-each select="*[local-name() = 'note']"> + <xsl:call-template name="note"/> + </xsl:for-each> + <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> + </fo:block-container> + </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']"> + <fo:block id="{@id}"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']"> + <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'image']"> + <fo:block xsl:use-attribute-sets="image-style"> + + + <xsl:variable name="src"> + <xsl:choose> + <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]"> + <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@src"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents"> + <xsl:apply-templates mode="contents"/> + <xsl:text> </xsl:text> + </xsl:template><xsl:template match="text()" mode="contents"> + <xsl:value-of select="."/> + </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation"> + <xsl:if test="normalize-space() != ''"> + <fo:block xsl:use-attribute-sets="figure-name-style"> + + <xsl:apply-templates/> + </fo:block> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item"> + <xsl:apply-templates mode="contents_item"/> + <!-- <xsl:text> </xsl:text> --> + </xsl:template><xsl:template name="getSection"> + <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/> + </xsl:template><xsl:template name="getName"> + <xsl:choose> + <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']"> + <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="*[local-name() = 'title']/node()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template name="insertTitleAsListItem"> + <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/> + <xsl:variable name="section"> + <xsl:for-each select=".."> + <xsl:call-template name="getSection"/> + </xsl:for-each> + </xsl:variable> + <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}"> + <fo:list-item> + <fo:list-item-label end-indent="label-end()"> + <fo:block> + <xsl:value-of select="$section"/> + </fo:block> + </fo:list-item-label> + <fo:list-item-body start-indent="body-start()"> + <fo:block> + <xsl:choose> + <xsl:when test="*[local-name() = 'tab']"> + <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </fo:block> + </fo:list-item-body> + </fo:list-item> + </fo:list-block> + </xsl:template><xsl:template name="extractTitle"> + <xsl:choose> + <xsl:when test="*[local-name() = 'tab']"> + <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> + </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item"> + <xsl:text> </xsl:text> + </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item"> + <xsl:copy> + <xsl:apply-templates mode="contents_item"/> + </xsl:copy> + </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item"> + <xsl:text> </xsl:text> + </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode"> + <fo:block xsl:use-attribute-sets="sourcecode-style"> + <xsl:apply-templates/> + </fo:block> + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()"> + <xsl:variable name="text"> + <xsl:call-template name="add-zero-spaces-equal"/> + </xsl:variable> + <xsl:call-template name="add-zero-spaces"> + <xsl:with-param name="text" select="$text"/> + </xsl:call-template> + </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation"> + <xsl:if test="normalize-space() != ''"> + <fo:block xsl:use-attribute-sets="sourcecode-name-style"> + + <xsl:apply-templates/> + </fo:block> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'permission']"> + <fo:block id="{@id}" xsl:use-attribute-sets="permission-style"> + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation"> + <xsl:if test="normalize-space() != ''"> + <fo:block xsl:use-attribute-sets="permission-name-style"> + <xsl:apply-templates/> + + <xsl:text>:</xsl:text> + + </fo:block> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']"> + <fo:block xsl:use-attribute-sets="permission-label-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'requirement']"> + <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style"> + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/> + <xsl:apply-templates select="@obligation" mode="presentation"/> + <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation"> + <xsl:if test="normalize-space() != ''"> + <fo:block xsl:use-attribute-sets="requirement-name-style"> + + <xsl:if test="../@type = 'class'"> + <xsl:attribute name="background-color">white</xsl:attribute> + </xsl:if> + + <xsl:apply-templates/> + + <xsl:text>:</xsl:text> + + </fo:block> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation"> + <fo:block xsl:use-attribute-sets="requirement-label-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation"> + <fo:block> + <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation"> + <fo:block xsl:use-attribute-sets="requirement-subject-style"> + <xsl:text>Target Type </xsl:text><xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']"> + <fo:block xsl:use-attribute-sets="requirement-inherit-style"> + <xsl:text>Dependency </xsl:text><xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'recommendation']"> + <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style"> + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation"> + <xsl:if test="normalize-space() != ''"> + <fo:block xsl:use-attribute-sets="recommendation-name-style"> + <xsl:apply-templates/> + + </fo:block> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']"> + <fo:block xsl:use-attribute-sets="recommendation-label-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'termexample']"> + <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style"> + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation"> + <xsl:if test="normalize-space() != ''"> + <fo:inline xsl:use-attribute-sets="termexample-name-style"> + <xsl:apply-templates/> + </fo:inline> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']"> + <fo:inline><xsl:apply-templates/></fo:inline> + </xsl:template><xsl:template match="*[local-name() = 'example']"> + <fo:block id="{@id}" xsl:use-attribute-sets="example-style"> + + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + + <xsl:variable name="element"> + block + + </xsl:variable> + + <xsl:choose> + <xsl:when test="normalize-space($element) = 'block'"> + <fo:block xsl:use-attribute-sets="example-body-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:inline> + <xsl:apply-templates/> + </fo:inline> + </xsl:otherwise> + </xsl:choose> + + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation"> + + <xsl:variable name="element"> + block + + </xsl:variable> + <xsl:choose> + <xsl:when test="ancestor::*[local-name() = 'appendix']"> + <fo:inline> + <xsl:apply-templates/> + </fo:inline> + </xsl:when> + <xsl:when test="normalize-space($element) = 'block'"> + <fo:block xsl:use-attribute-sets="example-name-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:when> + <xsl:otherwise> + <fo:inline xsl:use-attribute-sets="example-name-style"> + <xsl:apply-templates/> + </fo:inline> + </xsl:otherwise> + </xsl:choose> + + </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']"> + <fo:block xsl:use-attribute-sets="example-p-style"> + + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'termsource']"> + <fo:block xsl:use-attribute-sets="termsource-style"> + <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] --> + <xsl:variable name="termsource_text"> + <xsl:apply-templates/> + </xsl:variable> + <xsl:choose> + <xsl:when test="starts-with(normalize-space($termsource_text), '[')"> + <xsl:apply-templates/> + </xsl:when> + <xsl:otherwise> + <xsl:text>[</xsl:text> + <xsl:apply-templates/> + <xsl:text>]</xsl:text> + </xsl:otherwise> + </xsl:choose> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()"> + <xsl:if test="normalize-space() != ''"> + <xsl:value-of select="."/> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'origin']"> + <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> + + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'title-source'"/> + </xsl:call-template> + <xsl:text>: </xsl:text> + + <fo:inline xsl:use-attribute-sets="origin-style"> + <xsl:apply-templates/> + </fo:inline> + </fo:basic-link> + </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']"> + <fo:inline><xsl:apply-templates/></fo:inline> + </xsl:template><xsl:template match="*[local-name() = 'modification']/text()"> + <xsl:if test="normalize-space() != ''"> + <xsl:value-of select="."/> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'quote']"> + + <fo:block xsl:use-attribute-sets="quote-style"> + <xsl:apply-templates select=".//*[local-name() = 'p']"/> + </fo:block> + <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']"> + <fo:block xsl:use-attribute-sets="quote-source-style"> + <!-- — ISO, ISO 7301:2011, Clause 1 --> + <xsl:apply-templates select="*[local-name() = 'author']"/> + <xsl:apply-templates select="*[local-name() = 'source']"/> + </fo:block> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'source']"> + <xsl:if test="../*[local-name() = 'author']"> + <xsl:text>, </xsl:text> + </xsl:if> + <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> + <xsl:apply-templates/> + </fo:basic-link> + </xsl:template><xsl:template match="*[local-name() = 'author']"> + <xsl:text>— </xsl:text> + <xsl:apply-templates/> + </xsl:template><xsl:template match="*[local-name() = 'eref']"> + <fo:inline xsl:use-attribute-sets="eref-style"> + <xsl:if test="@type = 'footnote'"> + + <xsl:attribute name="keep-together.within-line">always</xsl:attribute> + <xsl:attribute name="font-size">80%</xsl:attribute> + <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> + <xsl:attribute name="vertical-align">super</xsl:attribute> + + + </xsl:if> + + <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> + + <xsl:if test="@type = 'inline'"> + + <xsl:attribute name="color">blue</xsl:attribute> + <xsl:attribute name="text-decoration">underline</xsl:attribute> + + + </xsl:if> + + + <xsl:apply-templates/> + </fo:basic-link> + </fo:inline> + </xsl:template><xsl:template match="*[local-name() = 'tab']"> + <!-- zero-space char --> + <xsl:variable name="depth"> + <xsl:call-template name="getLevel"> + <xsl:with-param name="depth" select="../@depth"/> + </xsl:call-template> + </xsl:variable> + + <xsl:variable name="padding"> + + + + + + + + + + + + + <xsl:choose> + <xsl:when test="$depth &gt;= 5"/> + <xsl:when test="$depth &gt;= 4">5</xsl:when> + <xsl:when test="$depth &gt;= 3 and ancestor::ogc:terms">3</xsl:when> + <xsl:when test="$depth &gt;= 2">4</xsl:when> + <xsl:when test="$depth = 1">4</xsl:when> + <xsl:otherwise>2</xsl:otherwise> + </xsl:choose> + + + + + + + </xsl:variable> + + <xsl:variable name="padding-right"> + <xsl:choose> + <xsl:when test="normalize-space($padding) = ''">0</xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space($padding)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> + + <xsl:choose> + <xsl:when test="$language = 'zh'"> + <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline> + </xsl:when> + <xsl:when test="../../@inline-header = 'true'"> + <fo:inline font-size="90%"> + <xsl:call-template name="insertNonBreakSpaces"> + <xsl:with-param name="count" select="$padding-right"/> + </xsl:call-template> + </fo:inline> + </xsl:when> + <xsl:otherwise> + <fo:inline padding-right="{$padding-right}mm">​</fo:inline> + </xsl:otherwise> + </xsl:choose> + + </xsl:template><xsl:template name="insertNonBreakSpaces"> + <xsl:param name="count"/> + <xsl:if test="$count &gt; 0"> + <xsl:text> </xsl:text> + <xsl:call-template name="insertNonBreakSpaces"> + <xsl:with-param name="count" select="$count - 1"/> + </xsl:call-template> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'domain']"> + <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline> + <xsl:text> </xsl:text> + </xsl:template><xsl:template match="*[local-name() = 'admitted']"> + <fo:block xsl:use-attribute-sets="admitted-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'deprecates']"> + <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:use-attribute-sets="deprecates-style"> + <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'definition']"> + <fo:block xsl:use-attribute-sets="definition-style"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]"> + <xsl:apply-templates/> + </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']"> + <fo:inline> <xsl:apply-templates/></fo:inline> + <fo:block> </fo:block> + </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2"> + + <fo:block> + <xsl:call-template name="setId"/> + + + + + + + + <xsl:variable name="pos"><xsl:number count="ogc:sections/ogc:clause[not(@id='_scope') and not(@id='conformance') and not(@id='_conformance')]"/></xsl:variable> <!-- | ogc:sections/ogc:terms --> + <xsl:if test="$pos &gt;= 2"> + <xsl:attribute name="space-before">18pt</xsl:attribute> + </xsl:if> + + + + + <xsl:apply-templates/> + </fo:block> + + + + </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2"> + <fo:block break-after="page"/> + <fo:block> + <xsl:call-template name="setId"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'clause']"> + <fo:block> + <xsl:call-template name="setId"/> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'definitions']"> + <fo:block id="{@id}"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@id = '_normative_references' or @id = '_references']"> + + <fo:block id="{@id}"> + <xsl:apply-templates/> + </fo:block> + </xsl:template><xsl:template match="*[local-name() = 'annex']"> + <fo:block break-after="page"/> + <fo:block id="{@id}"> + + </fo:block> + <xsl:apply-templates/> + </xsl:template><xsl:template match="*[local-name() = 'review']"> + <!-- comment 2019-11-29 --> + <!-- <fo:block font-weight="bold">Review:</fo:block> + <xsl:apply-templates /> --> + </xsl:template><xsl:template match="*[local-name() = 'name']/text()"> + <!-- 0xA0 to space replacement --> + <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/> + </xsl:template><xsl:template match="*[local-name() = 'errata']"> + <!-- <row> + <date>05-07-2013</date> + <type>Editorial</type> + <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change> + <pages>D-3</pages> + </row> + --> + <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black"> + <fo:table-column column-width="20mm"/> + <fo:table-column column-width="23mm"/> + <fo:table-column column-width="107mm"/> + <fo:table-column column-width="15mm"/> + <fo:table-body> + <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white"> + <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell> + <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell> + <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell> + <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell> + </fo:table-row> + <xsl:apply-templates/> + </fo:table-body> + </fo:table> + </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']"> + <fo:table-row> + <xsl:apply-templates/> + </fo:table-row> + </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*"> + <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm"> + <fo:block><xsl:apply-templates/></fo:block> + </fo:table-cell> </xsl:template><xsl:template 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)"/> @@ -3880,31 +3698,53 @@ <!-- <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:param name="depth"/> + <xsl:choose> + <xsl:when test="normalize-space(@depth) != ''"> + <xsl:value-of select="@depth"/> + </xsl:when> + <xsl:when test="normalize-space($depth) != ''"> + <xsl:value-of select="$depth"/> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="level_total" select="count(ancestor::*)"/> + <xsl:variable name="level"> + <xsl:choose> + <xsl:when test="parent::*[local-name() = 'preface']"> + <xsl:value-of select="$level_total - 1"/> + </xsl:when> + <xsl:when test="ancestor::*[local-name() = 'preface']"> + <xsl:value-of select="$level_total - 2"/> + </xsl:when> + <!-- <xsl:when test="parent::*[local-name() = 'sections']"> + <xsl:value-of select="$level_total - 1"/> + </xsl:when> --> + <xsl:when test="ancestor::*[local-name() = 'sections']"> + <xsl:value-of select="$level_total - 1"/> + </xsl:when> + <xsl:when test="ancestor::*[local-name() = 'bibliography']"> + <xsl:value-of select="$level_total - 1"/> + </xsl:when> + <xsl:when test="parent::*[local-name() = 'annex']"> + <xsl:value-of select="$level_total - 1"/> + </xsl:when> + <xsl:when test="ancestor::*[local-name() = 'annex']"> + <xsl:value-of select="$level_total"/> + </xsl:when> + <xsl:when test="local-name() = 'annex'">1</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:otherwise> + </xsl:choose> </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> @@ -3946,6 +3786,17 @@ <xsl:when test="$language = 'fr'">French</xsl:when> <xsl:when test="$language = 'de'">Deutsch</xsl:when> <xsl:when test="$language = 'cn'">Chinese</xsl:when> <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise> </xsl:choose> + </xsl:template><xsl:template name="setId"> + <xsl:attribute name="id"> + <xsl:choose> + <xsl:when test="@id"> + <xsl:value-of select="@id"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="generate-id()"/> + </xsl:otherwise> + </xsl:choose> + </xsl:attribute> </xsl:template></xsl:stylesheet> \ No newline at end of file