<?php
$xml = <<<EOD
<?xml version="1.0" encoding="UTF-8"?>
<gvq:GVQ_Metadata id="dataset_MD" xmlns:updated19115="http://www.geoviqua.org/19115_updates" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gvq="http://www.geoviqua.org/QualityInformationModel/4.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmd19157="http://www.geoviqua.org/gmd19157" xmlns:un="http://www.uncertml.org/2.0" xmlns:qml="http://qualityml.geoviqua.org/1.0" xsi:schemaLocation="http://www.geoviqua.org/QualityInformationModel/4.0 http://schemas.geoviqua.org/GVQ/4.0/GeoViQua_PQM_UQM.xsd http://www.uncertml.org/2.0 http://qualityml.geoviqua.org/schemas/uncertml/2.0/uncertml.xsd http://qualityml.geoviqua.org/1.0 http://qualityml.geoviqua.org/schemas/qualityml/1.0/qualityml.xsd">
<gmd:fileIdentifier>
<gco:CharacterString>mtri2an1ib</gco:CharacterString>
</gmd:fileIdentifier>
</gvq:GVQ_Metadata>
EOD;
$dom = new DOMDocument;
$dom->loadXML($xml);
// get all the namespaces in the document
$sxe = new SimpleXMLElement($xml);
$ns = $sxe->getDocNamespaces(TRUE);
// create an xpath object and register the namespaces
$xpath = new DOMXpath($dom);
foreach ($ns as $prefix => $uri) {
$xpath->registerNamespace($prefix, $uri);
}
foreach ($xpath->query("//gmd:fileIdentifier/gco:CharacterString") as $element) {
$element->nodeValue = "something";
}
echo $dom->saveXML();
?>
- Output for 5.1.2 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- <?xml version="1.0" encoding="UTF-8"?>
<gvq:GVQ_Metadata xmlns:updated19115="http://www.geoviqua.org/19115_updates" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gvq="http://www.geoviqua.org/QualityInformationModel/4.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmd19157="http://www.geoviqua.org/gmd19157" xmlns:un="http://www.uncertml.org/2.0" xmlns:qml="http://qualityml.geoviqua.org/1.0" id="dataset_MD" xsi:schemaLocation="http://www.geoviqua.org/QualityInformationModel/4.0 http://schemas.geoviqua.org/GVQ/4.0/GeoViQua_PQM_UQM.xsd http://www.uncertml.org/2.0 http://qualityml.geoviqua.org/schemas/uncertml/2.0/uncertml.xsd http://qualityml.geoviqua.org/1.0 http://qualityml.geoviqua.org/schemas/qualityml/1.0/qualityml.xsd">
<gmd:fileIdentifier>
<gco:CharacterString>something</gco:CharacterString>
</gmd:fileIdentifier>
</gvq:GVQ_Metadata>
- Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.1
- Fatal error: Call to undefined method SimpleXMLElement::getDocNamespaces() in /in/nfhnb on line 16
Process exited with code 255. - Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.1, 4.4.3 - 4.4.9
- Fatal error: Cannot instantiate non-existent class: domdocument in /in/nfhnb on line 11
Process exited with code 255. - Output for 4.4.2
- Fatal error: Cannot instantiate non-existent class: domdocument in /in/nfhnb on line 12
Process exited with code 255. - Output for 4.3.0 - 4.3.1
- Fatal error: Cannot instantiate non-existent class: domdocument in /in/nfhnb on line 11
preferences:
312.18 ms | 401 KiB | 457 Q