I am working on a very simple xml data extraction script in console. I have been getting some strange results. I am basically opening a large xml dictionary file and I want to go through and parse-xml each xml entry and then use the to-rebol-data script to "beautify" the results. My problem comes when I pass the data to the to-parse-data script
Looking at the following code
to-rebol-data: func [block /local out] [
out: copy []
foreach [tag attr body] block [
append out to-word tag
foreach item body [
either block? item [
append/only out to-rebol-data item
][
if not empty? trim item [append out item]
]
]
]
out
]
xmlfile: read %Research/xml_files/gcide_a.xml
nDef: find xmlfile "<p><hw>"
tst: parse-xml nDef
result: to-rebol-data tst
At this point the script will throw an error saying the following
>> do %dictionary_recognizer.r
Script: "A GCIDE dictionary 'parser'" (25-Aug-2004)
** Script Error: foreach expected data argument of type: series
** Where: to-rebol-data
** Near: foreach item body [
The problem I have is that I have run tests on the data I am inputing and I get the following output
>> block? tst
== true
>> series? tst
== true
I am very confused. It says it needs a series, and yet when I check to see if it is a series it says true. Does anyone have any idea how I can move forward with this?
Thanks