Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: How to return two and more values by parsing XML with XML::Rules?

by Anonymous Monk
on Nov 06, 2012 at 11:45 UTC ( #1002457=note: print w/ replies, xml ) Need Help??


in reply to Re^4: How to return two and more values by parsing XML with XML::Rules?
in thread How to return two and more values by parsing XML with XML::Rules?

My main problem however ist that I need to represent the LK-Keys at the same hierarchy level as the AM-Keys.

Your updated output doesn't show that. Only AM04 is found in your sample data.

Anyway, see Re: How to return two and more values by parsing XML with XML::Rules?, save the key callback

my $amlk = sub { print $_->xpath, "\n"; push @amk, $_->trimmed_text; };

Then register some twig_handlers

'AM_Key' => $amlk, 'LK_Key' => $amlk,


Comment on Re^5: How to return two and more values by parsing XML with XML::Rules?
Select or Download Code
Re^6: How to return two and more values by parsing XML with XML::Rules?
by vagabonding electron (Hermit) on Nov 06, 2012 at 12:06 UTC
    Your updated output doesn't show that.
    I am getting old ...
    I used your code with XML::Twig for LK_Keys Re^2: How to return two and more values by parsing XML with XML::Rules? but your recent proposal with the callback is of course much better and also shows that I have to learn much much more ...
    It is furthermore still the question for me what module should I use as a main option by parsing the data related xml-files?
    Thank you very much again!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2015-07-04 18:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls