php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29655 dom_import_simplexml() doesn't behave as expected
Submitted: 2004-08-13 17:06 UTC Modified: 2004-08-13 18:05 UTC
From: mc at genetech dot co dot za Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.0.1 OS: Windows XP SP1
Private report: No CVE-ID: None
 [2004-08-13 17:06 UTC] mc at genetech dot co dot za
Description:
------------
dom_import_simplexml() as described in the following document:
http://www.zend.com/php5/articles/php5-xmlphp.php#Heading16,
is meant to return a DOMDocument, but instead returns a DOMElement.

Reproduce code:
---------------
<?php
$xml_file = "moo.xml";
$schema_file = "boo.xsd";

$src = simplexml_load_file($xml_file);            
$dom = dom_import_simplexml($src);               
$dom->schemaValidate($schema_file);
?>


Expected result:
----------------
A validation message based on the XML schema file and the XML instance file.

Actual result:
--------------
Output: Fatal error: Call to undefined method DOMElement::schemaValidate() 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-13 18:05 UTC] rrichards@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

it returns the current simplexml node as a domelement
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC