[Laszlo-dev] flash 9 XMLList object
Elliot Winard
enw at laszlosystems.com
Thu Jan 24 21:37:48 PST 2008
D'ya think this is a backwards compatibility thing because Flash always
used to support invalid XML that had no root node?
-e
Henry Minsky wrote:
>
> The Flash 9 runtime defines a class called XMLList, which is like an
> XML DOM object, except it doesn't need t a root node, it can be a list
> of elements.
>
> This is interesting because it is making explicit something that we've
> been doing implicitly.
>
> In LZX we allow a dataset that looks like
>
> <dataset>
> <foo/>
> <bar/>
> <baz/>
> </dataset>
>
> Which makes a dataset which looks like
>
> «lz.dataset#0| <foo><foo/><bar/><baz/></foo>»
>
> lzx> foo.childNodes
> «Array(3)#1| [<foo/>, <bar/>, <baz/>]»
> lzx>
>
> Because we implicitly make a root node which is never shown.
>
> Many times it is useful to represent list data as XML, and you don't
> want to have to force it to have a single root node.
>
> They apparently decided this was common enough to make a class for it.
> However, the XMLList object throws and error if
> you try to do any XML operations on it, you need to iterate over it's
> members if it has length greater than one.
>
>
>
>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com <mailto:hminsky at laszlosystems.com>
>
More information about the Laszlo-dev
mailing list