lib/isodoc/gb/gb.recommendation.xsl in metanorma-gb-1.5.0 vs lib/isodoc/gb/gb.recommendation.xsl in metanorma-gb-1.5.1

- old
+ new

@@ -37,34 +37,31 @@ --> <xsl:variable name="contents"> <contents> <xsl:apply-templates select="/gb:gb-standard/gb:preface/node()" mode="contents"/> - <xsl:apply-templates select="/gb:gb-standard/gb:sections/gb:clause[1]" mode="contents"> <!-- [@id = '_scope'] --> - <xsl:with-param name="sectionNum" select="'1'"/> - </xsl:apply-templates> - <xsl:apply-templates select="/gb:gb-standard/gb:bibliography/gb:references[1]" mode="contents"> <!-- [@id = '_normative_references'] --> - <xsl:with-param name="sectionNum" select="'2'"/> - </xsl:apply-templates> - <xsl:apply-templates select="/gb:gb-standard/gb:sections/*[position() &gt; 1]" mode="contents"> <!-- @id != '_scope' --> - <xsl:with-param name="sectionNumSkew" select="'1'"/> - </xsl:apply-templates> + <xsl:apply-templates select="/gb:gb-standard/gb:sections/gb:clause[1]" mode="contents"/> <!-- [@id = '_scope'] --> + + <!-- Normative references --> + <xsl:apply-templates select="/gb:gb-standard/gb:bibliography/gb:references[1]" mode="contents"/> <!-- [@id = '_normative_references'] --> + + <xsl:apply-templates select="/gb:gb-standard/gb:sections/*[position() &gt; 1]" mode="contents"/> <!-- @id != '_scope' --> + <xsl:apply-templates select="/gb:gb-standard/gb:annex" mode="contents"/> + + <!-- Bibliography --> <xsl:apply-templates select="/gb:gb-standard/gb:bibliography/gb:references[position() &gt; 1]" mode="contents"/> <!-- @id = '_bibliography' --> - <xsl:apply-templates select="//gb:figure" mode="contents"/> - - <xsl:apply-templates select="//gb:table" mode="contents"/> </contents> </xsl:variable> <xsl:variable name="lang"> <xsl:call-template name="getLang"/> </xsl:variable> <xsl:template match="/"> - <xsl:message>INFO: Document namespace: '<xsl:value-of select="namespace-uri(/*)"/>'</xsl:message> + <xsl:call-template name="namespaceCheck"/> <fo:root font-family="SimSun" font-size="10.5pt" xml:lang="{$lang}"> <!-- --> <fo:layout-master-set> <!-- cover page --> <fo:simple-page-master master-name="cover" page-width="{$pageWidth}" page-height="{$pageHeight}"> @@ -342,36 +339,23 @@ <xsl:text disable-output-escaping="yes">--&gt;</xsl:text> </xsl:if> <fo:block line-height="220%"> <xsl:variable name="margin-left">12</xsl:variable> - <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true'][not(@level = 2 and starts-with(@section, '0'))]"><!-- skip clause from preface --> + <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [@display = 'true'][not(@level = 2 and starts-with(@section, '0'))] skip clause from preface --> <fo:block text-align-last="justify"> <xsl:if test="@level =2"> <xsl:attribute name="margin-left">3.7mm</xsl:attribute> </xsl:if> <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}"> - <xsl:if test="normalize-space(@section) != '' and not(@display-section = 'false')"> - <fo:inline> - <xsl:if test="@type = 'annex' and @level = 1"> - <xsl:attribute name="font-weight">bold</xsl:attribute> - </xsl:if> + <xsl:if test="normalize-space(@section) != ''"> + <fo:inline> <xsl:value-of select="@section"/> </fo:inline> - <xsl:if test="not(@type = 'annex' and @level = 1)"> - <xsl:text>. </xsl:text> - </xsl:if> - <xsl:if test="@type = 'annex' and @level = 1"> - <xsl:text> </xsl:text> - </xsl:if> + <xsl:value-of select="$tab_zh"/> </xsl:if> - <xsl:if test="@addon != ''"> - <fo:inline font-weight="normal">(<xsl:value-of select="@addon"/>)</fo:inline> - <xsl:text> </xsl:text> - </xsl:if> - <xsl:value-of select="text()"/> - <xsl:text> </xsl:text> + <xsl:apply-templates/> <fo:inline keep-together.within-line="always"> <fo:leader font-weight="normal" leader-pattern="dots"/> <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline> </fo:inline> </fo:basic-link> @@ -405,23 +389,17 @@ <xsl:call-template name="insertTitle"> <xsl:with-param name="lang" select="$language"/> </xsl:call-template> </fo:block> - <xsl:apply-templates select="/gb:gb-standard/gb:sections/gb:clause[1]"> <!-- Scope --> - <xsl:with-param name="sectionNum" select="'1'"/> - </xsl:apply-templates> + <xsl:apply-templates select="/gb:gb-standard/gb:sections/gb:clause[1]"/> <!-- Scope --> <!-- Normative references --> - <xsl:apply-templates select="/gb:gb-standard/gb:bibliography/gb:references[1]"> - <xsl:with-param name="sectionNum" select="'2'"/> - </xsl:apply-templates> + <xsl:apply-templates select="/gb:gb-standard/gb:bibliography/gb:references[1]"/> <!-- Main sections --> - <xsl:apply-templates select="/gb:gb-standard/gb:sections/*[position() &gt; 1]"> - <xsl:with-param name="sectionNumSkew" select="'1'"/> - </xsl:apply-templates> + <xsl:apply-templates select="/gb:gb-standard/gb:sections/*[position() &gt; 1]"/> <!-- Annex(s) --> <xsl:apply-templates select="/gb:gb-standard/gb:annex"/> <!-- Bibliography --> @@ -480,189 +458,61 @@ </xsl:if> <xsl:value-of select="$title-part"/> </xsl:if> </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="gb:gb-standard/gb: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="*"/></xsl:variable> <!-- gb:sections/gb:clause | gb:sections/gb: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> - - <!-- Any node with title element - clause, definition, annex,... --> - <xsl:template match="gb:title | gb:preferred" mode="contents"> - <xsl:param name="sectionNum"/> - <!-- sectionNum=<xsl:value-of select="$sectionNum"/> --> - <xsl:variable name="id"> - <xsl:call-template name="getId"/> - </xsl:variable> - + <!-- element with title --> + <xsl:template match="*[gb: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="gb:title/@depth"/> </xsl:call-template> </xsl:variable> <xsl:variable name="display"> <xsl:choose> - <xsl:when test="ancestor::gb:bibitem">false</xsl:when> - <xsl:when test="ancestor::gb:term">false</xsl:when> - <xsl:when test="ancestor::gb:annex and $level &gt;= 3">false</xsl:when> - <xsl:when test="$level &lt;= 3">true</xsl:when> + <xsl:when test="ancestor-or-self::gb:bibitem">false</xsl:when> + <xsl:when test="ancestor-or-self::gb:term">false</xsl:when> + <xsl:when test="$level &lt;= 2">true</xsl:when> <xsl:otherwise>false</xsl:otherwise> </xsl:choose> </xsl:variable> - <xsl:variable name="display-section">true</xsl:variable> + <xsl:if test="$display = 'true'"> - <xsl:variable name="type"> - <xsl:value-of select="local-name(..)"/> - </xsl:variable> - - <xsl:variable name="root"> - <xsl:choose> - <xsl:when test="ancestor::gb:annex">annex</xsl:when> - </xsl:choose> - </xsl:variable> + <xsl:variable name="section"> + <xsl:call-template name="getSection"/> + </xsl:variable> + + <xsl:variable name="title"> + <xsl:call-template name="getName"/> + </xsl:variable> + + <xsl:variable name="type"> + <xsl:value-of select="local-name()"/> + </xsl:variable> + + <item id="{@id}" level="{$level}" section="{$section}" type="{$type}"> + <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/> + </item> + <xsl:apply-templates mode="contents"/> + </xsl:if> - <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:variable name="obligation" select="../@obligation"/> - <xsl:variable name="title-obligation-normative"> - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-obligation-normative'"/> - </xsl:call-template> - </xsl:variable> - <xsl:choose> - <xsl:when test="$obligation = 'normative'"><xsl:value-of select="$title-obligation-normative"/></xsl:when> - <xsl:otherwise><xsl:value-of select="$obligation"/></xsl:otherwise> - </xsl:choose> - </xsl:if> - </xsl:attribute> - <xsl:value-of select="."/> - </item> - - <xsl:apply-templates mode="contents"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:apply-templates> - </xsl:template> - <xsl:template match="gb:figure" mode="contents"> - <item level="" id="{@id}" display="false"> - <xsl:attribute name="section"> - <xsl:call-template name="getFigureNumber"/> - </xsl:attribute> - </item> - </xsl:template> - - <xsl:template match="gb:table" mode="contents"> - <xsl:param name="sectionNum"/> - <xsl:variable name="annex-id" select="ancestor::gb: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']"> <!-- NIST --> - <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table']"/> - </xsl:when> - <xsl:when test="ancestor::*[local-name()='annex']"> - <xsl:number format="A-" count="gb:annex"/> - <xsl:number format="1" level="any" count="gb:table[ancestor::gb:annex[@id = $annex-id]]"/> - </xsl:when> - <xsl:otherwise> - <!-- <xsl:number format="1"/> --> - <xsl:number format="1" level="any" count="*[local-name()='sections']//*[local-name()='table']"/> - </xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:value-of select="gb:name/text()"/> - </item> - </xsl:template> - - <xsl:template match="gb: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="gb:annex | gb:formula"/> - </xsl:attribute> - </item> - </xsl:template> - - <xsl:template match="gb:li" mode="contents"> - <xsl:param name="sectionNum"/> - <item level="" id="{@id}" display="false" type="li"> - <xsl:attribute name="section"> - <xsl:call-template name="getListItemFormat"/> - </xsl:attribute> - <xsl:attribute name="parent_section"> - <xsl:for-each select="ancestor::*[not(local-name() = 'p' or local-name() = 'ol')][1]"> - <xsl:call-template name="getSection"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:call-template> - </xsl:for-each> - </xsl:attribute> - </item> - <xsl:apply-templates mode="contents"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:apply-templates> - </xsl:template> - <xsl:template name="getListItemFormat"> <xsl:choose> <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- dash --> <xsl:otherwise> <!-- for ordered lists --> <xsl:choose> @@ -681,10 +531,13 @@ </xsl:template> <!-- ============================= --> <!-- ============================= --> + <xsl:template match="*[local-name() = 'tab']" priority="2"> + <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline> + </xsl:template> <xsl:template match="gb:license-statement//gb:title"> <fo:block text-align="center" font-weight="bold"> <xsl:apply-templates/> </fo:block> @@ -727,91 +580,54 @@ </xsl:if> <xsl:apply-templates/> </fo:block> </xsl:template> - <!-- Foreword, Introduction --> - <xsl:template match="gb:gb-standard/gb:preface/*"> - <fo:block break-after="page"/> - <xsl:apply-templates/> - </xsl:template> + <!-- ====== --> + <!-- title --> + <!-- ====== --> - <!-- clause, terms, clause, ...--> - <xsl:template match="gb:gb-standard/gb:sections/*"> - <xsl:param name="sectionNum"/> - <xsl:param name="sectionNumSkew" select="0"/> - <fo:block> - <xsl:variable name="pos"><xsl:number count="gb:sections/gb:clause | gb:sections/gb:terms"/></xsl:variable> - <xsl:if test="$pos &gt;= 2"> - <xsl:attribute name="space-before">18pt</xsl:attribute> - </xsl:if> - <!-- pos=<xsl:value-of select="$pos" /> --> - <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="gb:sections/gb:clause | gb:sections/gb:terms"/></xsl:variable> - <xsl:value-of select="$number + $sectionNumSkew"/> - </xsl:when> - </xsl:choose> - </xsl:variable> - <xsl:if test="not(gb:title)"> - <fo:block margin-top="3pt" margin-bottom="12pt"> - <xsl:value-of select="$sectionNum_"/><xsl:number format=".1 " level="multiple" count="gb:clause"/> - </fo:block> - </xsl:if> - <xsl:apply-templates> - <xsl:with-param name="sectionNum" select="$sectionNum_"/> - </xsl:apply-templates> + <xsl:template match="gb:annex/gb:title"> + <xsl:variable name="level"> + <xsl:call-template name="getLevel"/> + </xsl:variable> + <xsl:variable name="font-family"> + <xsl:choose> + <xsl:when test="$level &gt;= 3">SimSun</xsl:when> + <xsl:otherwise>SimHei</xsl:otherwise> + </xsl:choose> + </xsl:variable> + <fo:block font-family="{$font-family}" font-size="10.5pt" text-align="center" margin-bottom="24pt" keep-with-next="always"> + <xsl:apply-templates/> </fo:block> </xsl:template> - - <xsl:template match="gb:clause//gb:clause[not(gb: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="6pt" margin-bottom="6pt" keep-with-next="always"> - <fo:inline font-family="SimHei"> - <xsl:value-of select="$section"/><xsl:text>.</xsl:text> - </fo:inline> + <!-- Bibliography --> + <xsl:template match="gb:references[position() &gt; 1]/gb:title"> + <fo:block font-family="SimHei" text-align="center" margin-top="6pt" margin-bottom="16pt" keep-with-next="always"> + <xsl:apply-templates/> </fo:block> - <xsl:apply-templates> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:apply-templates> </xsl:template> - <xsl:template match="gb:title"> - <xsl:param name="sectionNum"/> - <xsl:variable name="parent-name" select="local-name(..)"/> - <xsl:variable name="references_num_current"> - <xsl:number level="any" count="gb: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 name="element-name"> + <xsl:choose> + <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when> + <xsl:otherwise>fo:block</xsl:otherwise> + </xsl:choose> </xsl:variable> <xsl:variable name="font-family"> <xsl:choose> <xsl:when test="ancestor::gb:annex and $level &gt;= 3">SimSun</xsl:when> + <xsl:when test="$element-name = 'fo:inline'">SimSun</xsl:when> <xsl:otherwise>SimHei</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="font-size"> @@ -819,112 +635,79 @@ <xsl:when test="ancestor::gb:preface">16pt</xsl:when> <xsl:otherwise>10.5pt</xsl:otherwise> </xsl:choose> </xsl:variable> - <xsl:variable name="element-name"> - <xsl:choose> - <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when> - <xsl:otherwise>fo:block</xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:choose> - <xsl:when test="$parent-name = 'annex'"> - <fo:block id="{$id}" font-family="{$font-family}" font-size="{$font-size}" text-align="center" margin-bottom="12pt" keep-with-next="always"> - <xsl:value-of select="$section"/> - <xsl:if test=" ../@obligation"> - <xsl:value-of select="$linebreak"/> - <fo:inline font-weight="normal"> - <xsl:text>(</xsl:text> - <xsl:variable name="obligation" select="../@obligation"/> - <xsl:variable name="title-obligation-normative"> - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-obligation-normative'"/> - </xsl:call-template> - </xsl:variable> - <xsl:choose> - <xsl:when test="$obligation = 'normative'"><xsl:value-of select="$title-obligation-normative"/></xsl:when> - <xsl:otherwise><xsl:value-of select="$obligation"/></xsl:otherwise> - </xsl:choose> - <xsl:text>)</xsl:text> - </fo:inline> - </xsl:if> - <fo:block margin-top="14pt" margin-bottom="24pt"><xsl:apply-templates/></fo:block> - </fo:block> - </xsl:when> - <xsl:when test="$parent-name = 'references' and $references_num_current != 1"> <!-- Bibliography --> - <fo:block id="{$id}" font-family="{$font-family}" text-align="center" margin-top="6pt" margin-bottom="16pt" keep-with-next="always"> - <xsl:apply-templates/> - </fo:block> - </xsl:when> + + <xsl:element name="{$element-name}"> + <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute> + <xsl:attribute name="font-family"><xsl:value-of select="$font-family"/></xsl:attribute> + <xsl:attribute name="margin-top"> + <xsl:choose> + <xsl:when test="ancestor::gb:preface">8pt</xsl:when> + <xsl:when test="$level = 2 and ancestor::gb:annex">10pt</xsl:when> + <xsl:when test="$level = 1">16pt</xsl:when> + <xsl:when test="$level = ''">6pt</xsl:when> + <xsl:when test="$level &gt;= 5">6pt</xsl:when> + <xsl:otherwise>12pt</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:attribute name="margin-bottom"> + <xsl:choose> + <xsl:when test="ancestor::gb:preface">24pt</xsl:when> + <xsl:when test="$level = 1">16pt</xsl:when> + <xsl:when test="$level &gt;= 5">6pt</xsl:when> + <xsl:otherwise>8pt</xsl:otherwise> + </xsl:choose> + </xsl:attribute> - <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-family"><xsl:value-of select="$font-family"/></xsl:attribute> - <xsl:attribute name="margin-top"> - <xsl:choose> - <xsl:when test="ancestor::gb:preface">8pt</xsl:when> - <xsl:when test="$level = 2 and ancestor::gb:annex">10pt</xsl:when> - <xsl:when test="$level = 1">16pt</xsl:when> - <xsl:when test="$level = ''">6pt</xsl:when> - <xsl:otherwise>12pt</xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:attribute name="margin-bottom"> - <xsl:choose> - <xsl:when test="ancestor::gb:preface">24pt</xsl:when> - <xsl:when test="$level = 1">16pt</xsl:when> - <xsl:otherwise>8pt</xsl:otherwise> - </xsl:choose> - </xsl:attribute> - <xsl:attribute name="keep-with-next">always</xsl:attribute> - <xsl:if test="ancestor::gb:preface"> - <xsl:attribute name="text-align">center</xsl:attribute> - <xsl:attribute name="font-family">SimHei</xsl:attribute> - </xsl:if> - <xsl:if test="$element-name = 'fo:inline'"> - <xsl:attribute name="padding-left">7.4mm</xsl:attribute> - </xsl:if> - - <xsl:value-of select="$section"/> - <xsl:if test="$section != ''">. </xsl:if> + + <xsl:attribute name="keep-with-next">always</xsl:attribute> + <xsl:if test="ancestor::gb:preface"> + <xsl:attribute name="text-align">center</xsl:attribute> + <xsl:attribute name="font-family">SimHei</xsl:attribute> + </xsl:if> + <xsl:if test="$element-name = 'fo:inline'"> + <xsl:attribute name="padding-left">7.4mm</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:if> + + <xsl:apply-templates/> + + <xsl:if test="$element-name = 'fo:inline'"> + <xsl:value-of select="$tab_zh"/> + </xsl:if> + + </xsl:element> + + <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::gb:p)"> + <!-- <fo:block> --> + <xsl:value-of select="$linebreak"/> + <!-- </fo:block> --> + </xsl:if> - <xsl:apply-templates/> - </xsl:element> - - <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::gb:p)"> - <!-- <fo:block> --> - <xsl:value-of select="$linebreak"/> - <!-- </fo:block> --> - </xsl:if> - </xsl:otherwise> - </xsl:choose> - </xsl:template> + </xsl:template> + <!-- ====== --> + <!-- ====== --> - - <xsl:template match="gb:p"> - <xsl:param name="inline" select="'false'"/> + <xsl:template match="gb:p"> <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/> <xsl:variable name="element-name"> - <xsl:choose> - <xsl:when test="$inline = 'true'">fo:inline</xsl:when> - <xsl:when test="../@inline-header = 'true' and $previous-element = 'title'">fo:inline</xsl:when> <!-- first paragraph after inline title --> - <!-- <xsl:when test="local-name(..) = 'admonition'">fo:inline</xsl:when> --> + <xsl:choose> + <xsl:when test="../@inline-header = 'true' and $previous-element = 'title'">fo:inline</xsl:when> <!-- first paragraph after inline title --> <xsl:otherwise>fo:block</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:element name="{$element-name}"> <xsl:attribute name="text-align"> <xsl:choose> <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when> <xsl:when test="ancestor::gb:td/@align"><xsl:value-of select="ancestor::gb:td/@align"/></xsl:when> <xsl:when test="ancestor::gb:th/@align"><xsl:value-of select="ancestor::gb:th/@align"/></xsl:when> - <xsl:otherwise>justify</xsl:otherwise><!-- left --> + <xsl:otherwise>justify</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:attribute name="text-indent"> <xsl:choose> <xsl:when test="parent::gb:li">0mm</xsl:when> @@ -935,25 +718,23 @@ <xsl:if test="parent::gb:dd and ancestor::*[local-name()='formula']"> <xsl:text>— </xsl:text> </xsl:if> <xsl:apply-templates/> </xsl:element> - <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')"> - <xsl:choose> + <xsl:if test="$element-name = 'fo:inline' and not(local-name(..) = 'admonition')"> + <xsl:value-of select="$linebreak"/> + <!-- <xsl:choose> <xsl:when test="ancestor::gb:annex"> <xsl:value-of select="$linebreak"/> </xsl:when> <xsl:otherwise> <fo:block margin-bottom="12pt"> <xsl:value-of select="$linebreak"/> </fo:block> </xsl:otherwise> - </xsl:choose> - </xsl:if> - <xsl:if test="$inline = 'true'"> - <fo:block> </fo:block> - </xsl:if> + </xsl:choose> --> + </xsl:if> </xsl:template> <xsl:template match="gb:li//gb:p//text()"> <xsl:choose> <xsl:when test="contains(., '&#9;')"> @@ -1021,96 +802,12 @@ <xsl:template match="gb:p/gb:fn/gb:p"> <xsl:apply-templates/> </xsl:template> - <xsl:template match="gb: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="gb:image"> - <fo:block-container text-align="center"> - <fo:block> - <fo:external-graphic src="{@src}" fox:alt-text="Image {@alt}"/> - </fo:block> - <fo:block font-family="SimHei" margin-top="12pt" margin-bottom="12pt"> - <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:call-template name="getFigureNumber"/> - </fo:block> - </fo:block-container> - </xsl:template> - - <xsl:template match="gb:figure"> - <fo:block-container id="{@id}"> - <fo:block> - <xsl:apply-templates/> - </fo:block> - <xsl:call-template name="fn_display_figure"/> - <xsl:for-each select="gb:note//gb:p"> - <xsl:call-template name="note"/> - </xsl:for-each> - <fo:block font-family="SimHei" text-align="center" margin-top="12pt" margin-bottom="12pt" keep-with-previous="always"> - <xsl:call-template name="getFigureNumber"/> - <xsl:if test="gb:name"> - <!-- <xsl:if test="not(local-name(..) = 'figure')"> --> - <xsl:text> — </xsl:text> - <!-- </xsl:if> --> - <xsl:value-of select="gb:name"/> - </xsl:if> - </fo:block> - </fo:block-container> - </xsl:template> - <xsl:template name="getFigureNumber"> - <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::gb:annex"> - <xsl:value-of select="$title-figure"/><xsl:number format="A.1-1" level="multiple" count="gb:annex | gb:figure"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$title-figure"/><xsl:number format="1" level="any"/> - </xsl:otherwise> - </xsl:choose> - </xsl:template> - <xsl:template match="gb:figure/gb:name"/> - <xsl:template match="gb:figure/gb:fn" priority="2"/> - <xsl:template match="gb:figure/gb:note"/> - - - <xsl:template match="gb:figure/gb:image"> - <fo:block text-align="center"> - <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}" width="100%" content-height="100%" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- src="{@src}" --> - </fo:block> - </xsl:template> - - <xsl:template match="gb:bibitem"> <fo:block id="{@id}" font-size="11pt" margin-bottom="12pt" text-indent="-11.7mm" margin-left="11.7mm"> <!-- 12 pt --> <!-- gb:docidentifier --> <xsl:if test="gb:docidentifier"> <xsl:choose> @@ -1132,11 +829,11 @@ </fo:inline> </fo:block> </xsl:template> - <xsl:template match="gb:bibitem/gb:note"> + <xsl:template match="gb:bibitem/gb:note" priority="2"> <fo:footnote> <xsl:variable name="number"> <xsl:number level="any" count="gb:bibitem/gb:note"/> </xsl:variable> <fo:inline font-size="50%" keep-with-previous.within-line="always" baseline-shift="30%"> @@ -1162,87 +859,67 @@ <xsl:if test="local-name() = 'ol'"> <xsl:attribute name="provisional-distance-between-starts">7mm</xsl:attribute> </xsl:if> <xsl:apply-templates/> </fo:list-block> - <xsl:for-each select="./gb:note//gb:p"> + <xsl:for-each select="./gb:note"> <xsl:call-template name="note"/> </xsl:for-each> </xsl:template> - <xsl:template match="gb:ul//gb:note | gb:ol//gb:note"/> + <xsl:template match="gb:ul//gb:note | gb:ol//gb:note" priority="2"/> <xsl:template match="gb:li"> <fo:list-item id="{@id}"> <fo:list-item-label end-indent="label-end()"> <fo:block> <xsl:call-template name="getListItemFormat"/> </fo:block> </fo:list-item-label> <fo:list-item-body start-indent="body-start()"> - <xsl:apply-templates/> - <xsl:apply-templates select=".//gb:note" mode="process"/> + <fo:block> + <xsl:apply-templates/> + <xsl:apply-templates select=".//gb:note" mode="process"/> + </fo:block> </fo:list-item-body> </fo:list-item> </xsl:template> - <xsl:template match="gb:term"> - <xsl:param name="sectionNum"/> - <fo:block id="{@id}" font-family="SimHei" font-size="11pt" keep-with-next="always" margin-top="10pt" margin-bottom="8pt" line-height="1.1"> - <fo:inline> - <xsl:variable name="section"> - <xsl:for-each select="*[1]"> - <xsl:call-template name="getSection"> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:call-template> - </xsl:for-each> - </xsl:variable> - <xsl:value-of select="$section"/><xsl:text>.</xsl:text> - </fo:inline> - </fo:block> - <fo:block> - <xsl:apply-templates> - <xsl:with-param name="sectionNum" select="$sectionNum"/> - </xsl:apply-templates> - </fo:block> - </xsl:template> - <xsl:template match="gb:preferred"> - <xsl:param name="sectionNum"/> - + <xsl:template match="gb:preferred" priority="2"> + <fo:inline font-family="SimHei" font-size="11pt"> <xsl:if test="not(preceding-sibling::*[1][local-name() = 'preferred'])"> <xsl:attribute name="padding-left">7.4mm</xsl:attribute> </xsl:if> - <xsl:apply-templates/><xsl:text> </xsl:text> + <xsl:apply-templates/><xsl:value-of select="$tab_zh"/> </fo:inline> <xsl:if test="not(following-sibling::*[1][local-name() = 'preferred'])"> <xsl:value-of select="$linebreak"/> </xsl:if> </xsl:template> - <xsl:template match="gb:admitted"> - <xsl:param name="sectionNum"/> + <xsl:template match="gb:admitted" priority="2"> <fo:inline font-size="11pt"> <xsl:if test="not(preceding-sibling::*[1][local-name() = 'admitted'])"> <xsl:attribute name="padding-left">7.4mm</xsl:attribute> </xsl:if> - <xsl:apply-templates/><xsl:text> </xsl:text> + <xsl:apply-templates/><xsl:value-of select="$tab_zh"/> </fo:inline> <xsl:if test="not(following-sibling::*[1][local-name() = 'admitted'])"> <xsl:value-of select="$linebreak"/> </xsl:if> </xsl:template> - <xsl:template match="gb:deprecates"> - <xsl:param name="sectionNum"/> + + <xsl:template match="gb:deprecates" priority="2"> <fo:inline font-size="11pt"> <xsl:if test="not(preceding-sibling::*[1][local-name() = 'deprecates'])"> <xsl:attribute name="padding-left">7.4mm</xsl:attribute> <xsl:variable name="title-deprecated"> <xsl:call-template name="getTitle"> @@ -1253,68 +930,26 @@ </xsl:if> <xsl:apply-templates/> </fo:inline> <xsl:if test="not(following-sibling::*[1][local-name() = 'deprecates'])"> <xsl:value-of select="$linebreak"/> - </xsl:if> - + </xsl:if> </xsl:template> - <xsl:template match="gb:definition[preceding-sibling::gb:domain]"> - <xsl:apply-templates/> - </xsl:template> - <xsl:template match="gb:definition[preceding-sibling::gb:domain]/gb:p"> - <fo:inline> <xsl:apply-templates/></fo:inline> - <fo:block> </fo:block> - </xsl:template> - - <xsl:template match="gb:definition"> - <fo:block> - <xsl:apply-templates/> - </fo:block> - </xsl:template> - - <xsl:template match="gb:termsource"> - <fo:block text-indent="7.4mm"> - <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] --> - <fo:basic-link internal-destination="{gb:origin/@bibitemid}" fox:alt-text="{gb:origin/@citeas}"> - <xsl:text>[</xsl:text> <!-- SOURCE: --> - <xsl:value-of select="gb:origin/@citeas"/> - - <xsl:apply-templates select="gb:origin/gb:localityStack"/> - - </fo:basic-link> - <xsl:apply-templates select="gb:modification"/> - <xsl:text>]</xsl:text> - </fo:block> - </xsl:template> - - <xsl:template match="gb:modification/gb:p"> - <xsl:apply-templates/> - </xsl:template> - <xsl:template match="gb:modification/text()"> - <xsl:apply-templates/> - </xsl:template> - <xsl:template match="gb:termnote"> + <xsl:template match="gb:termnote" priority="2"> <fo:block-container font-size="9pt" margin-left="7.4mm" margin-top="4pt" line-height="125%"> <fo:block-container margin-left="0mm"> <fo:table table-layout="fixed" width="100%"> <fo:table-column column-width="27mm"/> <fo:table-column column-width="138mm"/> <fo:table-body> <fo:table-row> <fo:table-cell> <fo:block font-family="SimHei"> - <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 select="gb:name" mode="presentation"/> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <xsl:apply-templates/> @@ -1325,52 +960,18 @@ </fo:table> </fo:block-container> </fo:block-container> </xsl:template> - <xsl:template match="gb:termnote/gb:p"> - <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template> - - <xsl:template match="gb:domain"> - <fo:inline padding-left="7.4mm">&lt;<xsl:apply-templates/>&gt; </fo:inline> - </xsl:template> - - - <xsl:template match="gb:termexample"> - <fo:block font-size="9pt" margin-top="14pt" margin-bottom="14pt" text-align="justify"> - <fo:inline padding-right="1mm" font-family="SimHei"> - <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::gb:term[1]//gb:termexample) &gt; 1"> - <xsl:number/> - </xsl:if> - <xsl:text>:</xsl:text> - </fo:inline> - <xsl:apply-templates/> - </fo:block> - </xsl:template> - - <xsl:template match="gb:termexample/gb:p"> - <fo:inline><xsl:apply-templates/></fo:inline> - </xsl:template> - - <xsl:template match="gb:annex"> - <fo:block break-after="page"/> - <xsl:apply-templates/> - </xsl:template> - <!-- <xsl:template match="gb:references[@id = '_bibliography']"> --> <xsl:template match="gb:references[position() &gt; 1]"> <fo:block break-after="page"/> - <xsl:apply-templates/> + <fo:block id="{@id}"> + <xsl:apply-templates/> + </fo:block> <fo:block-container text-align="center"> <fo:block-container margin-left="63mm" width="42mm" border-bottom="2pt solid black"> <fo:block> </fo:block> </fo:block-container> </fo:block-container> @@ -1425,204 +1026,22 @@ <fo:inline font-style="italic"> <xsl:apply-templates/> </fo:inline> </xsl:template> - <xsl:template match="gb:quote"> - <fo:block margin-top="12pt" margin-left="12mm" margin-right="12mm"> - <xsl:apply-templates select=".//gb:p"/> - </fo:block> - <fo:block text-align="right"> - <!-- — ISO, ISO 7301:2011, Clause 1 --> - <xsl:text>— </xsl:text><xsl:value-of select="gb:author"/> - <xsl:if test="gb:source"> - <xsl:text>, </xsl:text> - <xsl:apply-templates select="gb:source"/> - </xsl:if> - </fo:block> - </xsl:template> - - <xsl:template match="gb:source"> - <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> - <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" --> - <xsl:apply-templates select="gb:localityStack"/> - </fo:basic-link> - </xsl:template> - <xsl:template match="mathml:math" priority="2"> <fo:inline font-family="Cambria Math"> <fo:instream-foreign-object fox:alt-text="Math"> <xsl:copy-of select="."/> </fo:instream-foreign-object> </fo:inline> </xsl:template> - <xsl:template match="gb:xref"> - <xsl:param name="sectionNum"/> - - <xsl:variable name="target" select="normalize-space(@target)"/> - <fo:basic-link internal-destination="{$target}" fox:alt-text="{$target}"> - <xsl:variable name="section" select="xalan:nodeset($contents)//item[@id = $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 = $target]/@type"/> - <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id =$target]/@root"/> - <xsl:variable name="level" select="xalan:nodeset($contents)//item[@id =$target]/@level"/> - - <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' and $root != 'annex' and $level = 1"><xsl:value-of select="$title-clause"/></xsl:when><!-- and not (ancestor::annex) --> - <xsl:when test="$type = 'clause' and $root = 'annex'"><xsl:value-of select="$title-annex"/></xsl:when> - <xsl:when test="$type = 'li'"> - <xsl:attribute name="color">black</xsl:attribute> - <xsl:attribute name="text-decoration">none</xsl:attribute> - <xsl:variable name="parent_section" select="xalan:nodeset($contents)//item[@id =$target]/@parent_section"/> - <xsl:variable name="currentSection"> - <xsl:call-template name="getSection"/> - </xsl:variable> - <xsl:if test="not(contains($parent_section, $currentSection))"> - <fo:basic-link internal-destination="{$target}" fox:alt-text="{$target}"> - <xsl:attribute name="color">blue</xsl:attribute> - <xsl:attribute name="text-decoration">underline</xsl:attribute> - <xsl:value-of select="$parent_section"/><xsl:text> </xsl:text> - </fo:basic-link> - </xsl:if> - </xsl:when> - <xsl:when test="normalize-space($section) = ''"> - <xsl:text>[</xsl:text><xsl:value-of select="$target"/><xsl:text>]</xsl:text> - </xsl:when> - <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> --> - </xsl:choose> - <xsl:value-of select="$section"/> - </fo:basic-link> - </xsl:template> - - <xsl:template match="gb:example/gb:p"> - <fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt"> - <!-- <xsl:if test="ancestor::gb:li"> - <xsl:attribute name="font-size">11pt</xsl:attribute> - </xsl:if> --> - <xsl:variable name="claims_id" select="ancestor::gb:clause[1]/@id"/> - <fo:inline padding-right="5mm"> - <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::gb:clause[1]//gb:example) &gt; 1"> - <xsl:number count="gb:example[ancestor::gb:clause[@id = $claims_id]]" level="any"/> - </xsl:if> - </fo:inline> - <xsl:apply-templates/> - </fo:block> - </xsl:template> - - <xsl:template match="gb:note/gb:p" name="note"> - <xsl:variable name="claims_id" select="ancestor::gb:clause[1]/@id"/> - <fo:block-container font-size="9pt" margin-left="7.4mm" margin-top="4pt" line-height="125%"> - <fo:block-container margin-left="0mm"> - <fo:table table-layout="fixed" width="100%"> - <fo:table-column column-width="10mm"/> - <fo:table-column column-width="155mm"/> - <fo:table-body> - <fo:table-row> - <fo:table-cell> - <fo:block font-family="SimHei"> - <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="normalize-space($title-note)"/> - <xsl:if test="count(ancestor::gb:clause[1]//gb:note) &gt; 1"> - <xsl:text> </xsl:text><xsl:number count="gb:note[ancestor::gb:clause[@id = $claims_id]]" level="any"/> - </xsl:if> - <xsl:text>:</xsl:text> - </fo:block> - </fo:table-cell> - <fo:table-cell> - <fo:block text-align="justify"> - <xsl:apply-templates/> - </fo:block> - </fo:table-cell> - </fo:table-row> - </fo:table-body> - </fo:table> - </fo:block-container> - </fo:block-container> - </xsl:template> - <!-- <eref type="inline" bibitemid="IEC60050-113" citeas="IEC 60050-113:2011"><localityStack><locality type="clause"><referenceFrom>113-01-12</referenceFrom></locality></localityStack></eref> --> - <xsl:template match="gb:eref"> - <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> <!-- 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">50%</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: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="//gb:bibitem[@id = current()/@bibitemid]/gb:docidentifier"/> - </xsl:when> - <xsl:otherwise/> - </xsl:choose> - <xsl:apply-templates select="gb:localityStack"/> - <xsl:apply-templates select="text()"/> - </fo:basic-link> - </xsl:template> + - <xsl:template match="gb: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:variable name="title-table"> - <xsl:call-template name="getTitle"> - <xsl:with-param name="name" select="'title-table'"/> - </xsl:call-template> - </xsl:variable> - <xsl:choose> - <xsl:when test="@type ='section' and ancestor::gb:termsource">SOURCE Section </xsl:when> - <xsl:when test="ancestor::gb:termsource"/> - <xsl:when test="@type ='clause' and ancestor::gb:eref"/> - <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:when test="@type ='table'"><xsl:value-of select="$title-table"/></xsl:when> - <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise> - </xsl:choose> - <xsl:text> </xsl:text><xsl:value-of select="gb:referenceFrom"/> - </xsl:template> - <xsl:template match="gb:admonition"> <xsl:variable name="title-caution"> <xsl:call-template name="getTitle"> <xsl:with-param name="name" select="'title-caution'"/> </xsl:call-template> @@ -1642,22 +1061,11 @@ <fo:block font-weight="bold"> <xsl:apply-templates/> </fo:block> </xsl:template> - <xsl:template match="gb:formula"> - <fo:block id="{@id}"> - <xsl:apply-templates/> - </fo:block> - </xsl:template> - - <xsl:template match="gb:formula/gb:dt/gb:stem"> - <fo:inline> - <xsl:apply-templates/> - </fo:inline> - </xsl:template> - + <xsl:template match="gb:formula/gb:stem"> <fo:block font-size="11pt" margin-top="14pt" margin-bottom="14pt"> <fo:table table-layout="fixed" width="170mm"> <fo:table-column column-width="165mm"/> <fo:table-column column-width="5mm"/> @@ -1668,32 +1076,20 @@ <xsl:apply-templates/> </fo:block> </fo:table-cell> <fo:table-cell display-align="center"> <fo:block text-align="left"> - <xsl:choose> - <xsl:when test="ancestor::gb:annex"> - <xsl:number format="(A.1)" level="multiple" count="gb:annex | gb:formula"/> - </xsl:when> - <xsl:otherwise> <!-- not(ancestor::gb:annex) --> - <xsl:number format="(1)" level="any" count="gb:formula"/> - </xsl:otherwise> - </xsl:choose> + <xsl:apply-templates select="../gb: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="gb:br" priority="2"> - <!-- <fo:block>&#xA0;</fo:block> --> - <xsl:value-of select="$linebreak"/> - </xsl:template> + <xsl:template name="insertHeaderFooter"> <fo:static-content flow-name="header"> <fo:block-container height="30mm" display-align="after"> <fo:block font-family="SimHei" font-size="12pt"> @@ -1722,92 +1118,10 @@ </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::gb:bibliography"> - <xsl:value-of select="$sectionNum"/> - </xsl:when> - <xsl:when test="ancestor::gb: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:when> - <xsl:when test="ancestor::gb:annex"> - <xsl:variable name="annexid" select="normalize-space(/gb:gb-standard/gb:bibdata/gb:ext/gb:structuredidentifier/gb:annexid)"/> - <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(//gb:annex) = 1 and $annexid != ''"> - <xsl:value-of select="$annexid"/> - </xsl:when> - <xsl:otherwise> - <xsl:number format="A" level="any" count="gb:annex"/> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:otherwise> - <xsl:choose> - <xsl:when test="count(//gb:annex) = 1 and $annexid != ''"> - <xsl:value-of select="$annexid"/><xsl:number format=".1" level="multiple" count="gb:clause"/> - </xsl:when> - <xsl:otherwise> - <xsl:number format="A.1" level="multiple" count="gb:annex | gb:clause"/> - </xsl:otherwise> - </xsl:choose> - </xsl:otherwise> - </xsl:choose> - </xsl:when> - <xsl:when test="ancestor::gb:preface"> <!-- if preface and there is clause(s) --> - <xsl:choose> - <xsl:when test="$level = 1 and ..//gb:clause">0</xsl:when> - <xsl:when test="$level &gt;= 2"> - <xsl:variable name="num"> - <xsl:number format=".1" level="multiple" count="gb:clause"/> - </xsl:variable> - <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="Image-GB-Logo"> - <xsl:text>R0lGODlhWAIvAcQSAEBAQL+/v39/f4CAgO/v7xAQEDAwMJ+fn8/Pz2BgYCAgIN/f31BQUK+vr4+Pj3BwcP///wAAAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAABYAi8BAAX/oCSOZGmeaKqubOu+MBIcgpAAOBDtfO//wKBwSCwaj8gkEUBwIRTKqHRKrVqvWF4hh6sJGgEEbEwum8/otHqdWgRsgEJ2Tq/bpQcX487v+/+APlsMXwFsh4iJiouLCAcPOoGSk5REAi6RlZqbnJUGCQ6GjKOkpaZnBA0CmUhbOQ8DsbKztLW2t7i5uru8vb6/tAY+ly2sEQzAycrLzM3Oz843OcJRAA8NTafa29yJDQ/URQDIBwEBEOjp6uvs7e7v8PHy8/T19vIHP8QsxgUI9wADChxIsKDBg+sImHMwgEEcIwAciOlGsaJFEwgcGAPyKRQBhCBDihxJrwGQfSs2//ojybKly5cwFTqARETBg4kXc+pcFOABFCEKQJ2DSbSoUXcI5OzYswOlikgGwq08SrWqVaOOEvwEYnPBzq9gyTRIoJTrtQVX06oFmZSHAQI8nKaIxETqv7V48+qlt+AA2SAA8oQdTHgEggdlBTE4gHav48dIy76FEBfTDgAQCGydCrmz57Q9t/YoIMBr4dMWFwgQ3cPm0M+w9xKQ/JFyU8sRMENou6NA49jAg7M8zHpHAtOok5c6wPSHAYnCo6clEE5BbdsR5KKgm453hMnSw4sX2KB5DwailKtnswAx1wG/x8t3SV3LXXSVi11W5x38/P8ArrPAAMUdt96BZgRgnv8WNwXooEj19XYffrfpl9s6/V334IbjHVDcA9kgKKIKHgKxGIcoGpQJZ+nkx89+GNKW4ozRlTiaAy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zkIu+4udeBcOIClicNdwgCGjAAJVYcCaNYC8VjbvObL3ueplx5zgLgcgvi3ArL7PeMg270o3vj/+QBhkM36i1o7/l8AANIAACKjvQSILwjNb8617t+DXm7uAQFGDnZy272s6Md7Vb3uhKmbZitsz3ucVc6uP9AZ7njPe77Ak2O8+73v9Nd4XCA+98LT0d0u4bbhl/8pgO/D8IzPvKGFipoPCz5yzce7L1eO+Y7vxq9SMfgnh89Xhy/edKjvoagDw+iUu9645ge0px/Pe0vKyM71z73s9T8LCCv+9+n4QFSKiXwi99t3nvC98ZfPgrkbCHLMz/6SYh98mcv/etXiFGtxz73UUB9RCi/+8VfvZsWYH3x5/77gz8/+sdvLui33/jqDxf74597KAls+/Zn/vwVWf/9v96vrP9MpAFg8fWfaP1fAaLe3iGN/ilg7R1gEYTfA46e8wkMAVKg60XgEExgBmIe+Y1NA0CcBzLeBgZBB5Ig430L97xAh6Xg6JkgBKDgCxaehLBgDCCAutFgxJngDO4g3j3YDRLDCP5g122gDxYh2/GWENqAAJRcEgZdBCIhFF5dEDLhDRCAE1Lh3CEfkyTgFnqdDV5hDmThE4Lhr/XfFJ7hzUHZGPqQFq5hFHahDH5hHAZdAYCgG5IhHNphxamfGvbhr32MHt6B5wTiv30fIB7iHIkhITaKvi0iDVGfIkbiFDWaI0LCAggAEVaikFFiJ7IQwHQZJkICtIGiJILdJ56iZGCuTYKRIj85zyqWnrypoiyKWbC94i5MCCTaojUEXi32YkQ00Cjmop6UWzD2A90ZQB0i41YUG+UVI6KlUDMuA91R478pgLFFI18IgA7KojVe4xwZwORs42egUAIw4yqCYzjakAE8ABaVo3qYUTdyIjKuIzuyYuwMXTyGiM8JQBrhYx7GAC/i4zrUjwDkET/+DNQ5QP6k0QWlowICgCu6AO4VpDDUzwXpTwAEAEVaSAgAADs=</xsl:text> - </xsl:variable> --> <xsl:template name="addLetterSpacing"> <xsl:param name="text"/> <xsl:param name="letter-spacing" select="'0.15'"/> <xsl:if test="string-length($text) &gt; 0"> @@ -1819,76 +1133,24 @@ </xsl:call-template> </xsl:if> </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">表 </title-table> - - - <title-note lang="en">NOTE </title-note> - <title-note lang="fr">NOTE </title-note> - - - <title-note lang="zh">注 </title-note> - - - <title-figure lang="en">Figure </title-figure> - <title-figure lang="fr">Figure </title-figure> - - - <title-figure lang="zh">图 </title-figure> - - - <title-example lang="en">EXAMPLE </title-example> - <title-example lang="fr">EXEMPLE </title-example> - - - <title-example lang="zh">示例 </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">附件 </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">条 </title-clause> - - + <title-edition lang="en"> </title-edition> - <title-formula lang="en">Formula </title-formula> - <title-formula lang="fr">Formula </title-formula> - + <title-toc lang="en"> <xsl:text>Table of contents</xsl:text> @@ -1923,17 +1185,10 @@ <xsl:text>Partie #: </xsl:text> </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">注#: </title-note-to-entry> - - <title-modified lang="en">modified</title-modified> <title-modified lang="fr">modifiée</title-modified> <title-modified lang="zh">改写</title-modified> @@ -1943,29 +1198,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> @@ -1984,11 +1235,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]"/> @@ -2002,10 +1253,12 @@ </xsl:choose> </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style"> </xsl:attribute-set><xsl:attribute-set name="sourcecode-style"> + <xsl:attribute name="white-space">pre</xsl:attribute> + <xsl:attribute name="wrap-option">wrap</xsl:attribute> <xsl:attribute name="font-family">Courier</xsl:attribute> <xsl:attribute name="font-size">9pt</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> @@ -2014,10 +1267,122 @@ + </xsl:attribute-set><xsl:attribute-set name="permission-style"> + + </xsl:attribute-set><xsl:attribute-set name="permission-name-style"> + + </xsl:attribute-set><xsl:attribute-set name="permission-label-style"> + + </xsl:attribute-set><xsl:attribute-set name="requirement-style"> + + </xsl:attribute-set><xsl:attribute-set name="requirement-name-style"> + + </xsl:attribute-set><xsl:attribute-set name="requirement-label-style"> + + </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-set><xsl:attribute-set name="recommendation-name-style"> + + + </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style"> + + </xsl:attribute-set><xsl:attribute-set name="termexample-style"> + + + + <xsl:attribute name="font-size">9pt</xsl:attribute> + <xsl:attribute name="margin-top">14pt</xsl:attribute> + <xsl:attribute name="margin-bottom">14pt</xsl:attribute> + <xsl:attribute name="text-align">justify</xsl:attribute> + + + + + + </xsl:attribute-set><xsl:attribute-set name="example-style"> + + + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-top">8pt</xsl:attribute> + <xsl:attribute name="margin-bottom">8pt</xsl:attribute> + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="example-body-style"> + + + </xsl:attribute-set><xsl:attribute-set name="example-name-style"> + + + + <xsl:attribute name="padding-right">5mm</xsl:attribute> + + + + + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="example-p-style"> + + + + <xsl:attribute name="font-size">10pt</xsl:attribute> + <xsl:attribute name="margin-top">8pt</xsl:attribute> + <xsl:attribute name="margin-bottom">8pt</xsl:attribute> + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="termexample-name-style"> + + + <xsl:attribute name="padding-right">1mm</xsl:attribute> + <xsl:attribute name="font-family">SimHei</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="font-family">SimHei</xsl:attribute> + <xsl:attribute name="font-weight">normal</xsl:attribute> + <xsl:attribute name="margin-bottom">12pt</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> @@ -2031,80 +1396,199 @@ <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-set><xsl:attribute-set name="eref-style"> + + + + </xsl:attribute-set><xsl:attribute-set name="note-style"> + + + + <xsl:attribute name="font-size">9pt</xsl:attribute> + <xsl:attribute name="margin-left">7.4mm</xsl:attribute> + <xsl:attribute name="margin-top">4pt</xsl:attribute> + <xsl:attribute name="margin-bottom">4pt</xsl:attribute> + <xsl:attribute name="line-height">125%</xsl:attribute> + + + + + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="note-name-style"> + + + + <xsl:attribute name="font-family">SimHei</xsl:attribute> + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="note-p-style"> + + + + <xsl:attribute name="margin-top">4pt</xsl:attribute> + <xsl:attribute name="line-height">125%</xsl:attribute> + <xsl:attribute name="text-align">justify</xsl:attribute> + + + + + + + + + + + + </xsl:attribute-set><xsl:attribute-set name="termnote-style"> + + + + + + </xsl:attribute-set><xsl:attribute-set name="quote-style"> + + + <xsl:attribute name="margin-top">12pt</xsl:attribute> + <xsl:attribute name="margin-left">12mm</xsl:attribute> + <xsl:attribute name="margin-right">12mm</xsl:attribute> + + + + + + </xsl:attribute-set><xsl:attribute-set name="quote-source-style"> + + + <xsl:attribute name="text-align">right</xsl:attribute> + + + </xsl:attribute-set><xsl:attribute-set name="termsource-style"> + + + + <xsl:attribute name="text-indent">7.4mm</xsl:attribute> + + + + </xsl:attribute-set><xsl:attribute-set name="origin-style"> + + + </xsl:attribute-set><xsl:attribute-set name="term-style"> + + </xsl:attribute-set><xsl:attribute-set name="figure-name-style"> + + + + + + <xsl:attribute name="font-family">SimHei</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="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-set><xsl:attribute-set name="figure-pseudocode-p-style"> + + </xsl:attribute-set><xsl:attribute-set name="image-graphic-style"> + + + <xsl:attribute name="width">100%</xsl:attribute> + <xsl:attribute name="content-height">100%</xsl:attribute> + <xsl:attribute name="content-width">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 name="padding-left">7.4mm</xsl:attribute> + + </xsl:attribute-set><xsl:attribute-set name="admitted-style"> + + + </xsl:attribute-set><xsl:attribute-set name="deprecates-style"> + + </xsl:attribute-set><xsl:attribute-set name="definition-style"> + + </xsl:attribute-set><xsl: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-family">SimHei</xsl:attribute> - <xsl:attribute name="font-weight">normal</xsl:attribute> - <xsl:attribute name="margin-bottom">12pt</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']"> @@ -2195,39 +1679,19 @@ <xsl:apply-templates select="*[local-name()='note']" mode="process"/> + + </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:variable name="annex-id" select="ancestor::gb:annex/@id"/> - <xsl:number format="A." count="*[local-name()='annex']"/><xsl:number format="1" level="any" count="*[local-name()='table'][(not(@unnumbered) or @unnumbered != 'true') and ancestor::gb:annex[@id = $annex-id]]"/> - - - - - - - - </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])"/> @@ -2451,10 +1915,11 @@ + <xsl:if test="@colspan"> <xsl:attribute name="number-columns-spanned"> <xsl:value-of select="@colspan"/> </xsl:attribute> </xsl:if> @@ -2474,16 +1939,16 @@ <xsl:if test="ancestor::*[local-name() = 'tfoot']"> <xsl:attribute name="border-bottom">solid black 0</xsl:attribute> </xsl:if> + - <xsl:if test="@colspan"> <xsl:attribute name="number-columns-spanned"> <xsl:value-of select="@colspan"/> </xsl:attribute> </xsl:if> @@ -2493,25 +1958,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"> @@ -2525,30 +1978,18 @@ <xsl:attribute name="font-family">SimHei</xsl:attribute> - <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:text>:</xsl:text> - - - + + <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}"> @@ -2610,11 +2051,11 @@ </xsl:template><xsl:template name="fn_display_figure"> <xsl:variable name="key_iso"> true <!-- 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> @@ -2905,11 +2346,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> @@ -2921,16 +2362,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/> @@ -2995,11 +2431,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"> @@ -3008,11 +2444,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/> @@ -3339,17 +2775,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> @@ -3375,55 +2805,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()"/> @@ -3450,10 +2849,664 @@ <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"> + + + + + <fo:block-container margin-left="0mm"> + + <fo:table table-layout="fixed" width="100%"> + <fo:table-column column-width="10mm"/> + <fo:table-column column-width="155mm"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block font-family="SimHei" xsl:use-attribute-sets="note-name-style"> + <xsl:apply-templates select="gb:name" mode="presentation"/> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="justify"> + <xsl:apply-templates/> + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> + + + + + + + + + + </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:text>:</xsl:text> + + + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:if test="normalize-space() != ''"> + <xsl:apply-templates/> + <xsl:value-of select="$suffix"/> + </xsl:if> + </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" 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"> + + <fo:block font-family="SimHei" font-size="11pt" keep-with-next="always" margin-top="10pt" margin-bottom="8pt" line-height="1.1"> + <xsl:apply-templates select="gb:name" mode="presentation"/> + </fo:block> + + + + <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/> + + </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:apply-templates/> + + </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"> + + inline + </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}"> + + <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">50%</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: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"> + + + 3 + + + + + + + + + + + + + + + </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="gb:sections/gb:clause | gb:sections/gb:terms"/></xsl:variable> + <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)"/> @@ -3582,31 +3635,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> @@ -3648,6 +3723,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