[Melbourne-pm] XML::Xerces

leif.eriksen at hpa.com.au leif.eriksen at hpa.com.au
Sun Sep 10 17:31:52 PDT 2006

Well done - so it works but code and tests are out of sync ? Taking the tests to be the 'spec', the code needs to be patched.

Until then, just make sure you wrap the code that dies in evals.

Given that your working with X::X 2.7.0 and that came out in March, you may have a hope of getting this looked at by the developers (then again that’s the first new code for 2 years) - especially if you can come up with a patch to the perl (XS code I guess) to handle the exception.


-----Original Message-----
From: melbourne-pm at mjch.net [mailto:melbourne-pm at mjch.net] 
Sent: Monday, 11 September 2006 10:19 AM
To: melbourne-pm at pm.org
Subject: [Melbourne-pm] XML::Xerces

Over the weekend I had another look at getting XML::Xerces running on this Solaris machine.  I went back to using gcc to compile both the xerces-c library and the SWIG wrapper for it and again came across the missing requirement for -lCrun at link time.

After poking around a bit I discovered that libCrun is only used by the Sun compiler and was not used by gcc at all ... so, after a small Makefile edit I was able to cleanly compile the C++ portion of XML::Xerces and begin testing ... 

Unfortunately I haven't managed to get it to pass the bundled tests yet.

It seems that any time the xerces-c library needs to raise an exception triggered by bad input (as tested for in the test suite) it will throw an exception that the Perl portion of the code doesn't catch properly and dies with a fatal error.  For example:

|ok 1 - module loaded
|ok 2 - importing a child from a different document terminate called 
|after throwing an instance of 'xercesc_2_7::DOMException'
|        Test returned status 0 (wstat 134, 0x86) DIED. FAILED tests 
|        Failed 9/11 tests, 18.18% okay

The code which produces the above fatal error looks like:

|# check that creating an element with an illegal charater eval {
|  my $el = $doc1->createElement('?');
|my $error = $@;
|ok($error,'creating document with illegal raises exception');

I went through the test suite and commented out instances of these errors to make sure that any following tests which might still pass were run, however there weren't many ...

Malcolm Herbert                                This brain intentionally
mjch at mjch.net                                                left blank
Melbourne-pm mailing list
Melbourne-pm at pm.org

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 8/09/2006

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.2/442 - Release Date: 8/09/2006
The contents of this e-mail and its attachments are confidential and intended
solely for the use of the individual or entity to whom they are addressed.  If
you received this e-mail in error, please notify the HPA Postmaster, postmaster at hpa.com.au,
then delete  the e-mail.
This footnote also confirms that this e-mail message has been swept for the
presence of computer viruses by Ironport. Before opening or using any
attachments, check them for viruses and defects.
Our liability is limited to resupplying any affected attachments.
HPA collects personal information to provide and market our services. For more
information about use, disclosure and access see our Privacy Policy at

More information about the Melbourne-pm mailing list