[REBOL] handling elements with no children with xml-object script
From: mgh520::yahoo::com at: 4-Sep-2001 6:59
I've started using the xml-object script by Gavin McKenzie and it's pretty cool (great
documentation too). But has
anyone noticed that it doesn't seem to be handling elements that don't have children?
For example:
<Person name="Homer"/> will throw an error at the length? children line in xml-object.r.
In the script, children is
assumed to not be none.
I did this following quick fix: right after children is set, I check to see if it's none
and if it is, set it to an empty series,
like this:
if children = none [
children: copy []
]
and that seems to take care of it. At least it creates the object with no complaints.
I haven't used the created
object extensively yet, but a probe of it looks like it's good.
mike