[Mapbender-commits] r9417 - trunk/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Mar 7 05:50:24 PST 2016
Author: verenadiewald
Date: 2016-03-07 05:50:24 -0800 (Mon, 07 Mar 2016)
New Revision: 9417
Modified:
trunk/mapbender/http/classes/class_cswrecord.php
trunk/mapbender/http/classes/class_gml2.php
trunk/mapbender/http/classes/class_kml.php
trunk/mapbender/http/classes/class_wfs_deprecated.php
Log:
some smaller code beautifications in xml parsing
Modified: trunk/mapbender/http/classes/class_cswrecord.php
===================================================================
--- trunk/mapbender/http/classes/class_cswrecord.php 2016-03-04 08:36:12 UTC (rev 9416)
+++ trunk/mapbender/http/classes/class_cswrecord.php 2016-03-07 13:50:24 UTC (rev 9417)
@@ -135,12 +135,12 @@
//Version 2.0.2
//@todo: handle other profiles
- if((mb_strtoupper($element[tag]) == "CSW:SEARCHRESULTS" OR mb_strtoupper($element[tag]) == "SEARCHRESULTS") && $element[type] == "open"){
- $this->elementSet = $element[attributes][elementSet];
- $this->numberOfRecordsMatched = $element[attributes][numberOfRecordsMatched];
+ if((mb_strtoupper($element['tag']) == "CSW:SEARCHRESULTS" OR mb_strtoupper($element['tag']) == "SEARCHRESULTS") && $element['type'] == "open"){
+ $this->elementSet = $element['attributes'][elementSet];
+ $this->numberOfRecordsMatched = $element['attributes'][numberOfRecordsMatched];
}
- if((mb_strtoupper($element[tag]) == "CSW:SUMMARYRECORD" OR mb_strtoupper($element[tag]) == "SUMMARYRECORD") && $element[type] == "open"){
+ if((mb_strtoupper($element['tag']) == "CSW:SUMMARYRECORD" OR mb_strtoupper($element['tag']) == "SUMMARYRECORD") && $element['type'] == "open"){
//Create SummaryRecords Object
$summaryObj = new cswSummaryRecord();
}
@@ -148,41 +148,41 @@
//SummaryRecord elements
//ID
- if((mb_strtoupper($element[tag]) == "DC:IDENTIFIER" OR mb_strtoupper($element[tag]) == "IDENTIFIER")){
- $summaryObj->identifier = $element[value];
+ if((mb_strtoupper($element['tag']) == "DC:IDENTIFIER" OR mb_strtoupper($element['tag']) == "IDENTIFIER")){
+ $summaryObj->identifier = $element['value'];
}
//Title
- if((mb_strtoupper($element[tag]) == "DC:TITLE" OR mb_strtoupper($element[tag]) == "TITLE")){
- $summaryObj->title = $element[value];
+ if((mb_strtoupper($element['tag']) == "DC:TITLE" OR mb_strtoupper($element['tag']) == "TITLE")){
+ $summaryObj->title = $element['value'];
}
//@todo handle multiple subject elements
//Subject
- if((mb_strtoupper($element[tag]) == "DC:SUBJECT" OR mb_strtoupper($element[tag]) == "SUBJECT")){
- $summaryObj->subject = $element[value];
+ if((mb_strtoupper($element['tag']) == "DC:SUBJECT" OR mb_strtoupper($element['tag']) == "SUBJECT")){
+ $summaryObj->subject = $element['value'];
}
//Abstract
- if((mb_strtoupper($element[tag]) == "DC:ABSTRACT" OR mb_strtoupper($element[tag]) == "ABSTRACT" OR mb_strtoupper($element[tag]) == "DCT:ABSTRACT")){
- $summaryObj->abstract = $element[value];
+ if((mb_strtoupper($element['tag']) == "DC:ABSTRACT" OR mb_strtoupper($element['tag']) == "ABSTRACT" OR mb_strtoupper($element['tag']) == "DCT:ABSTRACT")){
+ $summaryObj->abstract = $element['value'];
}
//Modified
- if((mb_strtoupper($element[tag]) == "DC:MODIFIED" OR mb_strtoupper($element[tag]) == "MODIFIED")){
- $summaryObj->modified = $element[value];
+ if((mb_strtoupper($element['tag']) == "DC:MODIFIED" OR mb_strtoupper($element['tag']) == "MODIFIED")){
+ $summaryObj->modified = $element['value'];
}
//Type
- if((mb_strtoupper($element[tag]) == "DC:TYPE" OR mb_strtoupper($element[tag]) == "TYPE")){
- $summaryObj->type = $element[value];
+ if((mb_strtoupper($element['tag']) == "DC:TYPE" OR mb_strtoupper($element['tag']) == "TYPE")){
+ $summaryObj->type = $element['value'];
}
//Format
- if((mb_strtoupper($element[tag]) == "DC:FORMAT" OR mb_strtoupper($element[tag]) == "FORMAT")){
- $summaryObj->format = $element[value];
+ if((mb_strtoupper($element['tag']) == "DC:FORMAT" OR mb_strtoupper($element['tag']) == "FORMAT")){
+ $summaryObj->format = $element['value'];
}
- if((mb_strtoupper($element[tag]) == "CSW:SUMMARYRECORD" OR mb_strtoupper($element[tag]) == "SUMMARYRECORD") && $element[type] == "close"){
+ if((mb_strtoupper($element['tag']) == "CSW:SUMMARYRECORD" OR mb_strtoupper($element['tag']) == "SUMMARYRECORD") && $element['type'] == "close"){
//{ush SummaryRecords Object to Array
array_push($this->SummaryRecordsArray,$summaryObj);
}
Modified: trunk/mapbender/http/classes/class_gml2.php
===================================================================
--- trunk/mapbender/http/classes/class_gml2.php 2016-03-04 08:36:12 UTC (rev 9416)
+++ trunk/mapbender/http/classes/class_gml2.php 2016-03-07 13:50:24 UTC (rev 9417)
@@ -238,12 +238,12 @@
xml_parser_free($parser);
foreach ($values as $element) {
- #$e = new mb_exception($element[tag]);
- if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("boundedBy") && $element[type] == "open"){
+ #$e = new mb_exception($element['tag']);
+ if(strtoupper($this->sepNameSpace($element['tag'])) == strtoupper("boundedBy") && $element['type'] == "open"){
$boundedBy = true;
}
if ($boundedBy) {
- if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("box")){
+ if(strtoupper($this->sepNameSpace($element['tag'])) == strtoupper("box")){
$epsgAttr = "";
if(isset($element['attributes'])){
@@ -271,12 +271,12 @@
}
$this->epsg = $epsg;
}
- if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("coordinates")){
- $this->bbox = explode(",", str_replace(",,","",str_replace(" ",",",trim($element[value]))));
+ if(strtoupper($this->sepNameSpace($element['tag'])) == strtoupper("coordinates")){
+ $this->bbox = explode(",", str_replace(",,","",str_replace(" ",",",trim($element['value']))));
$boundedBy=false;
}
}
- if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("featureMember") && $element[type] == "open"){
+ if(strtoupper($this->sepNameSpace($element['tag'])) == strtoupper("featureMember") && $element['type'] == "open"){
$this->member++;
$this->keys[$this->member] = array();
$this->value[$this->member] = array();
@@ -285,24 +285,24 @@
$cnt_geom = 0;
}
if($section == true){
- if( in_array($this->sepNameSpace($element[tag]),$this->geometries) && $element[type] == "open"){
+ if( in_array($this->sepNameSpace($element['tag']),$this->geometries) && $element['type'] == "open"){
$geom = true;
- $this->geomtype[$this->member] = $this->sepNameSpace($element[tag]);
+ $this->geomtype[$this->member] = $this->sepNameSpace($element['tag']);
}
- else if(in_array($this->sepNameSpace($element[tag]),$this->geometries) && $element[type] == "close"){
- $cnt_geom++;
+ else if(in_array($this->sepNameSpace($element['tag']),$this->geometries) && $element['type'] == "close"){
+// $cnt_geom++;
$geom = false;
}
if($geom == true){
- if (strtoupper($this->sepNameSpace($element[tag])) == strtoupper("coordinates")) {
- $this->geometry[$this->member][$cnt_geom] = str_replace(",,","",str_replace(" ",",",trim($element[value])));
+ if (strtoupper($this->sepNameSpace($element['tag'])) == strtoupper("coordinates")) {
+ $this->geometry[$this->member][$cnt_geom] = str_replace(",,","",str_replace(" ",",",trim($element['value'])));
$coordinates = true;
// XXX: Increment counter to get all geometries of a feature member,
// comment it out to only show first geometry of featuremember
$cnt_geom++;
}
- else if (!$coordinates && trim($element[value])) {
- $coords = str_replace(",,","",str_replace(" ",",",trim($element[value])));
+ else if (!$coordinates && trim($element['value'])) {
+ $coords = str_replace(",,","",str_replace(" ",",",trim($element['value'])));
$tmp_array = explode(",", $coords);
if (count($tmp_array > 1)) {
$this->geometry[$this->member][$cnt_geom] = $coords;
@@ -313,14 +313,14 @@
}
}
}
- else if(strtoupper($this->sepNameSpace($element[tag])) == strtoupper("featureMember") && $element[type] == "close"){
+ else if(strtoupper($this->sepNameSpace($element['tag'])) == strtoupper("featureMember") && $element['type'] == "close"){
$section = false;
$el = -1;
}
else{
$el++;
- $this->values[$this->member][$el] = $element[value];
- $this->keys[$this->member][$el] = $element[tag];
+ $this->values[$this->member][$el] = $element['value'];
+ $this->keys[$this->member][$el] = $element['tag'];
}
}
}
Modified: trunk/mapbender/http/classes/class_kml.php
===================================================================
--- trunk/mapbender/http/classes/class_kml.php 2016-03-04 08:36:12 UTC (rev 9416)
+++ trunk/mapbender/http/classes/class_kml.php 2016-03-07 13:50:24 UTC (rev 9417)
@@ -75,50 +75,50 @@
$cnt_styles = -1;
foreach ($values as $element) {
- if(mb_strtoupper($element[tag]) == "KML" && $element[type] == "open"){
+ if(mb_strtoupper($element['tag']) == "KML" && $element['type'] == "open"){
$section = "kml";
}
- if ($section == "kml" && mb_strtoupper($element[tag]) == "PLACEMARK" && $element[type] == "open") {
+ if ($section == "kml" && mb_strtoupper($element['tag']) == "PLACEMARK" && $element['type'] == "open") {
$section = "placemark";
}
- if ($section == "placemark" && mb_strtoupper($element[tag]) == "DESCRIPTION" && $element[type] == "complete") {
- $this->description = $element[value];
+ if ($section == "placemark" && mb_strtoupper($element['tag']) == "DESCRIPTION" && $element['type'] == "complete") {
+ $this->description = $element['value'];
}
- if ($section == "placemark" && mb_strtoupper($element[tag]) == "NAME" && $element[type] == "complete") {
- $this->title = $element[value];
+ if ($section == "placemark" && mb_strtoupper($element['tag']) == "NAME" && $element['type'] == "complete") {
+ $this->title = $element['value'];
}
- if ($section == "placemark" && mb_strtoupper($element[tag]) == "LOOKAT" && $element[type] == "open") {
+ if ($section == "placemark" && mb_strtoupper($element['tag']) == "LOOKAT" && $element['type'] == "open") {
$section = "lookat";
}
if ($section == "lookat") {
- if (mb_strtoupper($element[tag]) == "RANGE" && $element[type] == "complete") {
- $this->lookAt_range = $element[value];
+ if (mb_strtoupper($element['tag']) == "RANGE" && $element['type'] == "complete") {
+ $this->lookAt_range = $element['value'];
}
- if (mb_strtoupper($element[tag]) == "HEADING" && $element[type] == "complete") {
- $this->lookAt_heading = $element[value];
+ if (mb_strtoupper($element['tag']) == "HEADING" && $element['type'] == "complete") {
+ $this->lookAt_heading = $element['value'];
}
- if (mb_strtoupper($element[tag]) == "TILT" && $element[type] == "complete") {
- $this->lookAt_tilt = $element[value];
+ if (mb_strtoupper($element['tag']) == "TILT" && $element['type'] == "complete") {
+ $this->lookAt_tilt = $element['value'];
}
}
- if (mb_strtoupper($element[tag]) == "STYLE" && $element[type] == "open") {
+ if (mb_strtoupper($element['tag']) == "STYLE" && $element['type'] == "open") {
$section = "style";
}
- if ($section == "style" && mb_strtoupper($element[tag]) == "ICONSTYLE" && $element[type] == "open") {
+ if ($section == "style" && mb_strtoupper($element['tag']) == "ICONSTYLE" && $element['type'] == "open") {
$section = "iconstyle";
}
- if ($section == "iconstyle" && mb_strtoupper($element[tag]) == "ICON" && $element[type] == "open") {
+ if ($section == "iconstyle" && mb_strtoupper($element['tag']) == "ICON" && $element['type'] == "open") {
$section = "icon";
}
- if ($section == "icon" && mb_strtoupper($element[tag]) == "HREF" && $element[type] == "complete") {
- $this->icon = $element[value];
+ if ($section == "icon" && mb_strtoupper($element['tag']) == "HREF" && $element['type'] == "complete") {
+ $this->icon = $element['value'];
}
- if (mb_strtoupper($element[tag]) == "POINT" && $element[type] == "open") {
+ if (mb_strtoupper($element['tag']) == "POINT" && $element['type'] == "open") {
$section = "point";
}
- if ($section == "point" && mb_strtoupper($element[tag]) == "COORDINATES" && $element[type] == "complete") {
- $array = explode(",", $element[value]);
+ if ($section == "point" && mb_strtoupper($element['tag']) == "COORDINATES" && $element['type'] == "complete") {
+ $array = explode(",", $element['value']);
$this->x = $array[0];
$this->y = $array[1];
}
Modified: trunk/mapbender/http/classes/class_wfs_deprecated.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_deprecated.php 2016-03-04 08:36:12 UTC (rev 9416)
+++ trunk/mapbender/http/classes/class_wfs_deprecated.php 2016-03-07 13:50:24 UTC (rev 9417)
@@ -92,83 +92,83 @@
foreach ($values as $element) {
- if(strtoupper($element[tag]) == "WFS_CAPABILITIES" && $element[type] == "open"){
- $this->wfs_version = $element[attributes][version];
+ if(strtoupper($element['tag']) == "WFS_CAPABILITIES" && $element['type'] == "open"){
+ $this->wfs_version = $element['attributes'][version];
}
- if(strtoupper($element[tag]) == "NAME" && $element[level] == '3'){
- $this->wfs_name = $element[value];
+ if(strtoupper($element['tag']) == "NAME" && $element[level] == '3'){
+ $this->wfs_name = $element['value'];
}
- if(strtoupper($element[tag]) == "TITLE" && $element[level] == '3'){
- $this->wfs_title = $this->stripEndlineAndCarriageReturn($element[value]);
+ if(strtoupper($element['tag']) == "TITLE" && $element[level] == '3'){
+ $this->wfs_title = $this->stripEndlineAndCarriageReturn($element['value']);
}
- if(strtoupper($element[tag]) == "ABSTRACT" && $element[level] == '3'){
- $this->wfs_abstract = $this->stripEndlineAndCarriageReturn($element[value]);
+ if(strtoupper($element['tag']) == "ABSTRACT" && $element[level] == '3'){
+ $this->wfs_abstract = $this->stripEndlineAndCarriageReturn($element['value']);
}
//new WFS 1.0.0 -- SB 2007-08-06
- if(strtolower($element[tag]) == "fees"){
- $this->fees = $element[value];
+ if(strtolower($element['tag']) == "fees"){
+ $this->fees = $element['value'];
}
- if(strtolower($element[tag]) == "accessconstraints"){
- $this->accessconstraints = $element[value];
+ if(strtolower($element['tag']) == "accessconstraints"){
+ $this->accessconstraints = $element['value'];
}
if($this->wfs_version == "1.0.0"){
# getCapabilities
- if(strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "GETCAPABILITIES" && $element['type'] == "open"){
$section = "getcapabilities";
}
- if($section == "getcapabilities" && strtoupper($element[tag]) == "POST"){
- $this->wfs_getcapabilities = $element[attributes][onlineResource];
+ if($section == "getcapabilities" && strtoupper($element['tag']) == "POST"){
+ $this->wfs_getcapabilities = $element['attributes'][onlineResource];
}
# descriptFeatureType
- if(strtoupper($element[tag]) == "DESCRIBEFEATURETYPE" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "DESCRIBEFEATURETYPE" && $element['type'] == "open"){
$section = "describefeaturetype";
- $this->wfs_describefeaturetype = $element[attributes][onlineResource];
+ $this->wfs_describefeaturetype = $element['attributes'][onlineResource];
}
- if($section == "describefeaturetype" && strtoupper($element[tag]) == "POST"){
- $this->wfs_describefeaturetype = $element[attributes][onlineResource];
+ if($section == "describefeaturetype" && strtoupper($element['tag']) == "POST"){
+ $this->wfs_describefeaturetype = $element['attributes'][onlineResource];
}
# getFeature
- if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "GETFEATURE" && $element['type'] == "open"){
$section = "getfeature";
}
- if($section == "getfeature" && strtoupper($element[tag]) == "POST"){
- $this->wfs_getfeature = $element[attributes][onlineResource];
+ if($section == "getfeature" && strtoupper($element['tag']) == "POST"){
+ $this->wfs_getfeature = $element['attributes'][onlineResource];
}
- if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "close"){
+ if(strtoupper($element['tag']) == "GETFEATURE" && $element['type'] == "close"){
$section = "";
}
# transaction
- if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "TRANSACTION" && $element['type'] == "open"){
$section = "transaction";
}
- if($section == "transaction" && strtoupper($element[tag]) == "POST"){
- $this->wfs_transaction = $element[attributes][onlineResource];
+ if($section == "transaction" && strtoupper($element['tag']) == "POST"){
+ $this->wfs_transaction = $element['attributes'][onlineResource];
}
- if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "close"){
+ if(strtoupper($element['tag']) == "TRANSACTION" && $element['type'] == "close"){
$section = "";
}
}
- if(strtoupper($element[tag]) == "FEATURETYPE" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "FEATURETYPE" && $element['type'] == "open"){
$section = "featuretype";
}
- if($section == "featuretype" && strtoupper($element[tag]) == "NAME"){
- $featuretype_name = $element[value];
+ if($section == "featuretype" && strtoupper($element['tag']) == "NAME"){
+ $featuretype_name = $element['value'];
}
- if($section == "featuretype" && strtoupper($element[tag]) == "TITLE"){
- $featuretype_title = $this->stripEndlineAndCarriageReturn($element[value]);
+ if($section == "featuretype" && strtoupper($element['tag']) == "TITLE"){
+ $featuretype_title = $this->stripEndlineAndCarriageReturn($element['value']);
}
- if($section == "featuretype" && strtoupper($element[tag]) == "ABSTRACT"){
- $featuretype_abstract = $this->$element[value];
+ if($section == "featuretype" && strtoupper($element['tag']) == "ABSTRACT"){
+ $featuretype_abstract = $this->$element['value'];
}
- if($section == "featuretype" && strtoupper($element[tag]) == "SRS"){
- $featuretype_srs = $element[value];
+ if($section == "featuretype" && strtoupper($element['tag']) == "SRS"){
+ $featuretype_srs = $element['value'];
$this->addFeaturetype($featuretype_name,$featuretype_title,$featuretype_abstract,$featuretype_srs,$this->wfs_describefeaturetype,$this->wfs_version);
}
}
@@ -553,24 +553,24 @@
foreach ($values as $element) {
- if(strtoupper($element[tag]) == "WFS_CAPABILITIES" && $element[type] == "open"){
- $this->wfs_version = $element[attributes][version];
+ if(strtoupper($element['tag']) == "WFS_CAPABILITIES" && $element['type'] == "open"){
+ $this->wfs_version = $element['attributes'][version];
}
- if(strtoupper($element[tag]) == "NAME" && $element[level] == '3'){
- $this->wfs_name = $element[value];
+ if(strtoupper($element['tag']) == "NAME" && $element[level] == '3'){
+ $this->wfs_name = $element['value'];
}
-/* if(strtoupper($element[tag]) == "TITLE" && $element[level] == '3'){
- $this->wfs_title = $this->stripEndlineAndCarriageReturn($element[value]);
+/* if(strtoupper($element['tag']) == "TITLE" && $element[level] == '3'){
+ $this->wfs_title = $this->stripEndlineAndCarriageReturn($element['value']);
}
- if(strtoupper($element[tag]) == "ABSTRACT" && $element[level] == '3'){
- $this->wfs_abstract = $this->stripEndlineAndCarriageReturn($element[value]);
+ if(strtoupper($element['tag']) == "ABSTRACT" && $element[level] == '3'){
+ $this->wfs_abstract = $this->stripEndlineAndCarriageReturn($element['value']);
}
//new WFS 1.0.0 -- SB 2007-08-06
- if(strtolower($element[tag]) == "fees"){
- $this->fees = $element[value];
+ if(strtolower($element['tag']) == "fees"){
+ $this->fees = $element['value'];
}
- if(strtolower($element[tag]) == "accessconstraints"){
- $this->accessconstraints = $element[value];
+ if(strtolower($element['tag']) == "accessconstraints"){
+ $this->accessconstraints = $element['value'];
}
*/
/*capability section*/
@@ -578,59 +578,59 @@
if($this->wfs_version == "1.0.0"){
# getCapabilities
- if(strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "GETCAPABILITIES" && $element['type'] == "open"){
$section = "getcapabilities";
}
- if($section == "getcapabilities" && strtoupper($element[tag]) == "POST"){
- $this->wfs_getcapabilities = $element[attributes][onlineResource];
+ if($section == "getcapabilities" && strtoupper($element['tag']) == "POST"){
+ $this->wfs_getcapabilities = $element['attributes'][onlineResource];
}
# descriptFeatureType
- if(strtoupper($element[tag]) == "DESCRIBEFEATURETYPE" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "DESCRIBEFEATURETYPE" && $element['type'] == "open"){
$section = "describefeaturetype";
- $this->wfs_describefeaturetype = $element[attributes][onlineResource];
+ $this->wfs_describefeaturetype = $element['attributes'][onlineResource];
}
- if($section == "describefeaturetype" && strtoupper($element[tag]) == "POST"){
- $this->wfs_describefeaturetype = $element[attributes][onlineResource];
+ if($section == "describefeaturetype" && strtoupper($element['tag']) == "POST"){
+ $this->wfs_describefeaturetype = $element['attributes'][onlineResource];
}
# getFeature
- if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "GETFEATURE" && $element['type'] == "open"){
$section = "getfeature";
}
- if($section == "getfeature" && strtoupper($element[tag]) == "POST"){
- $this->wfs_getfeature = $element[attributes][onlineResource];
+ if($section == "getfeature" && strtoupper($element['tag']) == "POST"){
+ $this->wfs_getfeature = $element['attributes'][onlineResource];
}
- if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "close"){
+ if(strtoupper($element['tag']) == "GETFEATURE" && $element['type'] == "close"){
$section = "";
}
# transaction
- if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "TRANSACTION" && $element['type'] == "open"){
$section = "transaction";
}
- if($section == "transaction" && strtoupper($element[tag]) == "POST"){
- $this->wfs_transaction = $element[attributes][onlineResource];
+ if($section == "transaction" && strtoupper($element['tag']) == "POST"){
+ $this->wfs_transaction = $element['attributes'][onlineResource];
}
- if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "close"){
+ if(strtoupper($element['tag']) == "TRANSACTION" && $element['type'] == "close"){
$section = "";
}
}
- if(strtoupper($element[tag]) == "FEATURETYPE" && $element[type] == "open"){
+ if(strtoupper($element['tag']) == "FEATURETYPE" && $element['type'] == "open"){
$section = "featuretype";
}
- if($section == "featuretype" && strtoupper($element[tag]) == "NAME"){
- $featuretype_name = $element[value];
+ if($section == "featuretype" && strtoupper($element['tag']) == "NAME"){
+ $featuretype_name = $element['value'];
}
- if($section == "featuretype" && strtoupper($element[tag]) == "TITLE"){
- $featuretype_title = $this->stripEndlineAndCarriageReturn($element[value]);
+ if($section == "featuretype" && strtoupper($element['tag']) == "TITLE"){
+ $featuretype_title = $this->stripEndlineAndCarriageReturn($element['value']);
}
- if($section == "featuretype" && strtoupper($element[tag]) == "ABSTRACT"){
- $featuretype_abstract = $this->$element[value];
+ if($section == "featuretype" && strtoupper($element['tag']) == "ABSTRACT"){
+ $featuretype_abstract = $this->$element['value'];
}
- if($section == "featuretype" && strtoupper($element[tag]) == "SRS"){
- $featuretype_srs = $element[value];
+ if($section == "featuretype" && strtoupper($element['tag']) == "SRS"){
+ $featuretype_srs = $element['value'];
$this->addFeaturetype($featuretype_name,$featuretype_title,$featuretype_abstract,$featuretype_srs,$this->wfs_describefeaturetype,$this->wfs_version);
}
}
@@ -775,13 +775,13 @@
xml_parser_free($parser);
foreach ($values as $element) {
- if($this->sepNameSpace($element[tag]) == "schema" && $element[type] == "open"){
+ if($this->sepNameSpace($element['tag']) == "schema" && $element['type'] == "open"){
$section = "namespace";
// echo "namespace<br>";
}
if($section == "namespace"){
- while (list($k, $val) = each ($element[attributes])) {
+ while (list($k, $val) = each ($element['attributes'])) {
if (substr($k, 0, 5) == "xmlns") {
$cnt = count($this->featuretype_namespace);
$match = false;
@@ -798,20 +798,20 @@
}
}
}
- if($this->sepNameSpace($element[tag]) == "complexType" && $element[type] == "open"){
+ if($this->sepNameSpace($element['tag']) == "complexType" && $element['type'] == "open"){
$section = "";
}
- if($this->sepNameSpace($element[tag]) == "complexContent" && $element[type] == "open"){
+ if($this->sepNameSpace($element['tag']) == "complexContent" && $element['type'] == "open"){
$section = "complexcontent";
// echo "complexcontent<br>";
}
- if($section == "complexcontent" && $this->sepNameSpace($element[tag]) == "element" && $element[attributes][name]){
+ if($section == "complexcontent" && $this->sepNameSpace($element['tag']) == "element" && $element['attributes'][name]){
$cnt = count($this->featuretype_element);
- $this->featuretype_element[$cnt]["name"] = $element[attributes]["name"];
- $this->featuretype_element[$cnt]["type"] = $this->sepNameSpace($element[attributes]["type"]);
+ $this->featuretype_element[$cnt]["name"] = $element['attributes']["name"];
+ $this->featuretype_element[$cnt]["type"] = $this->sepNameSpace($element['attributes']["type"]);
// echo "element: ".$this->featuretype_element[$cnt]["name"]."<br>";
}
- if($this->sepNameSpace($element[tag]) == "complexContent" && $element[type] == "close"){
+ if($this->sepNameSpace($element['tag']) == "complexContent" && $element['type'] == "close"){
$section = "";
}
}
More information about the Mapbender_commits
mailing list