Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I want to make sure the element is unique before it added to the DOM tree. I am using older XML::LibXML which have getElementsById only(1.5x), so I call the getElementsById (I want to use something newer but I can't):
then I use the defined($elem) to see the elem is defined or not, and it always return false even 2 id is identical. How can I check the $elem is a Element or not?my $elem = $doc->getElementsById($id);
*by the way, the id contains a dot (.), does it matter?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::LibXML question: How can I know there is duplicate element exist?
by Anonymous Monk on Mar 04, 2008 at 17:20 UTC |