php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27565 DomXml ignoring namespace
Submitted: 2004-03-11 06:35 UTC Modified: 2004-03-11 11:01 UTC
From: andrew dot price at boxuk dot com Assigned:
Status: Wont fix Package: DOM XML related
PHP Version: 4.3.4 OS: Red Hat Enterprise Linux ES rel3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
37 + 47 = ?
Subscribe to this entry?

 
 [2004-03-11 06:35 UTC] andrew dot price at boxuk dot com
Description:
------------
PHP is ignoring reference to namespaces when using DOM XML functions.

Reproduce code:
---------------
$oXsl = domxml_open_file("test.xsl");

$ctx=xpath_new_context($oXsl); 
$ctx->xpath_register_ns("xsl","http://www.w3.org/1999/XSL/Transform");
$aoIncludeNodes = $oXsl->get_elements_by_tagname("xsl:include",$ctx);

print_r($aoIncludeNodes);

Expected result:
----------------
Should produce array of all <xsl:include> nodes in the XSL.
This works OK on PHP4.3.2 on Windows.

Actual result:
--------------
Empty array returned but will work if following line is used instead:

$aoIncludeNodes = $oXsl->get_elements_by_tagname("include",$ctx);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-11 11:01 UTC] chregu@php.net
use the xpath functions. they do support namespaces.

get_elements_by_tagname doesn't. This is fixed in PHP5, 
btw.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC