Doc #53470 [Opn->Bgs]: other attribute does not exists
| From: | kalle@php.net | Date: | Mon, 20 Dec 2010 01:56:37 +0000 |
| Subject: | Doc #53470 [Opn->Bgs]: other attribute does not exists | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5701@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53470&edit=1
ID: 53470
Updated by: kalle@php.net
Reported by: carlos@php.net
Summary: other attribute does not exists
-Status: Open
+Status: Bogus
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Hi Carlos
The documentation (as of writing) is correct;
For xml_set_start_namespace_decl_handler(), which calls an internal
function in xml.c (_xml_startNamespaceDeclHandler) that actually
performs the call to the PHP userland function, you can see that we
declare a zval *args[3] and pass 3 arguments that we are going to pass
to the userland handler:
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding);
args[2] = _xml_xmlchar_zval(uri, 0, parser->target_encoding);
0 = resource
1 = string (converted from XMLChar)
2 = string (converted from XMLChar)
Same is true for the xml_set_end_namespace_decl_handler() function
except these arguments are passed instead:
args[0] = _xml_resource_zval(parser->index);
args[1] = _xml_xmlchar_zval(prefix, 0, parser->target_encoding);
0 = resource
1 = string (converted from XMLChar)
Previous Comments:
------------------------------------------------------------------------
[2010-12-04 01:06:37] carlos@php.net
Description:
------------
---
From manual page:
http://www.php.net/function.xml-set-end-namespace-decl-handler
---
Hi!
This function has the same problem that
xml_start_namespace_decl_handler, the function does not expects
$user_data. In the explanation appears:
HANDLING.
handler ( resource $parser , string $user_data , string $prefix )
the correct is:
handler ( resource $parser , string $prefix )
and the below box of $user_data is not necessary.
----
I've looked the PHP source code of php-xml in xml.c file, and in line
1157 appears the following:
void _xml_endNamespaceDeclHandler(void *userData, const XML_Char
*prefix)
but I think that "void *userData " in the php function refers to the
$parser attribute, it seems me that is the start of confusion.
Regards :)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53470&edit=1