From: mike at skew dot org Operating system: FreeBSD 8.4-RELEASE PHP version: 5.4.17 Package: DOM XML related Bug Type: Feature/Change Request Bug description:baseURI should always be a real URI
Description: ------------ As I noted in Request #65364, when loading an XML document from memory (string, file, whatever), such as via DOMDocument::loadXml(), PHP tells libxml to use a particular default value as the base URI, and this value is then exposed through the baseURI property in the DOM. It's quite possible that the XML has been cached or otherwise came from somewhere that's known, and the app will want to use a particular URL as the base URI at parse time. It would be nice, then, when the app does get around to parsing, for it to see the same baseURI properties as if DOMDocument::load() had been used with the original URL. So, regardless of what the default base URI is, PHP should provide a way to override it at parse time. I suggest allowing loadXml() to take another argument: a string for the base URI. This will help with using the baseURI property for what is ostensibly its purpose: resolving relative URI references in the document, such as href values in XHTML documents and Atom feeds. -- Edit bug report at https://bugs.php.net/bug.php?id=65365&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65365&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65365&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65365&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65365&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65365&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65365&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65365&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65365&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65365&r=support Expected behavior: https://bugs.php.net/fix.php?id=65365&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65365&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65365&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65365&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65365&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65365&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65365&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65365&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65365&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65365&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65365&r=mysqlcfg