Revision 4307
Added by ben leinfelder over 15 years ago
wps_Execute.xsl | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
|
|
3 |
<!-- |
|
4 |
Description: geberates an HTTP payload to execute a WPS request |
|
5 |
Author: adair |
|
6 |
Licence: LGPL as specified in http://www.gnu.org/copyleft/lesser.html . |
|
7 |
|
|
8 |
$Id$ |
|
9 |
$Name$ |
|
10 |
--> |
|
11 |
|
|
12 |
<xsl:stylesheet version="1.0" |
|
13 |
xmlns:wps="http://www.opengis.net/wps" |
|
14 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
15 |
xmlns:ogc="http://www.opengis.net/ogc" |
|
16 |
xmlns:ows="http://www.opengis.net/ows" |
|
17 |
xmlns:mb="http://mapbuilder.sourceforge.net/mapbuilder" |
|
18 |
xmlns:gml="http://www.opengis.net/gml" |
|
19 |
xmlns:xlink="http://www.w3.org/1999/xlink"> |
|
20 |
|
|
21 |
<xsl:output method="xml" omit-xml-declaration="no" encoding="utf-8" indent="yes"/> |
|
22 |
|
|
23 |
<xsl:param name="httpMethod">get</xsl:param> |
|
24 |
<xsl:param name="version"/> |
|
25 |
<xsl:param name="processName"/> |
|
26 |
<xsl:param name="store">false</xsl:param> |
|
27 |
|
|
28 |
<!-- template rule matching source root element --> |
|
29 |
<xsl:template match="wps:Process"> |
|
30 |
<wps:Execute version="{$version}" service="WPS"> |
|
31 |
<xsl:attribute name="store"><xsl:value-of select="$store"/></xsl:attribute> |
|
32 |
<xsl:choose> |
|
33 |
<xsl:when test="$httpMethod='post'"> |
|
34 |
<wps:ProcessName><xsl:value-of select="$processName"/></wps:ProcessName> |
|
35 |
</xsl:when> |
|
36 |
<xsl:otherwise> |
|
37 |
<mb:QueryString> |
|
38 |
<xsl:variable name="query"> |
|
1 |
<?xml version="1.0"?> |
|
2 |
<xsl:stylesheet xmlns:wps="http://www.opengis.net/wps" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows" xmlns:mb="http://mapbuilder.sourceforge.net/mapbuilder" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0"><xsl:output method="xml" omit-xml-declaration="yes" encoding="utf-8" indent="yes"/><xsl:param name="httpMethod">get</xsl:param><xsl:param name="version"/><xsl:param name="processName"/><xsl:param name="store">false</xsl:param><xsl:template match="wps:Process"><wps:Execute version="{$version}" service="WPS"><xsl:attribute name="store"><xsl:value-of select="$store"/></xsl:attribute><xsl:choose><xsl:when test="$httpMethod='post'"><wps:ProcessName><xsl:value-of select="$processName"/></wps:ProcessName></xsl:when><xsl:otherwise><mb:QueryString><xsl:variable name="query"> |
|
39 | 3 |
request=Execute |
40 | 4 |
&service=WPS |
41 | 5 |
&version=<xsl:value-of select="$version"/> |
42 |
&ProcessName=<xsl:value-of select="wps:Name"/> |
|
43 |
<xsl:apply-templates select="wps:Input"/> |
|
44 |
</xsl:variable> |
|
45 |
<xsl:value-of select="translate(normalize-space($query),' ', '' )" disable-output-escaping="no"/> |
|
46 |
</mb:QueryString> |
|
47 |
</xsl:otherwise> |
|
48 |
</xsl:choose> |
|
49 |
<xsl:apply-templates select="wps:Output"/> |
|
50 |
</wps:Execute> |
|
51 |
</xsl:template> |
|
52 |
|
|
53 |
<xsl:template match="wps:Output/wps:Parameter"> |
|
54 |
&<xsl:value-of select="wps:Name"/>=<xsl:apply-templates select="wps:Datatype"/> |
|
55 |
</xsl:template> |
|
56 |
|
|
57 |
<xsl:template match="wps:Input/wps:Parameter"> |
|
58 |
&<xsl:value-of select="wps:Name"/>=<xsl:apply-templates select="wps:Datatype"/> |
|
59 |
</xsl:template> |
|
60 |
|
|
61 |
<xsl:template match="wps:Datatype/wps:Reference"> |
|
62 |
<xsl:value-of select="@xlink:href"/> |
|
63 |
</xsl:template> |
|
64 |
|
|
65 |
<xsl:template match="wps:Datatype/wps:LiteralValue"> |
|
66 |
<xsl:value-of select="."/> |
|
67 |
</xsl:template> |
|
68 |
|
|
69 |
<xsl:template match="wps:Datatype/wps:ComplexValue"> |
|
70 |
<xsl:value-of select="."/> |
|
71 |
</xsl:template> |
|
72 |
|
|
73 |
<xsl:template match="wps:Datatype/wps:BoundingBox"> |
|
74 |
<xsl:value-of select="."/> |
|
75 |
</xsl:template> |
|
76 |
|
|
77 |
<xsl:template match="text()|@*"/> |
|
78 |
|
|
79 |
</xsl:stylesheet> |
|
6 |
&ProcessName=<xsl:value-of select="wps:Name"/><xsl:apply-templates select="wps:Input"/></xsl:variable><xsl:value-of select="translate(normalize-space($query),' ', '' )" disable-output-escaping="no"/></mb:QueryString></xsl:otherwise></xsl:choose><xsl:apply-templates select="wps:Output"/></wps:Execute></xsl:template><xsl:template match="wps:Output/wps:Parameter"> |
|
7 |
&<xsl:value-of select="wps:Name"/>=<xsl:apply-templates select="wps:Datatype"/></xsl:template><xsl:template match="wps:Input/wps:Parameter"> |
|
8 |
&<xsl:value-of select="wps:Name"/>=<xsl:apply-templates select="wps:Datatype"/></xsl:template><xsl:template match="wps:Datatype/wps:Reference"><xsl:value-of select="@xlink:href"/></xsl:template><xsl:template match="wps:Datatype/wps:LiteralValue"><xsl:value-of select="."/></xsl:template><xsl:template match="wps:Datatype/wps:ComplexValue"><xsl:value-of select="."/></xsl:template><xsl:template match="wps:Datatype/wps:BoundingBox"><xsl:value-of select="."/></xsl:template><xsl:template match="text()|@*"/></xsl:stylesheet> |
Also available in: Unified diff
upgrade to MapBuilder 1.5rc2 - includes support for Firefox 3 compatibility (yes, it is also EOLed)