|
|
@@ -1377,15 +1377,14 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
|
|
|
// <xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://webgis.regione.sardegna.it:80/geoserver/schemas/gml/2.1.2/feature.xsd"/>
|
|
|
// <xsd:element name="{type}" substitutionGroup="gml:_Feature" type="dbu:{typeName}"/>
|
|
|
|
|
|
+ $nsMap = Api_WfsNs::getNsList();// uri => prefix
|
|
|
+
|
|
|
$dom = new DOMDocument('1.0', 'utf-8');
|
|
|
$dom->formatOutput = true;
|
|
|
$dom->preserveWhiteSpace = false;
|
|
|
$rootNode = $dom->createElementNS('http://www.w3.org/2001/XMLSchema', 'xsd:schema');
|
|
|
$dom->appendChild($rootNode);
|
|
|
$rootNode->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:gml', 'http://www.opengis.net/gml');
|
|
|
- foreach (Api_WfsNs::getNsList() as $uri => $prefix) {
|
|
|
- $rootNode->setAttributeNS('http://www.w3.org/2000/xmlns/', "xmlns:{$prefix}", $uri);
|
|
|
- }
|
|
|
$rootNode->setAttribute('elementFormDefault', 'qualified');
|
|
|
// $rootNode->setAttribute('targetNamespace', Api_WfsNs::getNsUri('p5_default_db'));// TODO:? what targetNamespace if showing types from p5_objects and p5_default_db
|
|
|
{// <xsd:import namespace="http://www.opengis.net/gml" schemaLocation="...../gml/2.1.2/feature.xsd"/>
|
|
|
@@ -1401,7 +1400,11 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
|
|
|
|
|
|
$typeName = "{$nsPrefix}:{$type}";
|
|
|
$acl = $this->getAclFromTypeName($typeName);
|
|
|
- $rootNode->setAttribute('targetNamespace', Api_WfsNs::getNsUri($acl->getSourceName()));
|
|
|
+ {// xmlns and targetNamespace for root element
|
|
|
+ $aclNamespace = Api_WfsNs::getNsUri($acl->getSourceName());
|
|
|
+ $rootNode->setAttribute('targetNamespace', $aclNamespace);
|
|
|
+ if (!array_key_exists($aclNamespace, $nsMap)) $nsMap[$aclNamespace] = $nsPrefix;
|
|
|
+ }
|
|
|
$typeName = $type . 'Type';
|
|
|
$fldList = $this->_getFieldListFromAcl($acl);
|
|
|
DBG::_('DBG_XSD', '>1', "field list", $fldList, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
@@ -1540,6 +1543,10 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ foreach ($nsMap as $uri => $prefix) {
|
|
|
+ $rootNode->setAttributeNS('http://www.w3.org/2000/xmlns/', "xmlns:{$prefix}", $uri);
|
|
|
+ }
|
|
|
+
|
|
|
return $dom->saveXML();
|
|
|
}
|
|
|
|