handling elements with no children with xml-object script
[1/3] 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
[2/3] from: etienne:alaurent:free at: 4-Sep-2001 15:15
Hi,
Where can we find xml-object ?
Thanks
---
Etienne
[3/3] from: gavin:mckenzie:sympatico:ca at: 4-Sep-2001 23:10
Yeah...I noticed that on the weekend. I can't believe that up til now I've
only been running with XML that was devoid of empty elements. I've built a
fix.
Unfortunately it's on my work machine, I'll update it tomorrow, and send a
copy to your email address.
Sorry for the inconvenience.
Gavin.