Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^4: Perl XML::Smart Out of memory! error

by nasaa (Novice)
on Apr 29, 2014 at 00:20 UTC ( #1084218=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl XML::Smart Out of memory! error
in thread Perl XML::Smart Out of memory! error

lol.. its 2 am here.. your joke cracked me up..:) thank you.. my question is how do i get the script to ignore where the tags are not present.been looking at the xml and in cases the discription or another tag is not present.I want the script to carry on and ignore mising tags..
  • Comment on Re^4: Perl XML::Smart Out of memory! error

Replies are listed 'Best First'.
Re^5: Perl XML::Smart Out of memory! error
by nasaa (Novice) on Apr 29, 2014 at 00:33 UTC
    opps.. shoudl have been bit clear in previous post. if tag is missing then $f[3] = eval { $elt->first_child('Description[@langid="1"]')->att('Value'); }; Works.But if tags are not closed properly like
    <Category ID="1" LowPic="" Score="0" Searchable="0" ThumbPic="" UNCA +TID="" Visible="0"> <Name ID="0" Value="" langid="1"/> <ParentCategory ID="1"/> </Category>
    then i get an error..If i delete this .then it works.Otherwose it throws an error as mentioned earlier.
      Well, you could also eval { $sth->execute(@f); }; </c> that way if @f is missing stuff that just has to be there, like langid, you can ignore the raised error (eval catches it)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1084218]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2019-10-22 22:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?