How can I debug the source code of this error in XML :: GDOME?

I am using GDOME.pm and in my script I have this line:

my $doc = XML::GDOME->createDocument("","","");

      

I can't for the life of me figure out why it comes out with this error:

NAMESPACE_ERR at /usr/lib/perl5/site_perl/5.6.1/i586-linux/XML/GDOME.pm line 103.

      

which basically points to:

sub createDocument {
  my $class = shift;
  return $di->createDocument(@_); ## it points to this LINE!!
}

      

Is there some tool or something that will let me know more about which namespaces are actually causing this error?

In the meantime, my solution goes along the lines of my forehead, encountering the keyboard, but that doesn't seem to work, except for the headache and random shapes appearing on my forehead.

thanks ~ Steve

+1


source to share


3 answers


The documentation says:

$doc = XML::GDOME->createDocument( $nsURI, $name, $dtd );

      

Creates a new XML document. It will be in the $ nsURI namespace if $ nsURI and its document element are named $ name.



Now your example uses ""

for namespace. It is not the same as undefined, it is an empty string and it is defined. He complains that an empty string is not a valid namespace. Use instead undef

:

my $doc = XML::GDOME->createDocument(undef,"","");

      

+1


source


The XML :: GDOME :: DOMImplementation :: createDocument that is called is a C subroutine, so errors encountered in it are reported as if from the line of Perl code that called it. This error will be triggered by gdome_di_createDocument error code 14.

I don't get the error:



 perl -we'use XML::GDOME; XML::GDOME->createDocument("","","")'

      

You can try passing undef instead of ""; it converts undef to NULL when gdome_di_createDocument is called.

0


source


Ok when i try

my $doc = XML::GDOME->createDocument(undef,"","");

      

Now I am getting this warning. what do they mean?

** CRITICAL **: file gdome-xml-element.c: line 235 (gdome_xml_el_setAttribute): assertion `value != NULL' failed.

** CRITICAL **: file gdome-xml-element.c: line 235 (gdome_xml_el_setAttribute): assertion `value != NULL' failed.

** CRITICAL **: file gdome-xml-element.c: line 235 (gdome_xml_el_setAttribute): assertion `value != NULL' failed.

      

and it's weird that namespace_err seems to have been resolved, but it's weird because I have other functions previously that have a createDocument ("," "," ") line and it works fine.

is there a particular cause or trigger that I may have misunderstood that caused the error to fire?

0


source







All Articles