in reply to use XML::DOM - what to do with empty tags?
# declare lexical variable *outside the scope of the eval* my $BusUrl; # trap potential error eval { $BusUrl = $contact->getElementsByTagName( "BusinessUrl" ); }; # check if tag retrieval failed if($@) { # assign an empty (but defined) string $BusUrl = ''; } $bus_url = $BusUrl->item( 0 )->getChildAtIndex( 0 )->getData();
__________
The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.
- Terry Pratchett
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: use XML::DOM - what to do with empty tags?
by kevyt (Scribe) on Jan 03, 2007 at 16:48 UTC | |
by EvanK (Chaplain) on Jan 03, 2007 at 16:57 UTC |