in reply to Re: XML::Twig Help
in thread XML::Twig Help
Usually, instead of writing $elt->first_child('USERNAME' )->text(), I write $elt->field( 'USERNAME'), it is easier to read. It also doesn't die if there is no USERNAME child, which may be convenient.
Oh, and xmltwig.com is down at the moment, but it's mirrored at mirod.org.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: XML::Twig Help
by toolic (Bishop) on Jan 07, 2011 at 14:42 UTC | |
On another topic, you probably didn't see my update regarding access to your excellent website. Were you aware that it has been tough to get to for some time now? | [reply] [d/l] |
by onegative (Scribe) on Jan 07, 2011 at 17:08 UTC | |
OK, that seems to help me understand handlers better but what about situations where the xml tag has multiple children of the same name? When attempting to use the handler as below I only get the first TYPE element. i.e.
| [reply] [d/l] |
by toolic (Bishop) on Jan 07, 2011 at 17:19 UTC | |
Use warnings too. | [reply] [d/l] |
by onegative (Scribe) on Jan 10, 2011 at 21:31 UTC | |
I wanted to thank everyone for the suggestions and I seem to be on my way using this module but I am stuck on one final extraction component and not sure exactly what I am doing wrong. Below is a sample of the xml and the small snipnet of code I am trying to utilize. But No Joy! I would appreciate one final example to help me get over this last hump and I think I will be ok if I could just understand how to walk down the twig just a few elements and then be able to understand the proper way to get further down the twig. Again many thanks in advance.
I must be on the right track because it does in fact return the first branch as expected. $VAR1 = 'ORACLE_CAPACITY~atecq~CursorsLeft~CONSUMER'; | [reply] [d/l] |
by toolic (Bishop) on Jan 10, 2011 at 21:46 UTC | |
to: Output: Side note: Typically, you would pass a reference to Data::Dumper:
Side note: use "readmore" tags for large code samples: Writeup Formatting Tips | [reply] [d/l] [select] |
by onegative (Scribe) on Jan 10, 2011 at 21:51 UTC | |