> "Bjorn Hermans" <[EMAIL PROTECTED]> writes: > > > 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()"). > > Hi Bjorn, > > As far as I can tell there is no method hasAttributes(), > where did you find it documented?
It's in the Xerces-C API documentation (http://xml.apache.org/xerces-c/apiDocs/class_DOM_Element.html#a19). Hmmm, could it be then that this method is in Xerces-C but has not been made available in Xerces-P? [...] > Here's from the documentation: > > Gets a NamedNodeMap containing the attributes of this node (if it is > an Element) or null otherwise. > > Only elements can have attributes. > > I would consider this a failing of the Perl API, > getAttributes() should return undef if Xerces-C returns NULL. This was indeed what I expected to happen. > I'll put this on the TODO list. Cool! > In the meantime, check the node type, and only call it for elements. Yes, I'd already added this check to my code and it works fine now. > Thanks for finding this, Thank you for your quick reply. Regards, Bjorn Hermans. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
