1
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2
|
|
3
|
|
4
|
|
5
|
<!--
|
6
|
|
7
|
Description: transforms a WFS FeatureType node to a DescribeFeatureType request
|
8
|
|
9
|
Author: adair
|
10
|
|
11
|
Licence: LGPL as specified in http://www.gnu.org/copyleft/lesser.html .
|
12
|
|
13
|
|
14
|
|
15
|
$Id$
|
16
|
|
17
|
$Name$
|
18
|
|
19
|
-->
|
20
|
|
21
|
|
22
|
|
23
|
<xsl:stylesheet version="1.0"
|
24
|
|
25
|
xmlns:wfs="http://www.opengis.net/wfs"
|
26
|
|
27
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
28
|
|
29
|
xmlns:ogc="http://www.opengis.net/ogc"
|
30
|
|
31
|
xmlns:mb="http://mapbuilder.sourceforge.net/mapbuilder"
|
32
|
|
33
|
xmlns:gml="http://www.opengis.net/gml"
|
34
|
|
35
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
36
|
|
37
|
|
38
|
|
39
|
<xsl:output method="xml" omit-xml-declaration="no" encoding="utf-8" indent="yes"/>
|
40
|
|
41
|
|
42
|
|
43
|
<xsl:param name="httpMethod">get</xsl:param>
|
44
|
|
45
|
|
46
|
|
47
|
<!-- template rule matching source root element -->
|
48
|
|
49
|
<xsl:template match="/wfs:WFS_Capabilities/wfs:FeatureTypeList">
|
50
|
|
51
|
<DescribeFeatureType version="1.0.0" service="WFS">
|
52
|
|
53
|
<xsl:apply-templates select="wfs:FeatureType"/>
|
54
|
|
55
|
</DescribeFeatureType>
|
56
|
|
57
|
</xsl:template>
|
58
|
|
59
|
|
60
|
|
61
|
<!-- template rule matching source root element -->
|
62
|
|
63
|
<xsl:template match="wfs:FeatureType">
|
64
|
|
65
|
<xsl:choose>
|
66
|
|
67
|
<xsl:when test="$httpMethod='post'">
|
68
|
|
69
|
<TypeName><xsl:value-of select="wfs:Name"/></TypeName>
|
70
|
|
71
|
</xsl:when>
|
72
|
|
73
|
<xsl:otherwise>
|
74
|
|
75
|
<mb:QueryString>
|
76
|
|
77
|
<xsl:variable name="query">
|
78
|
|
79
|
request=DescribeFeatureType
|
80
|
|
81
|
&version=1.0.0
|
82
|
|
83
|
&service=WFS
|
84
|
|
85
|
&typename=<xsl:value-of select="wfs:Name"/>
|
86
|
|
87
|
</xsl:variable>
|
88
|
|
89
|
<xsl:value-of select="translate(normalize-space($query),' ', '' )" disable-output-escaping="no"/>
|
90
|
|
91
|
</mb:QueryString>
|
92
|
|
93
|
</xsl:otherwise>
|
94
|
|
95
|
</xsl:choose>
|
96
|
|
97
|
</xsl:template>
|
98
|
|
99
|
|
100
|
|
101
|
<xsl:template match="text()|@*"/>
|
102
|
|
103
|
|
104
|
|
105
|
</xsl:stylesheet>
|
106
|
|