paul_p
14 years agoVisitor
Not parsing the entire xml
I have a strange behavior when parsing a large xml (but I'm not sure if the fact that is large is causing the problem).
This is the xml format:
and this is the code, where
The problem is that is only processing 14 cat elements, instead of 21 and I really don't know why.
Please help me with any ideas.
Thanks a lot!
This is the xml format:
<?xml version="1.0" encoding="UTF-8"?>
<webservice>
<control>
<operation>get_clips</operation>
<status>0</status>
</control>
<data>
<cat size="4" lang="EN"/>
<cat size="3" lang="EN"/>
' and 19 more other similar 'cat' elements
</data>
</webservice>
and this is the code, where
m.rawResponseis the above xml
if m.rawResponse <> "" then
xml = CreateObject("roXMLElement")
print "################ "; m.rawResponse ' contains the entire xml
xml.Parse( m.rawResponse )
print "################ "; m.rawResponse ' contains the entire xml
' I've tried like this
categories = xml.data.GetChildElements()
print "number of categories: " ; categories.Count() ' prints 14
' and also like this
i = 0
for each categ in xml.data.cat
i = i +1
end for
print i ' prints 14
end if
The problem is that is only processing 14 cat elements, instead of 21 and I really don't know why.
Please help me with any ideas.
Thanks a lot!