[postgis-tickets] [SCM] PostGIS branch stable-3.3 updated. 3.3.3-27-gc336509f6
git at osgeo.org
git at osgeo.org
Sun Jul 16 12:39:36 PDT 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, stable-3.3 has been updated
via c336509f6d90c0daef9d1a50b4b47e0c4a09f9f0 (commit)
from df8828aface3eefa73ebc554f2ad66e0129050ab (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c336509f6d90c0daef9d1a50b4b47e0c4a09f9f0
Author: Regina Obe <lr at pcorp.us>
Date: Sun Jul 16 15:34:54 2023 -0400
Clarify licensing of XSL style sheets
References #5449 for PostGIS 3.3.4
diff --git a/LICENSE.TXT b/LICENSE.TXT
index b70a7af77..6e5e29e43 100644
--- a/LICENSE.TXT
+++ b/LICENSE.TXT
@@ -31,7 +31,7 @@ shapefil.h, shpopen.c (copyrighted by Frank Warmerdam and Even Rouault).
-- loader/getopt.* are under AT&T public domain (Copyright (c) 1984, 1985 AT&T).
-- Doc/xsl files
-These are under a BSD Style license
+These are under a BSD-3-Clause license - refer to doc/xsl/LICENSE file
-- liblwgeom/lookup3.c is released under Public Domain by Bob Jenkins, May 2006.
diff --git a/doc/xsl/LICENSE b/doc/xsl/LICENSE
new file mode 100644
index 000000000..1f7f315f2
--- /dev/null
+++ b/doc/xsl/LICENSE
@@ -0,0 +1,13 @@
+BSD-3-Clause
+
+Copyright 2010-2023, Regina Obe
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/doc/xsl/post_gis_day_cards.html.xsl b/doc/xsl/post_gis_day_cards.html.xsl
index 3273115ba..10f05d1d2 100644
--- a/doc/xsl/post_gis_day_cards.html.xsl
+++ b/doc/xsl/post_gis_day_cards.html.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2011, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates PostGIS flash cards
******************************************************************** -->
<xsl:output method="text" />
diff --git a/doc/xsl/postgis_aggs_mm.xml.xsl b/doc/xsl/postgis_aggs_mm.xml.xsl
index 75cd9f95a..70b78050a 100644
--- a/doc/xsl/postgis_aggs_mm.xml.xsl
+++ b/doc/xsl/postgis_aggs_mm.xml.xsl
@@ -2,7 +2,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2010-2022, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates file postgis_aggs_mm.xml which
includes index listing of aggregate functions and mm /sql compliant functions as well as what is new in each release
It uses xml reference sections from reference.xml to then
diff --git a/doc/xsl/postgis_cheatsheet.html.xsl b/doc/xsl/postgis_cheatsheet.html.xsl
index d66bc607e..a0e880da5 100644
--- a/doc/xsl/postgis_cheatsheet.html.xsl
+++ b/doc/xsl/postgis_cheatsheet.html.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2011, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
statements from postgis xml doc reference
******************************************************************** -->
diff --git a/doc/xsl/postgis_comments.sql.xsl b/doc/xsl/postgis_comments.sql.xsl
index 56ca5eb1c..90dcd929b 100644
--- a/doc/xsl/postgis_comments.sql.xsl
+++ b/doc/xsl/postgis_comments.sql.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2008, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
statements from postgis xml doc reference
******************************************************************** -->
diff --git a/doc/xsl/postgis_gardentest.sql.xsl b/doc/xsl/postgis_gardentest.sql.xsl
index 4907d2be7..fdefda1b5 100644
--- a/doc/xsl/postgis_gardentest.sql.xsl
+++ b/doc/xsl/postgis_gardentest.sql.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2008-2010, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates an sql test script from xml docs to test all the functions we have documented
using a garden variety of geometries. Its intent is to flag major crashes.
******************************************************************** -->
diff --git a/doc/xsl/postgis_gardentest_subset.sql.xsl b/doc/xsl/postgis_gardentest_subset.sql.xsl
index 21e5c34e4..d1e9e1e42 100644
--- a/doc/xsl/postgis_gardentest_subset.sql.xsl
+++ b/doc/xsl/postgis_gardentest_subset.sql.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2009, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates an sql test script from xml docs to test all the functions we have documented
using a garden variety of geometries. Its intent is to flag major crashes. This version is similar to the full but designed to
test more geometries but only against one function. Useful for intro of new functions or comparing major changes from function of one version of PostGIS to the other
diff --git a/doc/xsl/postgis_reference.xml.xsl b/doc/xsl/postgis_reference.xml.xsl
index 50d5b2e0a..9a46e084d 100644
--- a/doc/xsl/postgis_reference.xml.xsl
+++ b/doc/xsl/postgis_reference.xml.xsl
@@ -2,10 +2,10 @@
<!-- ********************************************************************
********************************************************************
Copyright 2010, Regina Obe
- License: BSD
- Purpose: This is an xsl transform that concatenates
+ License: BSD-3-Clause
+ Purpose: This is an xsl transform that concatenates
all the sections defined in postgis.xml and strips all tags
- for suitable import by expert bot
+ for suitable import by expert bot
To use: xsltproc -o postgis_full.xml postgis_reference.xml.xsl postgis.xml
******************************************************************** -->
<xsl:output method="xml" indent="yes" encoding="utf-8" />
@@ -15,28 +15,28 @@
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
-
+
<!-- just grab link and title -->
<xsl:template match="ulink">
<xsl:value-of select="@url" /><xsl:text> </xsl:text><xsl:value-of select="." />
</xsl:template>
- <!--just grab name of file -->
+ <!--just grab name of file -->
<xsl:template match="filename">
<xsl:value-of select="." />
</xsl:template>
-
- <!--strip varname tag and leave just the name -->
+
+ <!--strip varname tag and leave just the name -->
<xsl:template match="varname">
<xsl:value-of select="." />
</xsl:template>
-
- <!--strip xref tag and just leave reference section -->
+
+ <!--strip xref tag and just leave reference section -->
<xsl:template match="xref">
<xsl:value-of select="@linkend" />
</xsl:template>
-
- <!--strip comman tag and just leave inner body -->
+
+ <!--strip comman tag and just leave inner body -->
<xsl:template match="command">
command: <xsl:value-of select="." />
</xsl:template>
diff --git a/doc/xsl/raster_cheatsheet.html.xsl b/doc/xsl/raster_cheatsheet.html.xsl
index f936e2eca..9d8f5d7f6 100644
--- a/doc/xsl/raster_cheatsheet.html.xsl
+++ b/doc/xsl/raster_cheatsheet.html.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2011, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
statements from postgis xml doc reference
******************************************************************** -->
diff --git a/doc/xsl/raster_comments.sql.xsl b/doc/xsl/raster_comments.sql.xsl
index bf9753e2d..dc45eca1c 100644
--- a/doc/xsl/raster_comments.sql.xsl
+++ b/doc/xsl/raster_comments.sql.xsl
@@ -1,124 +1,124 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<!-- ********************************************************************
- ********************************************************************
- Copyright 2008, Regina Obe
- License: BSD
- Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
- statements from postgis xml doc reference for WKT Raster section
- ******************************************************************** -->
- <xsl:output method="text" />
-
- <!-- We deal only with the reference chapter -->
- <xsl:template match="/">
- <xsl:apply-templates select="/book/chapter[@id='RT_reference']" />
- <xsl:apply-templates select="/book/chapter[@id='RT_reference']/sect1[contains(@id, 'Type')]" />
- </xsl:template>
-
- <xsl:template match="chapter">
- <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
-<!-- Pull out the purpose section for each ref entry and strip whitespace and put in a variable to be tagged unto each function comment -->
- <xsl:for-each select="sect1[not(contains(@id,'Operator'))]/refentry">
- <xsl:variable name='plaincomment'>
- <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
- </xsl:variable>
-<!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
- <xsl:variable name='comment'>
- <xsl:call-template name="globalReplace">
- <xsl:with-param name="outputString" select="$plaincomment"/>
- <xsl:with-param name="target" select="$ap"/>
- <xsl:with-param name="replacement" select="''"/>
- </xsl:call-template>
- </xsl:variable>
-<!-- For each function prototype generate the DDL comment statement
- If its input is a geometry set - we know it is an aggregate function rather than a regular function.
- Do not output OUT params since they define output rather than act as input and do not put a comma after argument just before an OUT parameter -->
- <xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
-COMMENT ON <xsl:choose><xsl:when test="contains(paramdef/type,'geometry set') or contains(paramdef/type,'raster set')">AGGREGATE</xsl:when><xsl:otherwise>FUNCTION</xsl:otherwise></xsl:choose><xsl:text> </xsl:text> <xsl:value-of select="funcdef/function" />(<xsl:for-each select="paramdef"><xsl:choose><xsl:when test="count(parameter) > 0">
-<xsl:choose><xsl:when test="contains(parameter,'OUT')"></xsl:when><xsl:when test="contains(type,'geometry set')">geometry</xsl:when><xsl:when test="contains(type,'raster set')">raster</xsl:when><xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise></xsl:choose><xsl:if test="position()<last() and not(contains(parameter,'OUT')) and not(contains(following-sibling::paramdef[1],'OUT'))"><xsl:text>, </xsl:text></xsl:if></xsl:when>
-</xsl:choose></xsl:for-each>) IS '<xsl:call-template name="listparams"><xsl:with-param name="func" select="." /></xsl:call-template> <xsl:value-of select='$comment' />';
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="sect1[contains(@id, 'Type')]">
- <xsl:for-each select="refentry">
- <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
- <!-- If this is a raster type grab the ref entry summary and refname to make type comment -->
-
- <xsl:variable name='plaincomment'>
- <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
- </xsl:variable>
- <!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
- <xsl:variable name='comment'>
- <xsl:call-template name="globalReplace">
- <xsl:with-param name="outputString" select="$plaincomment"/>
- <xsl:with-param name="target" select="$ap"/>
- <xsl:with-param name="replacement" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- COMMENT ON TYPE <xsl:value-of select="refnamediv/refname" /> IS 'postgis raster type: <xsl:value-of select='$comment' />';
-
- </xsl:for-each>
- </xsl:template>
-
-<!--General replace macro hack to make up for the fact xsl 1.0 does not have a built in one.
- Not needed for xsl 2.0 lifted from http://www.xml.com/pub/a/2002/06/05/transforming.html -->
- <xsl:template name="globalReplace">
- <xsl:param name="outputString"/>
- <xsl:param name="target"/>
- <xsl:param name="replacement"/>
- <xsl:choose>
- <xsl:when test="contains($outputString,$target)">
- <xsl:value-of select=
- "concat(substring-before($outputString,$target),
- $replacement)"/>
- <xsl:call-template name="globalReplace">
- <xsl:with-param name="outputString"
- select="substring-after($outputString,$target)"/>
- <xsl:with-param name="target" select="$target"/>
- <xsl:with-param name="replacement"
- select="$replacement"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$outputString"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="escapesinglequotes">
- <xsl:param name="arg1"/>
- <xsl:variable name="apostrophe">'</xsl:variable>
- <xsl:choose>
- <!-- this string has at least on single quote -->
- <xsl:when test="contains($arg1, $apostrophe)">
- <xsl:if test="string-length(normalize-space(substring-before($arg1, $apostrophe))) > 0"><xsl:value-of select="substring-before($arg1, $apostrophe)" disable-output-escaping="yes"/>''</xsl:if>
- <xsl:call-template name="escapesinglequotes">
- <xsl:with-param name="arg1"><xsl:value-of select="substring-after($arg1, $apostrophe)" disable-output-escaping="yes"/></xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <!-- no quotes found in string, just print it -->
- <xsl:when test="string-length(normalize-space($arg1)) > 0"><xsl:value-of select="normalize-space($arg1)"/></xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <!--macro to pull out function parameter names so we can provide a pretty arg list prefix for each function -->
- <xsl:template name="listparams">
- <xsl:param name="func" />
- <xsl:for-each select="$func">
- <xsl:if test="count(paramdef/parameter) > 0">args: </xsl:if>
- <xsl:for-each select="paramdef">
- <xsl:choose>
- <xsl:when test="count(parameter) > 0">
- <xsl:call-template name="escapesinglequotes">
- <xsl:with-param name="arg1" select="parameter"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:if test="count(paramdef/parameter) > 0"> - </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
-</xsl:stylesheet>
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<!-- ********************************************************************
+ ********************************************************************
+ Copyright 2008, Regina Obe
+ License: BSD-3-Clause
+ Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
+ statements from postgis xml doc reference for WKT Raster section
+ ******************************************************************** -->
+ <xsl:output method="text" />
+
+ <!-- We deal only with the reference chapter -->
+ <xsl:template match="/">
+ <xsl:apply-templates select="/book/chapter[@id='RT_reference']" />
+ <xsl:apply-templates select="/book/chapter[@id='RT_reference']/sect1[contains(@id, 'Type')]" />
+ </xsl:template>
+
+ <xsl:template match="chapter">
+ <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
+<!-- Pull out the purpose section for each ref entry and strip whitespace and put in a variable to be tagged unto each function comment -->
+ <xsl:for-each select="sect1[not(contains(@id,'Operator'))]/refentry">
+ <xsl:variable name='plaincomment'>
+ <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
+ </xsl:variable>
+<!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
+ <xsl:variable name='comment'>
+ <xsl:call-template name="globalReplace">
+ <xsl:with-param name="outputString" select="$plaincomment"/>
+ <xsl:with-param name="target" select="$ap"/>
+ <xsl:with-param name="replacement" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+<!-- For each function prototype generate the DDL comment statement
+ If its input is a geometry set - we know it is an aggregate function rather than a regular function.
+ Do not output OUT params since they define output rather than act as input and do not put a comma after argument just before an OUT parameter -->
+ <xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
+COMMENT ON <xsl:choose><xsl:when test="contains(paramdef/type,'geometry set') or contains(paramdef/type,'raster set')">AGGREGATE</xsl:when><xsl:otherwise>FUNCTION</xsl:otherwise></xsl:choose><xsl:text> </xsl:text> <xsl:value-of select="funcdef/function" />(<xsl:for-each select="paramdef"><xsl:choose><xsl:when test="count(parameter) > 0">
+<xsl:choose><xsl:when test="contains(parameter,'OUT')"></xsl:when><xsl:when test="contains(type,'geometry set')">geometry</xsl:when><xsl:when test="contains(type,'raster set')">raster</xsl:when><xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise></xsl:choose><xsl:if test="position()<last() and not(contains(parameter,'OUT')) and not(contains(following-sibling::paramdef[1],'OUT'))"><xsl:text>, </xsl:text></xsl:if></xsl:when>
+</xsl:choose></xsl:for-each>) IS '<xsl:call-template name="listparams"><xsl:with-param name="func" select="." /></xsl:call-template> <xsl:value-of select='$comment' />';
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="sect1[contains(@id, 'Type')]">
+ <xsl:for-each select="refentry">
+ <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
+ <!-- If this is a raster type grab the ref entry summary and refname to make type comment -->
+
+ <xsl:variable name='plaincomment'>
+ <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
+ </xsl:variable>
+ <!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
+ <xsl:variable name='comment'>
+ <xsl:call-template name="globalReplace">
+ <xsl:with-param name="outputString" select="$plaincomment"/>
+ <xsl:with-param name="target" select="$ap"/>
+ <xsl:with-param name="replacement" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ COMMENT ON TYPE <xsl:value-of select="refnamediv/refname" /> IS 'postgis raster type: <xsl:value-of select='$comment' />';
+
+ </xsl:for-each>
+ </xsl:template>
+
+<!--General replace macro hack to make up for the fact xsl 1.0 does not have a built in one.
+ Not needed for xsl 2.0 lifted from http://www.xml.com/pub/a/2002/06/05/transforming.html -->
+ <xsl:template name="globalReplace">
+ <xsl:param name="outputString"/>
+ <xsl:param name="target"/>
+ <xsl:param name="replacement"/>
+ <xsl:choose>
+ <xsl:when test="contains($outputString,$target)">
+ <xsl:value-of select=
+ "concat(substring-before($outputString,$target),
+ $replacement)"/>
+ <xsl:call-template name="globalReplace">
+ <xsl:with-param name="outputString"
+ select="substring-after($outputString,$target)"/>
+ <xsl:with-param name="target" select="$target"/>
+ <xsl:with-param name="replacement"
+ select="$replacement"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$outputString"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="escapesinglequotes">
+ <xsl:param name="arg1"/>
+ <xsl:variable name="apostrophe">'</xsl:variable>
+ <xsl:choose>
+ <!-- this string has at least on single quote -->
+ <xsl:when test="contains($arg1, $apostrophe)">
+ <xsl:if test="string-length(normalize-space(substring-before($arg1, $apostrophe))) > 0"><xsl:value-of select="substring-before($arg1, $apostrophe)" disable-output-escaping="yes"/>''</xsl:if>
+ <xsl:call-template name="escapesinglequotes">
+ <xsl:with-param name="arg1"><xsl:value-of select="substring-after($arg1, $apostrophe)" disable-output-escaping="yes"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- no quotes found in string, just print it -->
+ <xsl:when test="string-length(normalize-space($arg1)) > 0"><xsl:value-of select="normalize-space($arg1)"/></xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--macro to pull out function parameter names so we can provide a pretty arg list prefix for each function -->
+ <xsl:template name="listparams">
+ <xsl:param name="func" />
+ <xsl:for-each select="$func">
+ <xsl:if test="count(paramdef/parameter) > 0">args: </xsl:if>
+ <xsl:for-each select="paramdef">
+ <xsl:choose>
+ <xsl:when test="count(parameter) > 0">
+ <xsl:call-template name="escapesinglequotes">
+ <xsl:with-param name="arg1" select="parameter"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>
+ </xsl:for-each>
+ <xsl:if test="count(paramdef/parameter) > 0"> - </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/doc/xsl/raster_gardentest.sql.xsl b/doc/xsl/raster_gardentest.sql.xsl
index 053df77ef..7064e1fba 100644
--- a/doc/xsl/raster_gardentest.sql.xsl
+++ b/doc/xsl/raster_gardentest.sql.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2010, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates an sql test script from xml docs to test all the raster related functions we have documented
using a garden variety of rasters. Its intent is to flag major crashes.
******************************************************************** -->
diff --git a/doc/xsl/sfcgal_cheatsheet.html.xsl b/doc/xsl/sfcgal_cheatsheet.html.xsl
index ca5606d91..6c4a42499 100644
--- a/doc/xsl/sfcgal_cheatsheet.html.xsl
+++ b/doc/xsl/sfcgal_cheatsheet.html.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2011, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
statements from postgis xml doc reference
******************************************************************** -->
diff --git a/doc/xsl/sfcgal_comments.sql.xsl b/doc/xsl/sfcgal_comments.sql.xsl
index e08342cd6..9ab248081 100644
--- a/doc/xsl/sfcgal_comments.sql.xsl
+++ b/doc/xsl/sfcgal_comments.sql.xsl
@@ -1,85 +1,85 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<!-- ********************************************************************
- ********************************************************************
- Copyright 2008, Regina Obe
- License: BSD
- Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
- statements from postgis xml doc reference
- ******************************************************************** -->
- <xsl:output method="text" />
-
- <!-- We deal only with the reference chapter -->
- <xsl:template match="/">
- <xsl:apply-templates select="/book/chapter[@id='reference']" />
- </xsl:template>
-
- <xsl:template match="chapter">
- <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
-<!-- Pull out the purpose section for each ref entry and strip whitespace and put in a variable to be tagged unto each function comment -->
- <xsl:for-each select="sect1[@id='reference_sfcgal']/refentry">
- <xsl:variable name='plaincomment'>
- <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
- </xsl:variable>
-<!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
- <xsl:variable name='comment'>
- <xsl:call-template name="globalReplace">
- <xsl:with-param name="outputString" select="$plaincomment"/>
- <xsl:with-param name="target" select="$ap"/>
- <xsl:with-param name="replacement" select="''"/>
- </xsl:call-template>
- </xsl:variable>
-<!-- For each function prototype generate the DDL comment statement
- If its input is a geometry set - we know it is an aggregate function rather than a regular function
- Do not output OUT params since they define output rather than act as input and do not put a comma after argument just before an OUT parameter -->
- <xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
-COMMENT ON <xsl:choose><xsl:when test="contains(paramdef/type,'geometry set')">AGGREGATE</xsl:when><xsl:otherwise>FUNCTION</xsl:otherwise></xsl:choose><xsl:text> </xsl:text> <xsl:value-of select="funcdef/function" />(<xsl:for-each select="paramdef"><xsl:choose><xsl:when test="count(parameter) > 0">
-<xsl:choose><xsl:when test="contains(parameter,'OUT')"></xsl:when><xsl:when test="contains(type,'geometry set')">geometry</xsl:when><xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise></xsl:choose><xsl:if test="position()<last() and not(contains(parameter,'OUT')) and not(contains(following-sibling::paramdef[1],'OUT'))"><xsl:text>, </xsl:text></xsl:if></xsl:when>
-</xsl:choose></xsl:for-each>) IS '<xsl:call-template name="listparams"><xsl:with-param name="func" select="." /></xsl:call-template> <xsl:value-of select='$comment' />';
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
-
-<!--General replace macro hack to make up for the fact xsl 1.0 does not have a built in one.
- Not needed for xsl 2.0 lifted from http://www.xml.com/pub/a/2002/06/05/transforming.html -->
- <xsl:template name="globalReplace">
- <xsl:param name="outputString"/>
- <xsl:param name="target"/>
- <xsl:param name="replacement"/>
- <xsl:choose>
- <xsl:when test="contains($outputString,$target)">
- <xsl:value-of select=
- "concat(substring-before($outputString,$target),
- $replacement)"/>
- <xsl:call-template name="globalReplace">
- <xsl:with-param name="outputString"
- select="substring-after($outputString,$target)"/>
- <xsl:with-param name="target" select="$target"/>
- <xsl:with-param name="replacement"
- select="$replacement"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$outputString"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--macro to pull out function parameter names so we can provide a pretty arg list prefix for each function. -->
- <xsl:template name="listparams">
- <xsl:param name="func" />
- <xsl:for-each select="$func">
- <xsl:if test="count(paramdef/parameter) > 0">args: </xsl:if>
- <xsl:for-each select="paramdef">
- <xsl:choose>
- <xsl:when test="count(parameter) > 0">
- <xsl:value-of select="parameter" />
- </xsl:when>
- </xsl:choose>
- <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:if test="count(paramdef/parameter) > 0"> - </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
-</xsl:stylesheet>
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<!-- ********************************************************************
+ ********************************************************************
+ Copyright 2008, Regina Obe
+ License: BSD-3-Clause
+ Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
+ statements from postgis xml doc reference
+ ******************************************************************** -->
+ <xsl:output method="text" />
+
+ <!-- We deal only with the reference chapter -->
+ <xsl:template match="/">
+ <xsl:apply-templates select="/book/chapter[@id='reference']" />
+ </xsl:template>
+
+ <xsl:template match="chapter">
+ <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
+<!-- Pull out the purpose section for each ref entry and strip whitespace and put in a variable to be tagged unto each function comment -->
+ <xsl:for-each select="sect1[@id='reference_sfcgal']/refentry">
+ <xsl:variable name='plaincomment'>
+ <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
+ </xsl:variable>
+<!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
+ <xsl:variable name='comment'>
+ <xsl:call-template name="globalReplace">
+ <xsl:with-param name="outputString" select="$plaincomment"/>
+ <xsl:with-param name="target" select="$ap"/>
+ <xsl:with-param name="replacement" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+<!-- For each function prototype generate the DDL comment statement
+ If its input is a geometry set - we know it is an aggregate function rather than a regular function
+ Do not output OUT params since they define output rather than act as input and do not put a comma after argument just before an OUT parameter -->
+ <xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
+COMMENT ON <xsl:choose><xsl:when test="contains(paramdef/type,'geometry set')">AGGREGATE</xsl:when><xsl:otherwise>FUNCTION</xsl:otherwise></xsl:choose><xsl:text> </xsl:text> <xsl:value-of select="funcdef/function" />(<xsl:for-each select="paramdef"><xsl:choose><xsl:when test="count(parameter) > 0">
+<xsl:choose><xsl:when test="contains(parameter,'OUT')"></xsl:when><xsl:when test="contains(type,'geometry set')">geometry</xsl:when><xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise></xsl:choose><xsl:if test="position()<last() and not(contains(parameter,'OUT')) and not(contains(following-sibling::paramdef[1],'OUT'))"><xsl:text>, </xsl:text></xsl:if></xsl:when>
+</xsl:choose></xsl:for-each>) IS '<xsl:call-template name="listparams"><xsl:with-param name="func" select="." /></xsl:call-template> <xsl:value-of select='$comment' />';
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+
+<!--General replace macro hack to make up for the fact xsl 1.0 does not have a built in one.
+ Not needed for xsl 2.0 lifted from http://www.xml.com/pub/a/2002/06/05/transforming.html -->
+ <xsl:template name="globalReplace">
+ <xsl:param name="outputString"/>
+ <xsl:param name="target"/>
+ <xsl:param name="replacement"/>
+ <xsl:choose>
+ <xsl:when test="contains($outputString,$target)">
+ <xsl:value-of select=
+ "concat(substring-before($outputString,$target),
+ $replacement)"/>
+ <xsl:call-template name="globalReplace">
+ <xsl:with-param name="outputString"
+ select="substring-after($outputString,$target)"/>
+ <xsl:with-param name="target" select="$target"/>
+ <xsl:with-param name="replacement"
+ select="$replacement"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$outputString"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--macro to pull out function parameter names so we can provide a pretty arg list prefix for each function. -->
+ <xsl:template name="listparams">
+ <xsl:param name="func" />
+ <xsl:for-each select="$func">
+ <xsl:if test="count(paramdef/parameter) > 0">args: </xsl:if>
+ <xsl:for-each select="paramdef">
+ <xsl:choose>
+ <xsl:when test="count(parameter) > 0">
+ <xsl:value-of select="parameter" />
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>
+ </xsl:for-each>
+ <xsl:if test="count(paramdef/parameter) > 0"> - </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/doc/xsl/tiger_geocoder_cheatsheet.html.xsl b/doc/xsl/tiger_geocoder_cheatsheet.html.xsl
index cac6ebb03..938c8295b 100644
--- a/doc/xsl/tiger_geocoder_cheatsheet.html.xsl
+++ b/doc/xsl/tiger_geocoder_cheatsheet.html.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2011, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
statements from postgis xml doc reference
******************************************************************** -->
diff --git a/doc/xsl/tiger_geocoder_comments.sql.xsl b/doc/xsl/tiger_geocoder_comments.sql.xsl
index d48d624a5..66ece53bd 100644
--- a/doc/xsl/tiger_geocoder_comments.sql.xsl
+++ b/doc/xsl/tiger_geocoder_comments.sql.xsl
@@ -1,85 +1,85 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<!-- ********************************************************************
- ********************************************************************
- Copyright 2008, Regina Obe
- License: BSD
- Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
- statements from postgis xml doc reference
- ******************************************************************** -->
- <xsl:output method="text" />
-
- <!-- We deal only with the reference chapter -->
- <xsl:template match="/">
- <xsl:apply-templates select="/book/chapter[@id='Extras']" />
- </xsl:template>
-
- <xsl:template match="chapter">
- <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
-<!-- Pull out the purpose section for each ref entry and strip whitespace and put in a variable to be tagged unto each function comment -->
- <xsl:for-each select="sect1[@id='Tiger_Geocoder']/refentry">
- <xsl:variable name='plaincomment'>
- <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
- </xsl:variable>
-<!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
- <xsl:variable name='comment'>
- <xsl:call-template name="globalReplace">
- <xsl:with-param name="outputString" select="$plaincomment"/>
- <xsl:with-param name="target" select="$ap"/>
- <xsl:with-param name="replacement" select="''"/>
- </xsl:call-template>
- </xsl:variable>
-<!-- For each function prototype generate the DDL comment statement
- If its input is a geometry set - we know it is an aggregate function rather than a regular function
- Do not output OUT params since they define output rather than act as input and do not put a comma after argument just before an OUT parameter -->
- <xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
-COMMENT ON <xsl:choose><xsl:when test="contains(paramdef/type,'geometry set')">AGGREGATE</xsl:when><xsl:otherwise>FUNCTION</xsl:otherwise></xsl:choose><xsl:text> </xsl:text> <xsl:value-of select="funcdef/function" />(<xsl:for-each select="paramdef"><xsl:choose><xsl:when test="count(parameter) > 0">
-<xsl:choose><xsl:when test="contains(parameter,'OUT')"></xsl:when><xsl:when test="contains(type,'geometry set')">geometry</xsl:when><xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise></xsl:choose><xsl:if test="position()<last() and not(contains(parameter,'OUT')) and not(contains(following-sibling::paramdef[1],'OUT'))"><xsl:text>, </xsl:text></xsl:if></xsl:when>
-</xsl:choose></xsl:for-each>) IS '<xsl:call-template name="listparams"><xsl:with-param name="func" select="." /></xsl:call-template> <xsl:value-of select='$comment' />';
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
-
-<!--General replace macro hack to make up for the fact xsl 1.0 does not have a built in one.
- Not needed for xsl 2.0 lifted from http://www.xml.com/pub/a/2002/06/05/transforming.html -->
- <xsl:template name="globalReplace">
- <xsl:param name="outputString"/>
- <xsl:param name="target"/>
- <xsl:param name="replacement"/>
- <xsl:choose>
- <xsl:when test="contains($outputString,$target)">
- <xsl:value-of select=
- "concat(substring-before($outputString,$target),
- $replacement)"/>
- <xsl:call-template name="globalReplace">
- <xsl:with-param name="outputString"
- select="substring-after($outputString,$target)"/>
- <xsl:with-param name="target" select="$target"/>
- <xsl:with-param name="replacement"
- select="$replacement"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$outputString"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--macro to pull out function parameter names so we can provide a pretty arg list prefix for each function. -->
- <xsl:template name="listparams">
- <xsl:param name="func" />
- <xsl:for-each select="$func">
- <xsl:if test="count(paramdef/parameter) > 0">args: </xsl:if>
- <xsl:for-each select="paramdef">
- <xsl:choose>
- <xsl:when test="count(parameter) > 0">
- <xsl:value-of select="parameter" />
- </xsl:when>
- </xsl:choose>
- <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:if test="count(paramdef/parameter) > 0"> - </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
-</xsl:stylesheet>
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<!-- ********************************************************************
+ ********************************************************************
+ Copyright 2008, Regina Obe
+ License: BSD-3-Clause
+ Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
+ statements from postgis xml doc reference
+ ******************************************************************** -->
+ <xsl:output method="text" />
+
+ <!-- We deal only with the reference chapter -->
+ <xsl:template match="/">
+ <xsl:apply-templates select="/book/chapter[@id='Extras']" />
+ </xsl:template>
+
+ <xsl:template match="chapter">
+ <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
+<!-- Pull out the purpose section for each ref entry and strip whitespace and put in a variable to be tagged unto each function comment -->
+ <xsl:for-each select="sect1[@id='Tiger_Geocoder']/refentry">
+ <xsl:variable name='plaincomment'>
+ <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
+ </xsl:variable>
+<!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
+ <xsl:variable name='comment'>
+ <xsl:call-template name="globalReplace">
+ <xsl:with-param name="outputString" select="$plaincomment"/>
+ <xsl:with-param name="target" select="$ap"/>
+ <xsl:with-param name="replacement" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+<!-- For each function prototype generate the DDL comment statement
+ If its input is a geometry set - we know it is an aggregate function rather than a regular function
+ Do not output OUT params since they define output rather than act as input and do not put a comma after argument just before an OUT parameter -->
+ <xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
+COMMENT ON <xsl:choose><xsl:when test="contains(paramdef/type,'geometry set')">AGGREGATE</xsl:when><xsl:otherwise>FUNCTION</xsl:otherwise></xsl:choose><xsl:text> </xsl:text> <xsl:value-of select="funcdef/function" />(<xsl:for-each select="paramdef"><xsl:choose><xsl:when test="count(parameter) > 0">
+<xsl:choose><xsl:when test="contains(parameter,'OUT')"></xsl:when><xsl:when test="contains(type,'geometry set')">geometry</xsl:when><xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise></xsl:choose><xsl:if test="position()<last() and not(contains(parameter,'OUT')) and not(contains(following-sibling::paramdef[1],'OUT'))"><xsl:text>, </xsl:text></xsl:if></xsl:when>
+</xsl:choose></xsl:for-each>) IS '<xsl:call-template name="listparams"><xsl:with-param name="func" select="." /></xsl:call-template> <xsl:value-of select='$comment' />';
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+
+<!--General replace macro hack to make up for the fact xsl 1.0 does not have a built in one.
+ Not needed for xsl 2.0 lifted from http://www.xml.com/pub/a/2002/06/05/transforming.html -->
+ <xsl:template name="globalReplace">
+ <xsl:param name="outputString"/>
+ <xsl:param name="target"/>
+ <xsl:param name="replacement"/>
+ <xsl:choose>
+ <xsl:when test="contains($outputString,$target)">
+ <xsl:value-of select=
+ "concat(substring-before($outputString,$target),
+ $replacement)"/>
+ <xsl:call-template name="globalReplace">
+ <xsl:with-param name="outputString"
+ select="substring-after($outputString,$target)"/>
+ <xsl:with-param name="target" select="$target"/>
+ <xsl:with-param name="replacement"
+ select="$replacement"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$outputString"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--macro to pull out function parameter names so we can provide a pretty arg list prefix for each function. -->
+ <xsl:template name="listparams">
+ <xsl:param name="func" />
+ <xsl:for-each select="$func">
+ <xsl:if test="count(paramdef/parameter) > 0">args: </xsl:if>
+ <xsl:for-each select="paramdef">
+ <xsl:choose>
+ <xsl:when test="count(parameter) > 0">
+ <xsl:value-of select="parameter" />
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>
+ </xsl:for-each>
+ <xsl:if test="count(paramdef/parameter) > 0"> - </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/doc/xsl/topology_cheatsheet.html.xsl b/doc/xsl/topology_cheatsheet.html.xsl
index 39e7b7dc7..255a94b20 100644
--- a/doc/xsl/topology_cheatsheet.html.xsl
+++ b/doc/xsl/topology_cheatsheet.html.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2011, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
statements from postgis xml doc reference
******************************************************************** -->
diff --git a/doc/xsl/topology_comments.sql.xsl b/doc/xsl/topology_comments.sql.xsl
index d89fbc273..a1762c20b 100644
--- a/doc/xsl/topology_comments.sql.xsl
+++ b/doc/xsl/topology_comments.sql.xsl
@@ -1,94 +1,94 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<!-- ********************************************************************
- ********************************************************************
- Copyright 2008, Regina Obe
- License: BSD
- Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
- statements from postgis xml doc reference
- ******************************************************************** -->
- <xsl:output method="text" />
-
- <!-- We deal only with the reference chapter -->
- <xsl:template match="/">
- <xsl:apply-templates select="/book/chapter[@id='Topology']" />
- </xsl:template>
-
- <xsl:template match="chapter">
- <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
-<!-- Pull out the purpose section for each ref entry and strip whitespace and put in a variable to be tagged unto each function comment -->
- <xsl:for-each select="sect1[not(contains(@id,'Operator'))]/refentry">
- <xsl:variable name='plaincomment'>
- <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
- </xsl:variable>
-<!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
- <xsl:variable name='comment'>
- <xsl:call-template name="globalReplace">
- <xsl:with-param name="outputString" select="$plaincomment"/>
- <xsl:with-param name="target" select="$ap"/>
- <xsl:with-param name="replacement" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
-<!-- If this is a postgis type grab the ref entry summary and refname to make type comment -->
-<xsl:when test="parent::sect1[contains(@id,'Types')]">
-COMMENT ON TYPE topology.<xsl:value-of select="refnamediv/refname" /> IS 'postgis type: <xsl:value-of select='$comment' />';
-</xsl:when>
-<xsl:when test="parent::sect1[contains(@id,'Domain')]">
-COMMENT ON DOMAIN topology.<xsl:value-of select="refnamediv/refname" /> IS 'postgis domain: <xsl:value-of select='$comment' />';
-</xsl:when>
- </xsl:choose>
-<!-- For each function prototype generate the DDL comment statement
- If its input is a geometry set - we know it is an aggregate function rather than a regular function
- Do not output OUT params since they define output rather than act as input and do not put a comma after argument just before an OUT parameter -->
- <xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
-COMMENT ON <xsl:choose><xsl:when test="contains(paramdef/type,' set')">AGGREGATE</xsl:when><xsl:otherwise>FUNCTION</xsl:otherwise></xsl:choose><xsl:text></xsl:text> topology.<xsl:value-of select="funcdef/function" />(<xsl:for-each select="paramdef"><xsl:choose><xsl:when test="count(parameter) > 0">
-<xsl:choose><xsl:when test="contains(parameter,'OUT')"></xsl:when><xsl:when test="contains(type,'topoelement set')">topoelement</xsl:when><xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise></xsl:choose><xsl:if test="position()<last() and not(contains(parameter,'OUT')) and not(contains(following-sibling::paramdef[1],'OUT'))"><xsl:text>, </xsl:text></xsl:if></xsl:when>
-</xsl:choose></xsl:for-each>) IS '<xsl:call-template name="listparams"><xsl:with-param name="func" select="." /></xsl:call-template> <xsl:value-of select='$comment' />';
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
-
-<!--General replace macro hack to make up for the fact xsl 1.0 does not have a built in one.
- Not needed for xsl 2.0 lifted from http://www.xml.com/pub/a/2002/06/05/transforming.html -->
- <xsl:template name="globalReplace">
- <xsl:param name="outputString"/>
- <xsl:param name="target"/>
- <xsl:param name="replacement"/>
- <xsl:choose>
- <xsl:when test="contains($outputString,$target)">
- <xsl:value-of select=
- "concat(substring-before($outputString,$target),
- $replacement)"/>
- <xsl:call-template name="globalReplace">
- <xsl:with-param name="outputString"
- select="substring-after($outputString,$target)"/>
- <xsl:with-param name="target" select="$target"/>
- <xsl:with-param name="replacement"
- select="$replacement"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$outputString"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--macro to pull out function parameter names so we can provide a pretty arg list prefix for each function -->
- <xsl:template name="listparams">
- <xsl:param name="func" />
- <xsl:for-each select="$func">
- <xsl:if test="count(paramdef/parameter) > 0">args: </xsl:if>
- <xsl:for-each select="paramdef">
- <xsl:choose>
- <xsl:when test="count(parameter) > 0">
- <xsl:value-of select="parameter" />
- </xsl:when>
- </xsl:choose>
- <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:if test="count(paramdef/parameter) > 0"> - </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
-</xsl:stylesheet>
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<!-- ********************************************************************
+ ********************************************************************
+ Copyright 2008, Regina Obe
+ License: BSD-3-Clause
+ Purpose: This is an xsl transform that generates PostgreSQL COMMENT ON FUNCTION ddl
+ statements from postgis xml doc reference
+ ******************************************************************** -->
+ <xsl:output method="text" />
+
+ <!-- We deal only with the reference chapter -->
+ <xsl:template match="/">
+ <xsl:apply-templates select="/book/chapter[@id='Topology']" />
+ </xsl:template>
+
+ <xsl:template match="chapter">
+ <xsl:variable name="ap"><xsl:text>'</xsl:text></xsl:variable>
+<!-- Pull out the purpose section for each ref entry and strip whitespace and put in a variable to be tagged unto each function comment -->
+ <xsl:for-each select="sect1[not(contains(@id,'Operator'))]/refentry">
+ <xsl:variable name='plaincomment'>
+ <xsl:value-of select="normalize-space(translate(translate(refnamediv/refpurpose,'
', ' '), ' ', ' '))"/>
+ </xsl:variable>
+<!-- Replace apostrophes with 2 apostrophes needed for escaping in SQL -->
+ <xsl:variable name='comment'>
+ <xsl:call-template name="globalReplace">
+ <xsl:with-param name="outputString" select="$plaincomment"/>
+ <xsl:with-param name="target" select="$ap"/>
+ <xsl:with-param name="replacement" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+<!-- If this is a postgis type grab the ref entry summary and refname to make type comment -->
+<xsl:when test="parent::sect1[contains(@id,'Types')]">
+COMMENT ON TYPE topology.<xsl:value-of select="refnamediv/refname" /> IS 'postgis type: <xsl:value-of select='$comment' />';
+</xsl:when>
+<xsl:when test="parent::sect1[contains(@id,'Domain')]">
+COMMENT ON DOMAIN topology.<xsl:value-of select="refnamediv/refname" /> IS 'postgis domain: <xsl:value-of select='$comment' />';
+</xsl:when>
+ </xsl:choose>
+<!-- For each function prototype generate the DDL comment statement
+ If its input is a geometry set - we know it is an aggregate function rather than a regular function
+ Do not output OUT params since they define output rather than act as input and do not put a comma after argument just before an OUT parameter -->
+ <xsl:for-each select="refsynopsisdiv/funcsynopsis/funcprototype">
+COMMENT ON <xsl:choose><xsl:when test="contains(paramdef/type,' set')">AGGREGATE</xsl:when><xsl:otherwise>FUNCTION</xsl:otherwise></xsl:choose><xsl:text></xsl:text> topology.<xsl:value-of select="funcdef/function" />(<xsl:for-each select="paramdef"><xsl:choose><xsl:when test="count(parameter) > 0">
+<xsl:choose><xsl:when test="contains(parameter,'OUT')"></xsl:when><xsl:when test="contains(type,'topoelement set')">topoelement</xsl:when><xsl:otherwise><xsl:value-of select="type" /></xsl:otherwise></xsl:choose><xsl:if test="position()<last() and not(contains(parameter,'OUT')) and not(contains(following-sibling::paramdef[1],'OUT'))"><xsl:text>, </xsl:text></xsl:if></xsl:when>
+</xsl:choose></xsl:for-each>) IS '<xsl:call-template name="listparams"><xsl:with-param name="func" select="." /></xsl:call-template> <xsl:value-of select='$comment' />';
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+
+<!--General replace macro hack to make up for the fact xsl 1.0 does not have a built in one.
+ Not needed for xsl 2.0 lifted from http://www.xml.com/pub/a/2002/06/05/transforming.html -->
+ <xsl:template name="globalReplace">
+ <xsl:param name="outputString"/>
+ <xsl:param name="target"/>
+ <xsl:param name="replacement"/>
+ <xsl:choose>
+ <xsl:when test="contains($outputString,$target)">
+ <xsl:value-of select=
+ "concat(substring-before($outputString,$target),
+ $replacement)"/>
+ <xsl:call-template name="globalReplace">
+ <xsl:with-param name="outputString"
+ select="substring-after($outputString,$target)"/>
+ <xsl:with-param name="target" select="$target"/>
+ <xsl:with-param name="replacement"
+ select="$replacement"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$outputString"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--macro to pull out function parameter names so we can provide a pretty arg list prefix for each function -->
+ <xsl:template name="listparams">
+ <xsl:param name="func" />
+ <xsl:for-each select="$func">
+ <xsl:if test="count(paramdef/parameter) > 0">args: </xsl:if>
+ <xsl:for-each select="paramdef">
+ <xsl:choose>
+ <xsl:when test="count(parameter) > 0">
+ <xsl:value-of select="parameter" />
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>
+ </xsl:for-each>
+ <xsl:if test="count(paramdef/parameter) > 0"> - </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/doc/xsl/topology_gardentest.sql.xsl b/doc/xsl/topology_gardentest.sql.xsl
index 09f3f2fb0..945cf13db 100644
--- a/doc/xsl/topology_gardentest.sql.xsl
+++ b/doc/xsl/topology_gardentest.sql.xsl
@@ -3,7 +3,7 @@
<!-- ********************************************************************
********************************************************************
Copyright 2008-2010, Regina Obe
- License: BSD
+ License: BSD-3-Clause
Purpose: This is an xsl transform that generates an sql test script from xml docs to test all the functions we have documented
using a garden variety of geometries. Its intent is to flag major crashes.
******************************************************************** -->
-----------------------------------------------------------------------
Summary of changes:
LICENSE.TXT | 2 +-
doc/xsl/LICENSE | 13 ++
doc/xsl/post_gis_day_cards.html.xsl | 2 +-
doc/xsl/postgis_aggs_mm.xml.xsl | 2 +-
doc/xsl/postgis_cheatsheet.html.xsl | 2 +-
doc/xsl/postgis_comments.sql.xsl | 2 +-
doc/xsl/postgis_gardentest.sql.xsl | 2 +-
doc/xsl/postgis_gardentest_subset.sql.xsl | 2 +-
doc/xsl/postgis_reference.xml.xsl | 22 +--
doc/xsl/raster_cheatsheet.html.xsl | 2 +-
doc/xsl/raster_comments.sql.xsl | 248 ++++++++++++++---------------
doc/xsl/raster_gardentest.sql.xsl | 2 +-
doc/xsl/sfcgal_cheatsheet.html.xsl | 2 +-
doc/xsl/sfcgal_comments.sql.xsl | 170 ++++++++++----------
doc/xsl/tiger_geocoder_cheatsheet.html.xsl | 2 +-
doc/xsl/tiger_geocoder_comments.sql.xsl | 170 ++++++++++----------
doc/xsl/topology_cheatsheet.html.xsl | 2 +-
doc/xsl/topology_comments.sql.xsl | 188 +++++++++++-----------
doc/xsl/topology_gardentest.sql.xsl | 2 +-
19 files changed, 425 insertions(+), 412 deletions(-)
create mode 100644 doc/xsl/LICENSE
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list