flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <harbs.li...@gmail.com>
Subject Re: [FALCONJX][FLEXJS] XML handling (was Re: [FlexJS] Back port)
Date Wed, 10 Feb 2016 11:23:33 GMT
I missed an issue here:

Taking an example from the spec:
e.employee.(name == "Jim").setChildren(<name>John</name> + <age>35</age>);

var employeedata = <name>Fred</name> + <age>28</age> + <hobby>skiing</hobby>;

We need a method to concatenate two or more XML objects into an XML object. I see two ways
to do this:

1. Add a concat method to XML which returns a new XMLList with the XML object and the value
passed in. If we do this, the compiler will not need to differentiate between XML and XMLList.
Either one can be on either side of the operator.
2. The compiler will need to create an XMLList for any XML object used.

It seems to me that option #1 is simpler and less error prone.

On Feb 9, 2016, at 8:04 PM, Alex Harui <aharui@adobe.com> wrote:

>>> [[append]] maps to concat()
>> That’s for XMLList. (which I’ve already done) What do we do for XML? Not
>> implement it? throw an error?
> If I understand the spec, it never gets called on XML.  When the compiler
> sees the "+" operator, the generated code is supposed to generate a new
> XMLList.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message