Hi,

I'm writing a program, and in this program I would like to find out if a
node has attributes (and if so: which?).
However, I'm running into two strange problems. 

In order to correctly test for, and retrieve, a node's attributes, I
figured it would make sense to first use "hasAttributes()" to check if
the node has any attributes at all. However, when I call the
"hasAttributes" function on a DOM_Node, my program dies with the error
"Can't locate auto/XML/Xerces/DOM_Element/hasAttribut.al in @INC ..."
(and no: I did not misspell the call to "hasAttributes()").

I then reckoned that I could (as a hack around this problem) just call
the "getAttributes" attributes function, and only try to retrieve the
node's attributes if this delivers a defined value to me (as in: "if
(defined($node->getAttributes())) { ...").
However, this doesn't work quite as expected too. It works fine for some
nodes (e.g. nodes of the type ELEMENT_NODE), but the program core dumps
on other node types (the node on which the program crashes is of a
"TEXT_NODE" type - could it be that that has something to do with the
problems?). If I instruct the program to print the results of the call
to getAttributes (via "$node->getAttributes()") to screen, I see that
the result of this call for the node on which the program crashes is
"XML::Xerces::DOM_NamedNodeMap=HASH(0x84a5e1c)" (which looks okay to
me). However, if I then try to get the number of attributes (via
"$node->getAttributes()->getLength()") the program dumps a core.


What is going wrong? Is this a bug in Xerces-P?
I'm running Xerces-C and Xerces-P version 1.5.2 on a RedHat 6.2 machine.
The Perl version is 5.6.1.

Regards,

Bjorn Hermans.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to