473,763 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Namespace Handler isn't being called

I'm using the XML functions in PHP 5. The callback function I set for
namespace declarations doesn't get called. Can anyone help me out?
The code is:
$xml = '<addressbook
xmlns:ab="http://www.somewhere.c om/addressbook/">' .
'</addressbook>';
$parser = xml_parser_crea te_ns();

xml_set_element _handler( $parser, 'StartHandler', 'EndHandler' );

/* The handler doesn't get called for some reason */
xml_set_start_n amespace_decl_h andler( $parser, 'NSHandler' );

xml_parse( $parser, $xml, true);
xml_parser_free ( $parser );
function StartHandler( $parser, $name, $attrs ) {
print( 'StartHandler Called<br/>' );
}
function EndHandler( $parser, $name ) {
print( 'EndHandler Called<br/>' );
}
function NSHandler( $parser, $prefix, $uri ) {
print( 'NSHandler Called<br/>' );
}
And the output is:

StartHandler Called
EndHandler Called
I want the output to be

StartHandler Called
EndHandler Called
NSHandler Called
Cheers,
Aeden
Jul 17 '05 #1
1 1805
beveled edges wrote:
I'm using the XML functions in PHP 5. The callback function I set for
namespace declarations doesn't get called. Can anyone help me out?


I think this is a bug which is caused by the portation of PHP 4 XML
functions to PHP 5.

On bugs.php.net I have found a simular bug related to the
xml_set_default _handler function.

I took the liberty of using your code snippet to create a bug report for
this problem, see:

http://bugs.php.net/bug.php?id=30061
JW

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1390
by: beveled edges | last post by:
I'm using the XML functions in PHP 5. The callback function I set for namespace declarations doesn't get called. Can anyone help me out? The code is: $xml = '<addressbook xmlns:ab="http://www.somewhere.com/addressbook/">' . '</addressbook>'; $parser = xml_parser_create_ns();
25
3094
by: kj | last post by:
Consider the following XML document: <?xml version='1.0' encoding='UTF-8'?> <bar:foo xmlns:bar='someuri'> <baz/> </bar:foo> What namespace does baz belong to? What is this namespace bound to/associated with? My understanding was that baz above belongs to some "default default namespace", but I have not been able to
6
1698
by: demo | last post by:
using visual studio 6 with service pack 0 and 5, why does the distructor of a class contained inside a namespace isn't called and instead it's called when: - iostream.h is included instead of iostream - "using namespace std;" is commented ? the destructor of a2 (not contained inside the namespace) is always called. this problem seems to afflict only visual studio 6 service pack 0 and 5 and
7
2282
by: Joakim Braun | last post by:
Why doesn't the below code work? I'm trying to create a global object and set an event handler to one of its methods. The function is called, but the object's mTest property is undefined. (What I'm trying to do is make a general-purpose solution for the situation where you have a list box with several associated form elements. When the element values are changed, you want to update the value of the selected list option, and when the...
13
6615
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
2
4825
by: Martin Lapierre | last post by:
How can I remove the default exception handler handler? When adding a custom handler, I can't get rid of the VS.NET unhandled exception dialog. Ex: AppDomain currentDomain = AppDomain.CurrentDomain; currentDomain.UnhandledException += new UnhandledExceptionEventHandler(MyHandler); MyHandler gets called AFTER the default VS.NET unhandled exception handler
3
3157
by: jeff29_b | last post by:
I am having a strange problem on a web form. I have an image button with an OnClick event handler. When I click the image the event isn't being called in the code behind when browsing in firefox. I get the postback but I never have the event called. It works fine in i.e.
1
1848
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST> xml file 2
12
8564
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST>
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.