[Mapbender-commits] r7728 - trunk/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Mar 31 05:12:58 EDT 2011
Author: kmq
Date: 2011-03-31 02:12:58 -0700 (Thu, 31 Mar 2011)
New Revision: 7728
Modified:
trunk/mapbender/http/classes/class_wfs_1_0_factory.php
trunk/mapbender/http/classes/class_wfs_1_1_factory.php
Log:
reintroduce quirky featuretype parsing to work with older code
Modified: trunk/mapbender/http/classes/class_wfs_1_0_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_0_factory.php 2011-03-30 09:31:06 UTC (rev 7727)
+++ trunk/mapbender/http/classes/class_wfs_1_0_factory.php 2011-03-31 09:12:58 UTC (rev 7728)
@@ -89,7 +89,16 @@
$query = sprintf("//xs:complexType[@name='%s']//xs:element",$elementTypeLocalname);
$subElementList = $xpath->query($query);
foreach($subElementList as $subElement){
- $newFeatureType->addElement($subElement->getAttribute('name'), $subElement->getAttribute('type'));
+ // Since this is a rewrite of the old way, it reproduces it quirks
+ // in this case the namespace of the type was cut off for some reason
+ $name = $subElement->getAttribute('name');
+ $typeParts = explode(":",$subElement->getAttribute('type'));
+ if(count($typeParts) == 1){
+ $type = $typeParts[0];
+ }else{
+ $type = $typeParts[1];
+ }
+ $newFeatureType->addElement($name,$type);
}
}
Modified: trunk/mapbender/http/classes/class_wfs_1_1_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_1_factory.php 2011-03-30 09:31:06 UTC (rev 7727)
+++ trunk/mapbender/http/classes/class_wfs_1_1_factory.php 2011-03-31 09:12:58 UTC (rev 7728)
@@ -131,7 +131,16 @@
$subElementList = $xpath->query($query);
$e = new mb_exception("NNN sub $query $subElementList->length");
foreach($subElementList as $subElement){
- $newFeatureType->addElement($subElement->getAttribute('name'), $subElement->getAttribute('type'));
+ // Since this is a rewrite of the old way, it reproduces it quirks
+ // in this case the namespace of the type was cut off for some reason
+ $name = $subElement->getAttribute('name');
+ $typeParts = explode(":",$subElement->getAttribute('type'));
+ if(count($typeParts) == 1){
+ $type = $typeParts[0];
+ }else{
+ $type = $typeParts[1];
+ }
+ $newFeatureType->addElement($name,$type);
}
}
More information about the Mapbender_commits
mailing list