From 9f9829053af3ecdb6b3915b8635f783454de96d9 Mon Sep 17 00:00:00 2001 From: Bart van den Eijnden Date: Wed, 14 Dec 2011 15:20:00 +0100 Subject: [PATCH] do not wrap DOMElements in CDATA sections for WPS Execute, p=jachym, r=me (closes http://trac.osgeo.org/openlayers/ticket/3517) --- lib/OpenLayers/Format/WPSExecute.js | 11 ++++++++--- tests/Format/WPSExecute.html | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/OpenLayers/Format/WPSExecute.js b/lib/OpenLayers/Format/WPSExecute.js index 9761e1a010..39c3162b4b 100644 --- a/lib/OpenLayers/Format/WPSExecute.js +++ b/lib/OpenLayers/Format/WPSExecute.js @@ -203,9 +203,14 @@ OpenLayers.Format.WPSExecute = OpenLayers.Class(OpenLayers.Format.XML, { schema: complexData.schema } }); - node.appendChild( - this.getXMLDoc().createCDATASection(complexData.value) - ); + var data = complexData.value; + if (typeof data === "string") { + node.appendChild( + this.getXMLDoc().createCDATASection(complexData.value) + ); + } else { + node.appendChild(data); + } return node; }, "Reference": function(reference) { diff --git a/tests/Format/WPSExecute.html b/tests/Format/WPSExecute.html index 4e9ed6ddd5..112a66b5ee 100644 --- a/tests/Format/WPSExecute.html +++ b/tests/Format/WPSExecute.html @@ -413,6 +413,13 @@ ' ]]>' + ' ' + ' ' + + ' ' + + ' GMLPoint' + + ' Point as GML' + + ' ' + + ' 10 10' + + ' ' + + ' ' + ' ' + ' ' + ' ' + @@ -442,6 +449,14 @@ value: "" } } + }, { + identifier: "GMLPoint", + title: "Point as GML", + data: { + complexData: { + value: OpenLayers.Format.GML.v3.prototype.writers.feature["_geometry"].apply(new OpenLayers.Format.GML.v3({curve: true, surface: true}), [new OpenLayers.Geometry.Point(10, 10)]) + } + } }], responseForm: { responseDocument: {