Hi.
Can anybody help me resolve the problem.
This is my code:
I need write information from <col name="OPIS"><linia></linia></col> but the output is NULL ;/ anybody help me with this ?
Can anybody help me resolve the problem.
This is my code:
Code:
package require tdom 0.7.5
set xml {<teryt>
<catalog date="2013-01-01" type="all" name="TERC">
<row>
<col name="WOJ">02</col>
<col name="POW"/>
<col name="GMI"/>
<col name="RODZ"/>
<col name="NAZWA">DOLNOŚLĄSKIE</col>
<col name="NAZDOD">województwo</col>
<col name="STAN_NA">2013-01-01</col>
<col name="OPIS">
<linia>
</linia><linia>Kaucja: 2 000,00 zł
</linia><linia>Informacje zawarte w opisie mają charakter orientacyjny i nie stanowią oferty handlowej.
</linia><linia>
</linia><linia>Oferta wysłana z programu IMO dla biur nieruchomości
</linia><linia/>
</col>
</row>
<row>
<col name="WOJ">02</col>
<col name="POW">01</col>
<col name="GMI">01</col>
<col name="RODZ">1</col>
<col name="NAZWA">Bolesławiec</col>
<col name="NAZDOD">gmina miejska</col>
<col name="STAN_NA">2013-01-01</col>
<col name="OPIS">
<linia>
</linia><linia>Linia 222222222222
</linia><linia>Liniaaaaaa 3333333333
</linia><linia>
</linia><linia/>
</col>
</row>
</catalog>
</teryt> }
set doc [dom parse $xml]
set root [$doc documentElement]
set teryt [$root selectNodes {/teryt} ]
set row [$root selectNodes {/teryt/catalog/row/col} ]
set licznik 0
set licznik1 0
foreach node $row {
set name [$node @name]
set val [$node text]
ns_log notice "name=$name; val=$val"
if { [$node @name] == "OPIS" } {
set o_opis [$root selectNodes {/teryt/catalog/row/col/linia/text()}]
#[$node text] ;#[$root selectNodes {/teryt/catalog/row/col/linia/text()}]
foreach node $o_opis {
set attList [$node linia *]
foreach attribute $attList {
puts "[$node linia]"
}
}
}
incr licznik1
}
$doc delete
I need write information from <col name="OPIS"><linia></linia></col> but the output is NULL ;/ anybody help me with this ?