On Nov 16, 2015, at 8:03 PM, Alex Harui <aha...@adobe.com> wrote:

> 
> 
> On 11/16/15, 9:54 AM, "Harbs" <harbs.li...@gmail.com> wrote:
> 
>>> 2) detect read and write on XML/XMLList and convert read to child().
>>> What
>>> about write()?
>> 
>> Good question. I think we should map xml.foo = <foo id=“1"/> to
>> xml.replace(“foo”,new XML(“<foo id=\”1\”/>”));
> 
> What does the above actually do if there is only one foo child and if
> there are more than one foo.child?

1. xml.foo = someXML replaces all foos with someXML (in the location of the 
first foo)
2. xml.foo = someXMLList removes all foos and adds in the ones from the list 
(in the location of the first foo)

> Do you know if you can use += to append?

How do you like that? I’ve never thought of trying +=! I just tried and it 
works like a charm! It adds it in after the last foo or at the end if foo does 
not exist.

I’m not sure what the best mapping for this will be. We probably should get a 
reference to the last foo and map it to xml.insertChildAfter(lastFoo,newFoo) if 
there are any foos. Otherwise it should map to appendChild().

> 
> -Alex
> 

Reply via email to