Error loading xml in php (not absolute)

hutterite

New Member
I am trying tom load an XML document with multiple namespace declarationsMy php is:\[code\]<?php $doc = new DOMDocument('1.0','UTF-8'); $doc->load( 'UBLCatalog.xml' ); $Items = $doc->getElementsByTagNameNS( "UBLCommonAggregateComponents","Item" ); foreach( $Items as $Item ) { $descriptions = $Item->getElementsByTagNameNS( "UBLCommonBasicComponents","Description" ); $description = $descriptions->item(0)->nodeValue; echo "<b>$description\n</b><br>"; } ?> \[/code\]The error is:\[quote\] xmlns: URI UBLCatalogDocument is not absolute in file:///C:/wamp/www/XMLExperiments/UBLCatalog.xml,\[/quote\]I am getting output, but the error is annoying.The verbatim error is: Notice: DOMDocument::load() [domdocument.load]: xmlns: URI UBLCatalogDocument is not absolute in file:///C:/wamp/www/XMLExperiments/UBLCatalog.xml, line: 4 in C:\wamp\www\XMLExperiments\ItemsXml.php on line 3And, if I remove the default namespace (xmlns="UBLCatalogDocument") the error goes away
 
Back
Top