i'm trying to create a script which reads xml data..
now there's a tag <category> in the xml file but it's something like:
<category domain="http://www.test.be/view.php?sub=4">Album</category>
i would want to retrieve the word Album, the text between the tags
when i use:
Code: Select all
set count 0
set item 0
foreach line [split $data \n] {
regsub -all "\\&" $line "\\\\&" line
if {[regexp "<item>" $line]} { set item 1 }
if {[regexp "</item>" $line]} { set item 0 }
if {$item == 1} {
regexp "<title>(.*)</title>" $line trash zvdata(title,$count)
regexp "<category domain=(.*)>(.*)</category>" $line trash zvdata(category,$count)
if {[regexp "<pubDate>(.*)</pubDate>" $line trash zvdata(date,$count)]} { incr count }
}
Code: Select all
regexp "<category domain=(.*)>(.*)</category>" $line trash zvdata(category,$count)
how can i get the category?
thanks in advance !!