perl_seeker has asked for the wisdom of the Perl Monks concerning the following question:
Using XML::XPath, I need to build a subroutine that does this:test.xml - <AnnualWeatherRecord> - <DailyWeatherRecord> <date>1-1-2004</date> - <temperature> <maxdrybulb unit="degrees-centigrade" number="33.95" /> <mindrybulb unit="degrees-centigrade" number="30.95" /> <maxwetbulb unit="degrees-centigrade" number="33.53" /> <minwetbulb unit="degrees-centigrade" number="30.53" /> </temperature> <totalrainfall unit="mm" number="0.5" /> </DailyWeatherRecord> - <DailyWeatherRecord> <date>2-1-2004</date> - <temperature> <maxdrybulb unit="degrees-centigrade" number="23.34" /> <mindrybulb unit="degrees-centigrade" number="23.20" /> <maxwetbulb unit="degrees-centigrade" number="23.14" /> <minwetbulb unit="degrees-centigrade" number="20.14" /> </temperature> <totalrainfall unit="mm" number="0" /> </DailyWeatherRecord> - <DailyWeatherRecord> <date>1-2-2004</date> - <temperature> <maxdrybulb unit="degrees-centigrade" number="44.25" /> <mindrybulb unit="degrees-centigrade" number="39.25" /> <maxwetbulb unit="degrees-centigrade" number="33.53" /> <minwetbulb unit="degrees-centigrade" number="30.53" /> </temperature> <totalrainfall unit="mm" number="0.5" /> </DailyWeatherRecord> - <DailyWeatherRecord> <date>2-2-2004</date> - <temperature> <maxdrybulb unit="degrees-centigrade" number="50.25" /> <mindrybulb unit="degrees-centigrade" number="49.25" /> <maxwetbulb unit="degrees-centigrade" number="23.14" /> <minwetbulb unit="degrees-centigrade" number="20.14" /> </temperature> <totalrainfall unit="mm" number="0" /> </DailyWeatherRecord> - <MonthlyWeatherRecord> <date>1-2004</date> - <temperature> <maxdrybulb unit="degrees-centigrade" number="33.95" /> <mindrybulb unit="degrees-centigrade" number="23.20" /> <avgdrybulb unit="degrees-centigrade" number="33.95" /> </temperature> </MonthlyWeatherRecord> - <MonthlyWeatherRecord> <date>2-2004</date> - <temperature> <maxdrybulb unit="degrees-centigrade" number="50.25" /> <mindrybulb unit="degrees-centigrade" number="39.25" /> <avgdrybulb unit="degrees-centigrade" number="44.25" /> </temperature> </MonthlyWeatherRecord> </AnnualWeatherRecord>
I need another subroutine which stores the date and the value of the mindrybulb attribute, but the code would@array[0]=1-1-2004 @array[1]=33.95
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with XML::XPath
by johnnywang (Priest) on Aug 19, 2004 at 07:26 UTC | |
by perl_seeker (Scribe) on Aug 20, 2004 at 04:20 UTC | |
by perl_seeker (Scribe) on Aug 25, 2004 at 05:24 UTC | |
by johnnywang (Priest) on Aug 25, 2004 at 07:32 UTC | |
by perl_seeker (Scribe) on Oct 31, 2004 at 08:36 UTC | |
by perl_seeker (Scribe) on Aug 30, 2004 at 08:06 UTC | |
by Solo (Deacon) on Aug 30, 2004 at 10:43 UTC | |
|
Re: Help with XML::XPath
by murugu (Curate) on Aug 19, 2004 at 10:11 UTC | |
by mirod (Canon) on Aug 19, 2004 at 14:06 UTC | |
|
Re: Help with XML::XPath
by bobf (Monsignor) on Aug 19, 2004 at 07:46 UTC | |
|
Re: Help with XML::XPath
by gmpassos (Priest) on Aug 19, 2004 at 14:18 UTC |