forked from geosolutions-it/schema-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsuggest.xsl
51 lines (44 loc) · 1.8 KB
/
suggest.xsl
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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/"
extension-element-prefixes="saxon"
version="2.0">
<!-- Register here the list of process for the schema-->
<xsl:include href="process/scale-denominator-formatter.xsl"/>
<xsl:include href="process/add-info-from-wms.xsl"/>
<xsl:include href="process/add-service-info-from-wxs.xsl"/>
<xsl:include href="process/linked-data-checker.xsl"/>
<xsl:include href="process/related-metadata-checker.xsl"/>
<xsl:variable name="processes">
<p>scale-denominator-formatter</p>
<p>add-info-from-wms</p>
<p>add-service-info-from-wxs</p>
<p>linked-data-checker</p>
<p>related-metadata-checker</p>
</xsl:variable>
<xsl:param name="action" select="'list'"/>
<xsl:param name="process" select="''"/>
<!-- Analyze or process -->
<xsl:template match="/">
<xsl:choose>
<xsl:when test="$action= 'list' or $action = 'analyze'">
<xsl:variable name="root" select="/"/>
<suggestions>
<!-- Filter process if user ask for a specific one. If not loop over all. -->
<xsl:for-each select="if ($process='') then $processes/p else $processes/p[.=$process]">
<xsl:variable name="tplName" select="concat($action, '-',.)"/>
<saxon:call-template name="{$tplName}">
<xsl:with-param name="root" select="$root"/>
<xsl:fallback>
<xsl:message>Fall back as no saxon:call-template exists</xsl:message>
</xsl:fallback>
</saxon:call-template>
</xsl:for-each>
</suggestions>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>