Sherlock has asked for the wisdom of the Perl Monks concerning the following question:
What I'd like to accompish is to read this file in (possibly into a single scalar, for simplicity) and remove all <DAY> nodes with a "DATE" attribute prior to a specific date, such as the current date.<SCHEDULE> <DAY DATE="4/21/2001"> <APPT> <START>10:00</START> <STOP>11:00</STOP> </APPT> <APPT> <START>12:00</START> <STOP>13:30</STOP> </APPT> </DAY> <DAY> ... </DAY> ... </CALENDAR>
This is where I'm having trouble. Can I use some sort of regex to pull this off or is there possibly another, simpler way of accomplishing this.$xmlDoc =~ s/<DATE DAY="(Everything less than today)"...</DATE>//g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Will regex work here?
by strredwolf (Chaplain) on Apr 25, 2001 at 00:27 UTC | |
by Sherlock (Deacon) on Apr 25, 2001 at 00:31 UTC | |
|
Re: Will regex work here?
by chorg (Monk) on Apr 25, 2001 at 00:43 UTC | |
by Sherlock (Deacon) on Apr 25, 2001 at 00:52 UTC | |
|
Re: Will regex work here?
by aardvark (Pilgrim) on Apr 25, 2001 at 02:04 UTC | |
|
Re: Will regex work here?
by mlong (Sexton) on Apr 25, 2001 at 03:51 UTC |