[Mapbender-commits] r8516 - trunk/metador/mapbender/http/MeTaDor
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Nov 29 01:04:41 PST 2012
Author: apour
Date: 2012-11-29 01:04:40 -0800 (Thu, 29 Nov 2012)
New Revision: 8516
Modified:
trunk/metador/mapbender/http/MeTaDor/class_MdMetadataXml.php
Log:
Valid ISO-XML bugfix.
Modified: trunk/metador/mapbender/http/MeTaDor/class_MdMetadataXml.php
===================================================================
--- trunk/metador/mapbender/http/MeTaDor/class_MdMetadataXml.php 2012-11-28 16:28:44 UTC (rev 8515)
+++ trunk/metador/mapbender/http/MeTaDor/class_MdMetadataXml.php 2012-11-29 09:04:40 UTC (rev 8516)
@@ -498,6 +498,59 @@
*/
public function __toString () {
+ // ISO bugfix - start
+ $array = array(
+ 'gmd:fileIdentifier' => array(),
+ 'gmd:language' => array(),
+ 'gmd:characterSet' => array(),
+ 'gmd:parentIdentifier' => array(),
+ 'gmd:hierarchyLevel' => array(),
+ 'gmd:hierarchyLevelName' => array(),
+ 'gmd:contact' => array(),
+ 'gmd:dateStamp' => array(),
+ 'gmd:metadataStandardName' => array(),
+ 'gmd:metadataStandardVersion' => array(),
+ 'gmd:dataSetURI' => array(),
+ 'gmd:locale' => array(),
+ 'gmd:spatialRepresentationInfo' => array(),
+ 'gmd:referenceSystemInfo' => array(),
+ 'gmd:metadataExtensionInfo' => array(),
+ 'gmd:identificationInfo' => array(),
+ 'gmd:contentInfo' => array(),
+ 'gmd:distributionInfo' => array(),
+ 'gmd:dataQualityInfo' => array(),
+ 'gmd:portrayalCatalogueInfo' => array(),
+ 'gmd:metadataConstraints' => array(),
+ 'gmd:applicationSchemaInfo' => array(),
+ 'gmd:metadataMaintenance' => array(),
+ 'gmd:series' => array(),
+ 'gmd:describes' => array(),
+ 'gmd:propertyType' => array(),
+ 'gmd:featureType' => array(),
+ 'gmd:featureAttribute' => array(),
+ );
+
+ $tmpNode = $this->doc->documentElement;
+
+ $xpath = new DOMXpath($this->doc);
+ $elements = $xpath->query("*");
+
+ // Elemente merken und aus dem Dokument löschen.
+ foreach ($elements as $element) {
+ $array[$element->nodeName][] = $element;
+ $tmpNode->removeChild($element);
+ }
+
+ // Elemente wieder richtig in das Dokument einbauen.
+ foreach ($array as $key => $val) {
+ if(!empty($val)) {
+ foreach ($val as $element) {
+ $tmpNode->appendChild($element);
+ }
+ }
+ }
+ // ISO bugfix - end
+
return $this->doc->saveXML();
}
More information about the Mapbender_commits
mailing list