Re: xml question for xml::twig

2008-11-19 Thread Rob Dixon
Richard Lee wrote: > Richard Lee wrote: >>> I think I made a mistake .. this is now working... >>> >>> >> V="baz">1000yes50no>> >>> value="disabled"/>>> country="Russia" id="kingtony">>> value="none"/>>> value="ohio_usa">>> >>> active="true" country="japan" id="queensarah">>> type="dictator"/>>

Re: xml question for xml::twig

2008-11-16 Thread Richard Lee
Richard Lee wrote: I think I made a mistake .. this is now working... V="baz">1000yes50novalue="disabled"/>country="Russia" id="kingtony">value="none"/>value="ohio_usa">active="true" country="japan" id="queensarah">type="dictator"/>value="none"/>value="ca_usa"/>marriage="no"/> Now, I just nee

Re: xml question for xml::twig

2008-11-16 Thread Richard Lee
Richard Lee wrote: Richard Lee wrote: Chas. Owens wrote: my $sabal = new XML::Twig( twig_roots => { 'foo/yahoo' => #'[EMAIL PROTECTED]"kingtony"]' => sub { my ($yabal, $elemen

Re: xml question for xml::twig

2008-11-15 Thread Richard Lee
Richard Lee wrote: Chas. Owens wrote: my $sabal = new XML::Twig( twig_roots => { 'foo/yahoo' => #'[EMAIL PROTECTED]"kingtony"]' => sub { my ($yabal, $element ) = @_;

Re: xml question for xml::twig

2008-11-15 Thread Richard Lee
Chas. Owens wrote: Perhaps I am dense, but what is the desired output from the given XML? Hello Chas, From xml file, based on attribute value for bayking id, I want to find kingtony and then I want to traverse back up to yahoo and print everything from to I have tried to use xpath

Re: xml question for xml::twig

2008-11-15 Thread Chas. Owens
On Sat, Nov 15, 2008 at 23:18, Richard Lee <[EMAIL PROTECTED]> wrote: > Richard Lee wrote: >> >> Chas. Owens wrote: >>> >>> On Sat, Nov 15, 2008 at 16:27, Richard Lee <[EMAIL PROTECTED]> wrote: >>> snip >>> if ( $bay1->att('id' eq 'kingtony' ) ) { >>> >>> snip >>> >>> I thi

Re: xml question for xml::twig

2008-11-15 Thread Richard Lee
Richard Lee wrote: Chas. Owens wrote: On Sat, Nov 15, 2008 at 16:27, Richard Lee <[EMAIL PROTECTED]> wrote: snip if ( $bay1->att('id' eq 'kingtony' ) ) { snip I think you mean to say if ($bay1->att("id") eq "kingtony") { yes, that was a typo... I changed to my $sabal

Re: xml question for xml::twig

2008-11-15 Thread Richard Lee
Chas. Owens wrote: On Sat, Nov 15, 2008 at 16:27, Richard Lee <[EMAIL PROTECTED]> wrote: snip if ( $bay1->att('id' eq 'kingtony' ) ) { snip I think you mean to say if ($bay1->att("id") eq "kingtony") { yes, that was a typo... -- To unsubscribe, e-mail: [EMAIL PROTECTE

Re: xml question for xml::twig

2008-11-15 Thread Chas. Owens
On Sat, Nov 15, 2008 at 16:27, Richard Lee <[EMAIL PROTECTED]> wrote: snip >if ( $bay1->att('id' eq 'kingtony' ) ) { snip I think you mean to say if ($bay1->att("id") eq "kingtony") { -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read.

Re: xml question for xml::twig

2008-11-15 Thread Richard Lee
use strict; use warnings; use XML::Twig; my $xml = < 1 yes 10 no emmigrate="no">

xml question for xml::twig

2008-11-15 Thread Richard Lee
Hello, I am praticing below XML file. Based on where I find att id for bayking id 'kingtony' , I wanted to print out the entire element/att(and ID) and any text found from to .(exception of bayqueen_list and its descendatns)... I am having problem just print out one value... can someone take