[Mapbender-commits] r9786 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Sep 29 04:06:02 PDT 2017


Author: armin11
Date: 2017-09-29 04:06:02 -0700 (Fri, 29 Sep 2017)
New Revision: 9786

Modified:
   trunk/mapbender/http/classes/class_wfs_2_0_factory.php
Log:
Fix for xml parsing in case of wfs > 2.0

Modified: trunk/mapbender/http/classes/class_wfs_2_0_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_2_0_factory.php	2017-09-29 10:25:51 UTC (rev 9785)
+++ trunk/mapbender/http/classes/class_wfs_2_0_factory.php	2017-09-29 11:06:02 UTC (rev 9786)
@@ -412,13 +412,13 @@
 
 				$myWfs->transaction =  html_entity_decode($this->getValue($xpath, '/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Operation[@name="Transaction"]/ows:DCP/ows:HTTP/ows:Post/@xlink:href', $wfs20Cap));
 //get supported formats [mimetypes]
-				$wfsOutputFormatArray = $this->getValue($xpath, '/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Parameter[@name="outputFormat"]/ows:AllowedValues/ows:Value', $wfs20Cap);
-				foreach ($wfsOutputFormatArray as $outputFormat) {
-					$outputFormat = $this->getValue($xpath, './text()', $outputFormat);
-					$myWfs->OutputFormatArray[] = $outputFormat;
-				}	
-				//$wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Operation[@name="GetFeature"]/ows:Parameter[@name="outputFormat"]/ows:Value');
-
+				$allowedValuesArray = $this->getValue($xpath, '/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Parameter[@name="outputFormat"]/ows:AllowedValues', $wfs20Cap);
+				$wfsOutputFormatsArray = $xpath->query('./ows:Value', $allowedValuesArray);
+				foreach ($wfsOutputFormatsArray as $allowedValue) {
+					$outputFormat1 = $this->getValue($xpath, './text()', $allowedValue);
+					$myWfs->wfsOutputFormatArray[] = $outputFormat1;
+					$e = new mb_notice("class_wfs_2_0_factory.php: add outputFormat for WFS: ".$outputFormat1);
+				}
 				//get list of featuretypes
 				$capFeatureTypes = $xpath->query('/wfs:WFS_Capabilities/wfs:FeatureTypeList/wfs:FeatureType', $wfs20Cap);
 				$i = 1; //cause index of xml objects begin with 1
@@ -431,18 +431,14 @@
 					$otherCRSArray =  $xpath->query('./wfs:OtherCRS', $featureType);
 					foreach ($otherCRSArray as $otherCRS) {
                         			$crs = $this->getValue($xpath, './text()', $otherCRS);
-						$e = new mb_notice("other crs: ".$crs);
+						//$e = new mb_exception("other crs: ".$crs);
 						$featuretype_crsArray[] = $crs;
 					}
-					$featuretypeOutputFormats = array();
-
-					$outputFormats = $this->getValue($xpath, './wfs:OutputFormats/wfs:Format', $featureType);
-					//$featureType->OutputFormats->Format;
-					
-					foreach ($outputFormats as $outputFormat) {
-						$outputFormat = $this->getValue($xpath, './text()', $outputFormat);
-						$featuretypeOutputFormats[] = $outputFormat;
-						$e = new mb_exception("class_wfs_2_0_factory.php: add outputFormat for WFS: ".$outputFormat);
+					$featuretypeOutputFormatsArray = $xpath->query('./wfs:OutputFormats/wfs:Format', $featureType);
+					foreach ($featuretypeOutputFormatsArray as $outputFormat) {
+						$outputFormat1 = $this->getValue($xpath, './text()', $outputFormat);
+						$featuretypeOutputFormats[] = $outputFormat1;
+						$e = new mb_notice("class_wfs_2_0_factory.php: add outputFormat for WFS featuretype: ".$featuretype_name. " - format: ".$outputFormat1);
 					}
 					//<wfs:MetadataURL type="FGDC" format="text/xml">http://www.ogccatservice.com/csw.cgi?service=CSW&version=2.0.0&request=GetRecords&constraintlanguage=CQL&constraint="recordid=urn:uuid:4ee8b2d3-9409-4a1d-b26b-6782e4fa3d59"</wfs:MetadataURL>
 					$metadataURLArray = $xpath->query('./wfs:MetadataURL', $featureType);



More information about the Mapbender_commits mailing list