getrecords.xsl
2.87 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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:ows="http://www.opengis.net/ows"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink">
<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<!-- Match Root -->
<xsl:template match="/defaults">
<csw:GetRecords
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
service = "CSW">
<xsl:attribute name="version">
<xsl:value-of select="./version"/>
</xsl:attribute>
<xsl:attribute name="maxRecords">
<xsl:value-of select="./maxrecords"/>
</xsl:attribute>
<xsl:attribute name="startPosition">
<xsl:value-of select="./startposition"/>
</xsl:attribute>
<xsl:attribute name="outputFormat">
<xsl:value-of select="./outputformat"/>
</xsl:attribute>
<xsl:attribute name="outputSchema">
<xsl:value-of select="./outputschema"/>
</xsl:attribute>
<xsl:attribute name="resultType">
<xsl:value-of select="./resulttype"/>
</xsl:attribute>
<csw:Query typeNames="csw:Record">
<csw:ElementSetName>summary</csw:ElementSetName>
<!-- Don't add Constraint if searh term is empty; this keeps Geonetwork happy -->
<xsl:if test="./literal !=''">
<csw:Constraint version="1.1.0">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc" xmlns="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml">
<!--
<ogc:And>
<xsl:if test="./lowerCorner !=''">
<ogc:Intersects>
<ogc:PropertyName>iso:BoundingBox</ogc:PropertyName>
<gml:Envelope xmlns:gml="http://www.opengis.net/gml">
<gml:lowerCorner>
<xsl:value-of select="./lowerCorner"/>
</gml:lowerCorner>
<gml:upperCorner>
<xsl:value-of select="./upperCorner"/>
</gml:upperCorner>
</gml:Envelope>
</ogc:Intersects>
</xsl:if>
-->
<ogc:PropertyIsLike escape="\" singleChar="_" wildCard="%">
<ogc:PropertyName>
<xsl:value-of select="./propertyname"/>
</ogc:PropertyName>
<ogc:Literal>
<xsl:value-of select="./literal"/>
</ogc:Literal>
</ogc:PropertyIsLike>
<!--</ogc:And>-->
</ogc:Filter>
</csw:Constraint>
</xsl:if>
<ogc:SortBy xmlns:ogc="http://www.opengis.net/ogc">
<xsl:if test="./sortby !=''">
<ogc:SortProperty>
<ogc:PropertyName>
<xsl:value-of select="./sortby"/>
</ogc:PropertyName>
<ogc:SortOrder>
<xsl:value-of select="./sortorder"/>
</ogc:SortOrder>
</ogc:SortProperty>
</xsl:if>
</ogc:SortBy>
</csw:Query>
</csw:GetRecords>
</xsl:template>
</xsl:stylesheet>