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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mc at genetech dot co dot za
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC