Просмотр исходного кода

fixed p5:namespace for elements in wfs describe

Piotr Labudda 9 лет назад
Родитель
Сommit
19c8444065
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      SE/se-lib/Api/WfsServerBase.php

+ 6 - 1
SE/se-lib/Api/WfsServerBase.php

@@ -1507,7 +1507,12 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
 						$rootNode->appendChild($elNode);
 						$rootNode->appendChild($elNode);
 						$elNode->setAttribute('name', $ssName);
 						$elNode->setAttribute('name', $ssName);
 						$elNode->setAttribute('type', "{$tnsPrefix}:{$ssName}Type");
 						$elNode->setAttribute('type', "{$tnsPrefix}:{$ssName}Type");
-						if (!$simple) $elNode->setAttributeNS($rootWfsNsUri, "{$rootWfsNs}:namespace", $aclNamespaceUri);
+						if (!$simple) {
+							if (!empty($schema['@namespace'])) {// TODO: @namespace is required?
+								list($nsUri, $prefix, $name) = Api_WfsNs::parseObjectNsUri($schema['@namespace']);
+								$elNode->setAttributeNS($rootWfsNsUri, "{$rootWfsNs}:namespace", '{' . $nsUri . '}' . $name);
+							}
+						}
 					}
 					}
 				}
 				}