1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:db="http://docbook.org/ns/docbook"
exclude-result-prefixes="db"
>
<!-- ********************************************************************
********************************************************************
Copyright 2010-2022, Regina Obe
License: BSD
Purpose: This is an xsl transform that generates file table_body_function_support_matrix.xml.xsl which
includes table body of functions support matrix.
It uses xml reference sections from reference.xml to then be processed by docbook
******************************************************************** -->
<xsl:output method="xml" indent="yes" encoding="utf-8" />
<!-- We deal only with the reference chapters -->
<xsl:template match="/">
<xsl:apply-templates select="/db:book/db:chapter[contains(@xml:id, 'reference')]" />
</xsl:template>
<xsl:template match="/">
<!-- TODO: use entities or xinclude instead,
to avoid duplication with postgis_special.xsl.xml
-->
<xsl:variable name='matrix_checkmark'><![CDATA[
<inlinemediaobject>
<imageobject>
<imagedata fileref='images/matrix_checkmark.png' />
</imageobject>
</inlinemediaobject>
]]></xsl:variable>
<xsl:variable name='matrix_transform'><![CDATA[
<inlinemediaobject>
<imageobject>
<imagedata fileref='images/matrix_transform.png' />
</imageobject>
</inlinemediaobject>
]]></xsl:variable>
<xsl:variable name='matrix_autocast'><![CDATA[
<inlinemediaobject>
<imageobject>
<imagedata fileref='images/matrix_autocast.png' />
</imageobject>
</inlinemediaobject>
]]></xsl:variable>
<xsl:variable name='matrix_sfcgal_required'><![CDATA[
<inlinemediaobject>
<imageobject>
<imagedata fileref='images/matrix_sfcgal_required.png' />
</imageobject>
</inlinemediaobject>
]]></xsl:variable>
<xsl:variable name='matrix_sfcgal_enhanced'><![CDATA[
<inlinemediaobject>
<imageobject>
<imagedata fileref='images/matrix_sfcgal_enhanced.png' />
</imageobject>
</inlinemediaobject>
]]></xsl:variable>
<tbody>
<!-- Exclude PostGIS types, management functions, long transaction support, or exceptional functions from consideration -->
<!-- leaving out operators in an effor to try to fit on one page -->
<xsl:for-each select="descendant::node()[not(@xml:id='PostGIS_Types' or @xml:id='Management_Functions' or @xml:id='Long_Transactions_Support' or @xml:id='Exceptional_Functions' or @xml:id='Version_Functions')]/db:refentry">
<xsl:sort select="@id"/>
<xsl:variable name='comment'>
<xsl:value-of select="normalize-space(translate(translate(db:refnamediv/db:refpurpose,'
', ' '), '	', ' '))"/>
</xsl:variable>
<xsl:variable name="refid">
<xsl:value-of select="@xml:id" />
</xsl:variable>
<xsl:variable name="refname">
<xsl:value-of select="db:refnamediv/db:refname" />
</xsl:variable>
<row>
<!-- Display name of function and link to it -->
<entry><link linkend="{$refid}"><xsl:value-of select="$refname" /></link></entry>
<!-- If at least one proto function accepts or returns a geometry -->
<xsl:choose>
<!-- direct support -->
<xsl:when test="contains(db:refsynopsisdiv/db:funcsynopsis,'geometry') or contains(db:refsynopsisdiv/db:funcsynopsis/db:funcprototype/funcdef,'geometry')">
<entry>
<xsl:choose>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_required']">
<xsl:value-of select="$matrix_sfcgal_required" disable-output-escaping="yes"/>
</xsl:when>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_enhanced']">
<xsl:value-of select="$matrix_sfcgal_enhanced" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$matrix_checkmark" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</entry>
</xsl:when>
<!-- support via autocast -->
<xsl:when test="contains(db:refsynopsisdiv/db:funcsynopsis,'box') or contains(db:refsynopsisdiv/db:funcsynopsis/db:funcprototype/funcdef,'box') or contains(db:refsynopsisdiv/db:funcsynopsis, 'geom_name')">
<entry><xsl:value-of select="$matrix_autocast" disable-output-escaping="yes"/></entry>
</xsl:when>
<!-- no support -->
<xsl:otherwise>
<entry></entry>
</xsl:otherwise>
</xsl:choose>
<!-- If at least one proto function accepts or returns a geography -->
<xsl:choose>
<!-- Support via geometry transform hack -->
<xsl:when test="db:refsection/descendant::node()[@conformance='geography_transform']">
<entry><xsl:value-of select="$matrix_transform" disable-output-escaping="yes"/></entry>
</xsl:when>
<!-- direct support -->
<xsl:when test="contains(db:refsynopsisdiv/db:funcsynopsis,'geography') or contains(db:refsynopsisdiv/db:funcsynopsis/db:funcprototype/funcdef,'geography')">
<entry><xsl:value-of select="$matrix_checkmark" disable-output-escaping="yes"/></entry>
</xsl:when>
<!-- no support -->
<xsl:otherwise>
<entry></entry>
</xsl:otherwise>
</xsl:choose>
<!-- If at least one paragraph contains support 3d -->
<xsl:choose>
<!-- supports -->
<xsl:when test="db:refsection/descendant::node()[@conformance='3d']">
<!-- if 3d denote if it needs sfcgal -->
<entry>
<xsl:choose>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_required']">
<xsl:value-of select="$matrix_sfcgal_required" disable-output-escaping="yes"/>
</xsl:when>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_enhanced']">
<xsl:value-of select="$matrix_sfcgal_enhanced" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$matrix_checkmark" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</entry>
</xsl:when>
<!-- no support -->
<xsl:otherwise>
<entry></entry>
</xsl:otherwise>
</xsl:choose>
<!-- Support for Curve -->
<xsl:choose>
<!-- supports -->
<xsl:when test="db:refsection/descendant::node()[@conformance='curve']">
<entry><xsl:value-of select="$matrix_checkmark" disable-output-escaping="yes"/></entry>
</xsl:when>
<!-- no support -->
<xsl:otherwise>
<entry></entry>
</xsl:otherwise>
</xsl:choose>
<!-- SQL MM compliance -->
<xsl:choose>
<!-- supports -->
<xsl:when test="db:refsection/descendant::node()[@conformance='sqlmm']">
<entry>
<xsl:choose>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_required']">
<xsl:value-of select="$matrix_sfcgal_required" disable-output-escaping="yes"/>
</xsl:when>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_enhanced']">
<xsl:value-of select="$matrix_sfcgal_enhanced" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$matrix_checkmark" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</entry>
</xsl:when>
<!-- no support -->
<xsl:otherwise>
<entry></entry>
</xsl:otherwise>
</xsl:choose>
<!-- Polyhedral surface support -->
<xsl:choose>
<!-- supports -->
<xsl:when test="db:refsection/descendant::node()[@conformance='polyhedral']">
<entry>
<xsl:choose>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_required']">
<xsl:value-of select="$matrix_sfcgal_required" disable-output-escaping="yes"/>
</xsl:when>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_enhanced']">
<xsl:value-of select="$matrix_sfcgal_enhanced" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$matrix_checkmark" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</entry>
</xsl:when>
<!-- no support -->
<xsl:otherwise>
<entry></entry>
</xsl:otherwise>
</xsl:choose>
<!-- Triangle and TIN surface support -->
<xsl:choose>
<!-- supports -->
<xsl:when test="db:refsection/descendant::node()[@conformance='triangle']">
<entry>
<xsl:choose>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_required']">
<xsl:value-of select="$matrix_sfcgal_required" disable-output-escaping="yes"/>
</xsl:when>
<xsl:when test="db:refsection/descendant::node()[@conformance='sfcgal_enhanced']">
<xsl:value-of select="$matrix_sfcgal_enhanced" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$matrix_checkmark" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</entry>
</xsl:when>
<!-- no support -->
<xsl:otherwise>
<entry></entry>
</xsl:otherwise>
</xsl:choose>
</row>
</xsl:for-each>
</tbody>
</xsl:template>
</xsl:stylesheet>
|