1 | <xsl:stylesheet version="1.0" |
---|
2 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
3 | xmlns:ows="http://www.opengis.net/ows/1.1" |
---|
4 | xmlns:ns14="http://www.opengis.net/wps/2.0" |
---|
5 | xmlns:wps="http://www.opengis.net/wps/2.0" |
---|
6 | xmlns:xlink="http://www.w3.org/1999/xlink"> |
---|
7 | |
---|
8 | <!-- |
---|
9 | This template is used by the ZOO-Kernel to generate a specific |
---|
10 | OGC WPS Execute request in case of rest service callback use. |
---|
11 | In such a case the ZOO-Kernel replace every input provided by |
---|
12 | value in the initial request and replace the data section by the |
---|
13 | reference to the published ressource. |
---|
14 | So, this template is basically made to replace any input provided |
---|
15 | by value to the corresponding local WCS/WFS OGC web service |
---|
16 | references. |
---|
17 | --> |
---|
18 | <xsl:output method="xml"/> |
---|
19 | <xsl:param name="value" select="string('-1')"/> |
---|
20 | <xsl:param name="attr" select="string('-1')"/> |
---|
21 | <xsl:param name="cnt" select="string('-1')"/> |
---|
22 | <xsl:param name="index" select="0"/> |
---|
23 | |
---|
24 | <xsl:template match="@*|node()"> |
---|
25 | <xsl:copy> |
---|
26 | <xsl:apply-templates select="@*|node()"/> |
---|
27 | </xsl:copy> |
---|
28 | </xsl:template> |
---|
29 | |
---|
30 | |
---|
31 | <xsl:template match="/wps:Execute/wps:Input"> |
---|
32 | <xsl:choose> |
---|
33 | <xsl:when test="@id=$attr"> |
---|
34 | <xsl:copy> |
---|
35 | <xsl:attribute name="id"> |
---|
36 | <xsl:value-of select="@id"/> |
---|
37 | </xsl:attribute> |
---|
38 | <ns14:Reference> |
---|
39 | <xsl:attribute name="xlink:href"> |
---|
40 | <xsl:value-of select="$value"/> |
---|
41 | </xsl:attribute> |
---|
42 | <xsl:if test="./wps:Data[@mimeType!='']"> |
---|
43 | <xsl:attribute name="mimeType"> |
---|
44 | <xsl:value-of select="./wps:Data[@mimeType]"/> |
---|
45 | </xsl:attribute> |
---|
46 | <xsl:attribute name="encoding"> |
---|
47 | <xsl:value-of select="./wps:Data[@encoding]"/> |
---|
48 | </xsl:attribute> |
---|
49 | <xsl:attribute name="schema"> |
---|
50 | <xsl:value-of select="./wps:Data[@schema]"/> |
---|
51 | </xsl:attribute> |
---|
52 | </xsl:if> |
---|
53 | </ns14:Reference> |
---|
54 | </xsl:copy> |
---|
55 | </xsl:when> |
---|
56 | <xsl:otherwise> |
---|
57 | <xsl:copy-of select="."/> |
---|
58 | </xsl:otherwise> |
---|
59 | </xsl:choose> |
---|
60 | </xsl:template> |
---|
61 | |
---|
62 | |
---|
63 | </xsl:stylesheet> |
---|