[Laszlo-dev] flash 9 XMLList object

P T Withington ptw at pobox.com
Sat Jan 26 09:49:34 PST 2008


Well, it's a standard, and is included in JS2, so we should probably  
move that way...

On 2008-01-25, at 22:40 EST, Henry Minsky wrote:

> Oh, I just looked at the E4X spec, and  it's to be compatible with the
> E4X model of the world.
>
> It appears that AS3 has sort of deprecated the DOM XML API, and all
> the docs suggest
> using their E4X API, which has XML and XMLList as the basic data
> types. Hmm... I wonder
> if that will catch on.
>
>
>
>
> On Jan 25, 2008 1:05 AM, Henry Minsky <henry.minsky at gmail.com> wrote:
>> That seems pretty likely..
>>
>>
>>
>>
>> On Jan 25, 2008 12:37 AM, Elliot Winard <enw at laszlosystems.com>  
>> wrote:
>>> 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>
>>>>
>>>
>>
>>
>>
>> --
>> Henry Minsky
>> Software Architect
>> hminsky at laszlosystems.com
>>
>>
>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>




More information about the Laszlo-dev mailing list