+proc display-full-wais {zset no} {
+ set i0 0
+ set i1 0
+ set refNo 0
+ set body [$zset getWAIS $no text]
+
+ while {[string length [set c [string index $body $i1]]]} {
+ if {[string compare $c \n]} {
+ incr i1
+ continue
+ }
+ set l [string trim [string range $body $i0 $i1]]
+ egw_log debug "line=$l"
+ incr i1
+ set i0 $i1
+ if {[string compare [string index $l 0] {<}]} {
+ egw_log "xxxxxxxxxxxxxxxx"
+ continue
+ }
+ if {[set mark [string first > $l ]] < 1} {
+ egw_log "yyyyyyyyyyyyyyyy"
+ continue
+ }
+ set data [string trim [string range $l [expr $mark +1] end]]
+ incr mark -1
+ set sw [string range $l 1 $mark]
+ egw_log debug "sw=$sw"
+ egw_log debug "data=$data"
+ switch -exact $sw {
+ ti {
+ set title $data
+ }
+ dm {
+ set dateOfLastModification $data
+ }
+ ci {
+ set controlIdentifier $data
+ }
+ lc {
+ set lastChecked $data
+ }
+ by {
+ set bytes $data
+ }
+ avli {
+ set linkage $data
+ }
+ cr {
+ incr refNo
+ }
+ li {
+ set crossRef($refNo,linkage) $data
+ }
+ cp {
+ set crossRef($refNo,title) $data
+ }
+ }
+ }
+ html {Title: } {<a href="} $linkage {">} $title "</a><br>\n"
+ html {URL: } $linkage "<br>\n"
+ if {[info exists bytes]} {
+ html {Bytes: } $bytes "<br>\n"
+ }
+ if {[info exists dateOfLastModification]} {
+ html {Last modified: } $dateOfLastModification "<br>\n"
+ }
+ if {[info exists lastChecked]} {
+ html {Last checked: } $lastChecked "<br>\n"
+ }
+ html "<ul>\n"
+ for {set i 1} {$i <= $refNo} {incr i} {
+ html {<li><a href="} $crossRef($i,linkage) {">}
+ html $crossRef($i,title) "</a><br>\n"
+ html "URL: " $crossRef($i,linkage)
+ }
+ html "</ul>\n"
+}
+