lib/isodoc/ogc/ogc.reference-model.xsl in metanorma-ogc-1.5.2 vs lib/isodoc/ogc/ogc.reference-model.xsl in metanorma-ogc-1.5.3

- old
+ new

@@ -58,23 +58,74 @@ <xsl:otherwise>rgb(246, 223, 140)</xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="color_blue">rgb(33, 55, 92)</xsl:variable> + <xsl:variable name="toc_recommendations_"> + <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]"> + <xsl:variable name="table_id" select="@id"/> + <recommendation alt-text="{.//ogc:p[@class = 'RecommendationTitle'][1]/text()}"> + <xsl:copy-of select="@id"/> + <xsl:variable name="title"> + <xsl:apply-templates select=".//ogc:p[@class = 'RecommendationTitle'][ancestor::ogc:table[1][@id= $table_id]]/node()"/> + </xsl:variable> + <xsl:variable name="bookmark" select="normalize-space(.//ogc:p[@class = 'RecommendationTitle'][ancestor::ogc:table[1][@id= $table_id]]/node())"/> + <xsl:variable name="regex_str" select="'^([^0-9]+) (\d+).*'"/> + <xsl:variable name="class" select="java:replaceAll(java:java.lang.String.new($bookmark), $regex_str, '$1')"/> + <xsl:variable name="num" select="java:replaceAll(java:java.lang.String.new($bookmark), $regex_str, '$2')"/> + <xsl:variable name="class_lc" select="java:toLowerCase(java:java.lang.String.new($class))"/> + <!-- <xsl:attribute name="class_str"> + <xsl:value-of select="$class"/> + </xsl:attribute> --> + <xsl:attribute name="class"> + <xsl:choose> + <xsl:when test="$class_lc = 'requirements class'">1</xsl:when> + <xsl:when test="$class_lc = 'requirement'">2</xsl:when> + <xsl:when test="$class_lc = 'recommendation'">3</xsl:when> + <xsl:when test="$class_lc = 'permission'">4</xsl:when> + <xsl:when test="$class_lc = 'conformance class'">5</xsl:when> + <xsl:when test="$class_lc = 'abstract test'">6</xsl:when> + <xsl:when test="$class_lc = 'requirement test'">7</xsl:when> + <xsl:when test="$class_lc = 'recommendation test'">8</xsl:when> + <xsl:when test="$class_lc = 'permission test'">9</xsl:when> + <xsl:otherwise>9999</xsl:otherwise> + </xsl:choose> + </xsl:attribute> + <xsl:attribute name="num"> + <xsl:value-of select="$num"/> + </xsl:attribute> + <title> + <xsl:copy-of select="$title"/> + </title> + <bookmark> + <xsl:value-of select="$bookmark"/> + </bookmark> + </recommendation> + </xsl:for-each> + </xsl:variable> + <xsl:variable name="toc_recommendations"> + <xsl:for-each select="xalan:nodeset($toc_recommendations_)/*"> + <xsl:sort select="@class" data-type="number"/> + <xsl:sort select="@num" data-type="number"/> + <xsl:copy-of select="."/> + </xsl:for-each> + </xsl:variable> + <xsl:variable name="contents"> <contents> <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters --> <!-- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="contents"/> --> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract" mode="contents"/> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'executivesummary']" mode="contents"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keywords']" mode="contents"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'security']" mode="contents"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'submitting_orgs']" mode="contents"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters" mode="contents"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="contents"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'security') and not(@type = 'submitting_orgs') and not(@type = 'keywords')]" mode="contents"/> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'executivesummary') and not(@type = 'security') and not(@type = 'submitting_orgs') and not(@type = 'keywords')]" mode="contents"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements" mode="contents"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@type='scope']" mode="contents"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:sections/ogc:clause[@type='conformance']" mode="contents"/> @@ -435,11 +486,11 @@ </fo:block> </xsl:for-each> </fo:block> </fo:block-container> - <xsl:if test="//ogc:table[@id and ogc:name and contains(ogc:name, '—')]"> + <xsl:if test="//ogc:table[@id and ogc:name]"> <!-- contains(ogc:name, '—') --> <xsl:variable name="title-list-tables"> <xsl:call-template name="getTitle"> <xsl:with-param name="name" select="'title-list-tables'"/> </xsl:call-template> </xsl:variable> @@ -450,11 +501,11 @@ <xsl:with-param name="title" select="$title-list-tables"/> </xsl:call-template> </fo:block-container> </fo:block-container> <fo:block-container line-height="130%"> - <xsl:for-each select="//ogc:table[@id and ogc:name and contains(ogc:name, '—')]"> + <xsl:for-each select="//ogc:table[@id and ogc:name]"> <!-- contains(ogc:name, '—') --> <fo:block text-align-last="justify" margin-top="2pt" role="TOCI"> <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}"> <xsl:apply-templates select="ogc:name" mode="contents"/> <fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots"/> @@ -463,12 +514,22 @@ </fo:basic-link> </fo:block> </xsl:for-each> </fo:block-container> </xsl:if> - - <xsl:if test="//ogc:figure[@id and ogc:name and contains(ogc:name, '—')]"> + + <xsl:variable name="list_of_figures_"> + <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] | //*[@id and starts-with(ogc:name, 'Figure ')]"> + <figure id="{@id}" alt-text="{ogc:name}"> + <xsl:apply-templates select="ogc:name" mode="contents"/> + </figure> + </xsl:for-each> + </xsl:variable> + <xsl:variable name="list_of_figures" select="xalan:nodeset($list_of_figures_)"/> + + <!-- <xsl:if test="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] or //*[@id and starts-with(ogc:name, 'Figure ')]"> --> <!-- contains(ogc:name, '—') --> + <xsl:if test="$list_of_figures//figure"> <xsl:variable name="title-list-figures"> <xsl:call-template name="getTitle"> <xsl:with-param name="name" select="'title-list-figures'"/> </xsl:call-template> </xsl:variable> @@ -479,14 +540,16 @@ </xsl:call-template> </fo:block-container> </fo:block-container> <fo:block-container line-height="130%"> - <xsl:for-each select="//ogc:figure[@id and ogc:name and contains(ogc:name, '—')]"> + <!-- <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] or //*[@id and starts-with(ogc:name, 'Figure ')]"> --> <!-- contains(ogc:name, '—') --> + <xsl:for-each select="$list_of_figures/figure"> <!-- contains(ogc:name, '—') --> <fo:block text-align-last="justify" margin-top="2pt" role="TOCI"> - <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}"> - <xsl:apply-templates select="ogc:name" mode="contents"/> + <fo:basic-link internal-destination="{@id}" fox:alt-text="{@alt-text}"> + <!-- <xsl:apply-templates select="ogc:name" mode="contents"/> --> + <xsl:copy-of select="node()"/> <fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots"/> <fo:page-number-citation ref-id="{@id}"/> </fo:inline> </fo:basic-link> @@ -510,16 +573,15 @@ </xsl:call-template> </fo:block-container> </fo:block-container> <fo:block-container line-height="130%"> - <!-- <xsl:for-each select="//ogc:permission[@id and ogc:name] | //ogc:recommendation[@id and ogc:name] | //ogc:requirement[@id and ogc:name]"> --> - <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]"> - <xsl:variable name="table_id" select="@id"/> + <!-- <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]"> --> + <xsl:for-each select="xalan:nodeset($toc_recommendations)/*"> <fo:block text-align-last="justify" margin-top="6pt" role="TOCI"> - <fo:basic-link internal-destination="{@id}" fox:alt-text="{.//ogc:p[@class = 'RecommendationTitle'][1]/text()}"> - <xsl:apply-templates select=".//ogc:p[@class = 'RecommendationTitle'][ancestor::ogc:table[1][@id= $table_id]]/node()"/> + <fo:basic-link internal-destination="{@id}" fox:alt-text="{@alt-text}"> + <xsl:copy-of select="title/node()"/> <xsl:text> </xsl:text> <fo:inline keep-together.within-line="always"> <fo:leader leader-pattern="dots"/> <fo:page-number-citation ref-id="{@id}"/> </fo:inline> @@ -535,10 +597,11 @@ <fo:block break-after="page"/> <fo:block line-height="125%"> <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters --> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract"/> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'executivesummary']"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keywords']"/> <xsl:if test="/ogc:ogc-standard/ogc:preface/ogc:foreword"> <fo:block break-after="page"/> </xsl:if> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword"/> @@ -559,11 +622,11 @@ </xsl:if> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction"/> - <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'security') and not(@type = 'submitting_orgs') and not(@type = 'keywords')]"/> + <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'executivesummary') and not(@type = 'security') and not(@type = 'submitting_orgs') and not(@type = 'keywords')]"/> <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements"/> </fo:block> </fo:flow> </fo:page-sequence> @@ -1191,11 +1254,11 @@ </xsl:template> <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" priority="2"/> <xsl:template match="ogc:preferred" mode="term_name"> - <fo:inline font-size="18pt" padding-right="3mm"><xsl:apply-templates/></fo:inline> + <fo:inline font-size="18pt" padding-right="3mm"><xsl:call-template name="setStyle_preferred"/><xsl:apply-templates/></fo:inline> <fo:inline padding-right="2mm"> </fo:inline> </xsl:template> <xsl:template match="ogc:deprecated | ogc:admitted" mode="term_name"> <fo:inline font-size="18pt" padding-right="3mm"><xsl:apply-templates/></fo:inline> @@ -2264,21 +2327,22 @@ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/> <!-- Bibliography --> <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/> </xsl:template><xsl:template name="processMainSectionsDefault_Contents"> - <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"> + + <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="." mode="contents"/> </xsl:for-each> <xsl:for-each select="/*/*[local-name()='annex']"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="." mode="contents"/> </xsl:for-each> - <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]"> + <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]"> <xsl:sort select="@displayorder" data-type="number"/> <xsl:apply-templates select="." mode="contents"/> </xsl:for-each> </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault"> <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/> @@ -3809,11 +3873,11 @@ - 10 + 9.5 </xsl:variable> <xsl:variable name="font-size" select="normalize-space($_font-size)"/> @@ -4993,16 +5057,16 @@ </fo:block> </fo:block-container> </xsl:template><xsl:template match="*[local-name() = 'emf']"/><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="*[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="bookmarks"> + </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks"> <xsl:apply-templates mode="bookmarks"/> <xsl:text> </xsl:text> </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2"> <xsl:value-of select="."/> - </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2"> + </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2"> <xsl:value-of select="."/> </xsl:template><xsl:template match="node()" mode="contents"> <xsl:apply-templates mode="contents"/> </xsl:template><xsl:template match="node()" mode="bookmarks"> <xsl:apply-templates mode="bookmarks"/> @@ -5097,18 +5161,18 @@ <xsl:variable name="list_of_tables_"> - <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and contains(*[local-name() = 'name'], '—')]"> + <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']]"> <!-- contains(*[local-name() = 'name'], '—') --> <table id="{@id}"><xsl:apply-templates select="*[local-name() = 'name']" mode="bookmarks"/></table> </xsl:for-each> </xsl:variable> <xsl:variable name="list_of_tables" select="xalan:nodeset($list_of_tables_)"/> <xsl:variable name="list_of_figures_"> - <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and contains(*[local-name() = 'name'], '—')]"> + <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true')] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ')]"> <!-- contains(*[local-name() = 'name'], '—') --> <figure id="{@id}"><xsl:apply-templates select="*[local-name() = 'name']" mode="bookmarks"/></figure> </xsl:for-each> </xsl:variable> <xsl:variable name="list_of_figures" select="xalan:nodeset($list_of_figures_)"/> @@ -5157,14 +5221,15 @@ <fo:bookmark-title> <xsl:call-template name="getTitle"> <xsl:with-param name="name" select="'title-list-recommendations'"/> </xsl:call-template> </fo:bookmark-title> - <xsl:for-each select="//*[local-name() = 'table'][.//*[local-name() = 'p'][@class = 'RecommendationTitle']]"> + <!-- <xsl:for-each select="//*[local-name() = 'table'][.//*[local-name() = 'p'][@class = 'RecommendationTitle']]"> --> + <xsl:for-each select="xalan:nodeset($toc_recommendations)/*"> <xsl:variable name="table_id" select="@id"/> <fo:bookmark internal-destination="{@id}"> - <fo:bookmark-title><xsl:value-of select=".//*[local-name() = 'p'][@class = 'RecommendationTitle'][ancestor::*[local-name() = 'table'][1][@id= $table_id]]/node()"/></fo:bookmark-title> + <fo:bookmark-title><xsl:value-of select="bookmark"/></fo:bookmark-title> </fo:bookmark> </xsl:for-each> </fo:bookmark> </xsl:if> @@ -5339,10 +5404,16 @@ </xsl:if> <fo:block-container margin-left="0mm"> + + <xsl:if test="parent::*[local-name() = 'example']"> + <fo:block font-size="1pt" line-height="10%" space-after="4pt"> </fo:block> + </xsl:if> + + <fo:block xsl:use-attribute-sets="sourcecode-style"> <xsl:variable name="_font-size"> @@ -5353,11 +5424,11 @@ - + 9.5 </xsl:variable> <xsl:variable name="font-size" select="normalize-space($_font-size)"/> @@ -5372,17 +5443,29 @@ </xsl:attribute> </xsl:if> + + <xsl:if test="parent::*[local-name() = 'example']"> + <xsl:attribute name="margin-bottom">0pt</xsl:attribute> + </xsl:if> + + <xsl:apply-templates/> </fo:block> - + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> + + <xsl:if test="parent::*[local-name() = 'example']"> + <fo:block font-size="1pt" line-height="10%" space-before="6pt"> </fo:block> + </xsl:if> + + </fo:block-container> </fo:block-container> </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2"> <xsl:variable name="text"> <xsl:call-template name="add-zero-spaces-equal"/> @@ -5970,27 +6053,32 @@ <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 name="getLocalizedString"> + <xsl:with-param name="key">deprecated</xsl:with-param> </xsl:call-template> + </xsl:variable> <fo:block xsl:use-attribute-sets="deprecates-style"> <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/> </fo:block> + </xsl:template><xsl:template name="setStyle_preferred"> + <xsl:if test="*[local-name() = 'strong']"> + <xsl:attribute name="font-weight">normal</xsl:attribute> + </xsl:if> </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']"> + </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]"> <fo:inline> <xsl:apply-templates/></fo:inline> - <fo:block> </fo:block> + <!-- <fo:block>&#xA0;</fo:block> --> + <fo:block/> </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2"> <fo:block> <xsl:call-template name="setId"/> \ No newline at end of file