forked from SharpMap/SharpMap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWFS_XPathTextResourcesBase.cs
More file actions
239 lines (205 loc) · 8.34 KB
/
WFS_XPathTextResourcesBase.cs
File metadata and controls
239 lines (205 loc) · 8.34 KB
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
234
235
236
237
238
239
// WFS provider by Peter Robineau (peter.robineau@gmx.at)
// This file can be redistributed and/or modified under the terms of the GNU Lesser General Public License.
namespace SharpMap.Utilities.Wfs
{
/// <summary>
/// Base class for <see cref="IWFS_TextResources"/> implementations
/// </summary>
public class WFS_XPathTextResourcesBase
{
#region Fields and Properties
////////////////////////////////////////////////////////////////////////
// NamespaceURIs and //
// Prefixes //
////////////////////////////////////////////////////////////////////////
private static string _XPATH_GEOMETRY_ELEMREF_GEOMNAMEQUERY =
// _param1 = TargetNs
// _param2 = Value of the type-attribute
"//xs:element[_PARAMCOMPWITHTARGETNS_(@type, $_param1, $_param2)]/@name";
private static string _XPATH_GEOMETRY_ELEMREF_GEOMNAMEQUERY_ANONYMOUSTYPE =
"//xs:element[starts-with(@ref,'gml:')]/ancestor::xs:complexType[1]/ancestor::xs:element[1]/@name";
private static string _XPATH_GEOMETRY_ELEMREF_GMLELEMENTQUERY =
"descendant::xs:element[starts-with(@ref,'gml:')]/@ref";
private static string _XPATH_GEOMETRYELEMENT_BYTYPEATTRIBUTEQUERY =
"//xs:element[starts-with(@type,'gml:')]";
private static string _XPATH_GEOMETRYELEMENTCOMPLEXTYPE_BYELEMREFQUERY =
"//xs:element[starts-with(@ref,'gml:')]/ancestor::xs:complexType[1]";
private static string _XPATH_NAMEATTRIBUTEQUERY = "@name";
private static string _XPATH_TARGETNS =
"/xs:schema/@targetNamespace";
private static string _XPATH_TYPEATTRIBUTEQUERY = "@type";
private string _NSFEATURETYPEPREFIX = "feature";
private string _NSGML = "http://www.opengis.net/gml";
private string _NSGMLPREFIX = "gml";
private string _NSOGC = "http://www.opengis.net/ogc";
private string _NSOGCPREFIX = "ogc";
private string _NSOWS = "http://www.opengis.net/ows";
private string _NSOWSPREFIX = "ows";
private string _NSSCHEMA = "http://www.w3.org/2001/XMLSchema";
private string _NSSCHEMAPREFIX = "xs";
private string _NSWFS = "http://www.opengis.net/wfs";
private string _NSWFSPREFIX = "wfs";
private string _NSXLINK = "http://www.w3.org/1999/xlink";
private string _NSXLINKPREFIX = "xlink";
/// <summary>
/// Prefix used for OGC namespace
/// </summary>
public string NSOGCPREFIX
{
get { return _NSOGCPREFIX; }
}
/// <summary>
/// OGC namespace URI
/// </summary>
public string NSOGC
{
get { return _NSOGC; }
}
/// <summary>
/// Prefix used for XLink namespace
/// </summary>
public string NSXLINKPREFIX
{
get { return _NSXLINKPREFIX; }
}
/// <summary>
/// XLink namespace URI
/// </summary>
public string NSXLINK
{
get { return _NSXLINK; }
}
/// <summary>
/// Prefix used for feature namespace
/// </summary>
public string NSFEATURETYPEPREFIX
{
get { return _NSFEATURETYPEPREFIX; }
}
/// <summary>
/// Prefix used for WFS namespace
/// </summary>
public string NSWFSPREFIX
{
get { return _NSWFSPREFIX; }
}
/// <summary>
/// WFS namespace URI
/// </summary>
public string NSWFS
{
get { return _NSWFS; }
}
/// <summary>
/// Prefix used for GML namespace
/// </summary>
public string NSGMLPREFIX
{
get { return _NSGMLPREFIX; }
}
/// <summary>
/// GML namespace URI
/// </summary>
public string NSGML
{
get { return _NSGML; }
}
/// <summary>
/// Prefix used for OWS namespace
/// </summary>
public string NSOWSPREFIX
{
get { return _NSOWSPREFIX; }
}
/// <summary>
/// OWS namespace URI
/// </summary>
public string NSOWS
{
get { return _NSOWS; }
}
/// <summary>
/// Prefix used for XML schema namespace
/// </summary>
public string NSSCHEMAPREFIX
{
get { return _NSSCHEMAPREFIX; }
}
/// <summary>
/// XML schema namespace URI
/// </summary>
public string NSSCHEMA
{
get { return _NSSCHEMA; }
}
////////////////////////////////////////////////////////////////////////
// XPath //
// DescribeFeatureType WFS 1.0.0 //
////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets an XPath string addressing the target namespace in 'DescribeFeatureType'.
/// </summary>
public string XPATH_TARGETNS
{
get { return _XPATH_TARGETNS; }
}
/// <summary>
/// Gets an XPath string addressing an element with a 'gml'-prefixed type-attribute in 'DescribeFeatureType'.
/// This for querying the geometry element of a featuretype in the most simple manner.
/// </summary>
public string XPATH_GEOMETRYELEMENT_BYTYPEATTRIBUTEQUERY
{
get { return _XPATH_GEOMETRYELEMENT_BYTYPEATTRIBUTEQUERY; }
}
/// <summary>
/// Gets an XPath string addressing a name-attribute.
/// </summary>
public string XPATH_NAMEATTRIBUTEQUERY
{
get { return _XPATH_NAMEATTRIBUTEQUERY; }
}
/// <summary>
/// Gets an XPath string addressing a type-attribute.
/// </summary>
public string XPATH_TYPEATTRIBUTEQUERY
{
get { return _XPATH_TYPEATTRIBUTEQUERY; }
}
/// <summary>
/// Gets an XPath string addressing a complex type hosting an element with a 'gml'-prefixed ref-attribute in 'DescribeFeatureType'.
/// This for querying the geometry element of a featuretype.
/// Step1: Finding the complex type with a geometry element from GML specification.
/// </summary>
public string XPATH_GEOMETRYELEMENTCOMPLEXTYPE_BYELEMREFQUERY
{
get { return _XPATH_GEOMETRYELEMENTCOMPLEXTYPE_BYELEMREFQUERY; }
}
/// <summary>
/// Gets an XPath string addressing the name of an element having a type-attribute referencing
/// a complex type hosting an element with a 'gml'-prefixed ref-attribute in 'DescribeFeatureType'.
/// Step2: Finding the name of the featuretype's element with a named complex type hosting the GML geometry.
/// </summary>
public string XPATH_GEOMETRY_ELEMREF_GEOMNAMEQUERY
{
get { return _XPATH_GEOMETRY_ELEMREF_GEOMNAMEQUERY; }
}
/// <summary>
/// Gets an XPath string addressing the name of an element described by an anonymous complex type
/// hosting an element with a 'gml'-prefixed ref-attribute in 'DescribeFeatureType'.
/// Step2Alt: Finding the name of the featuretype's element with an anonymous complex type hosting the GML geometry.
/// </summary>
public string XPATH_GEOMETRY_ELEMREF_GEOMNAMEQUERY_ANONYMOUSTYPE
{
get { return _XPATH_GEOMETRY_ELEMREF_GEOMNAMEQUERY_ANONYMOUSTYPE; }
}
/// <summary>
/// Gets an XPath string addressing the 'gml'-prefixed ref-attribute of an element.
/// This is for querying the name of the GML geometry element.
/// </summary>
public string XPATH_GEOMETRY_ELEMREF_GMLELEMENTQUERY
{
get { return _XPATH_GEOMETRY_ELEMREF_GMLELEMENTQUERY; }
}
#endregion
}
}