Re: reversing html
- From: Aric Bills <aric.bills@xxxxxxxxx>
- Date: Fri, 28 Sep 2007 23:17:45 -0000
Here's a solution off the top of my head. It can probably be made
more elegant, but it will do the job.
package require tdom
set file [open $inputfile r]
# fconfigure $file as necessary
set doc [dom parse -html -channel $file]
close $file
foreach row [$doc selectNodes {//tr}] {
set children [$row childNodes]
foreach child $children {
$row removeChild $child
}
foreach child [lreverse $children] {
$row appendChild $child
}
}
set file [open $outputfile w]
# fconfigure $file as necessary
puts $file [$doc asHTML]
close $file
.
- Follow-Ups:
- Re: reversing html
- From: Aric Bills
- Re: reversing html
- References:
- reversing html
- From: yahalom
- reversing html
- Prev by Date: Re: How to create an Captcha with TclMagick?
- Next by Date: Re: reversing html
- Previous by thread: reversing html
- Next by thread: Re: reversing html
- Index(es):