Today, the following is working too: var svg:XML = <svg> <group> <rect id="1" /> <rect id="2" /> </group> <group> <rect id="3" /> <rect id="4" /> </group> </svg>;
var rects:XMLList = svg..rect; rects[1].@width = "100px"; //rects.(@id==3).@height = "100px"; trace(rects.toXMLString()); outputs: <rect id="1"/><rect id="2" width="100px"/><rect id="3"/><rect id="4”/> Once we get some more things fixed in the compiler, we can uncomment the second to last line, and it’ll output: <rect id="1"/><rect id="2" width="100px"/><rect id="3" height="100px"/><rect id="4”/> On Apr 12, 2016, at 12:56 AM, OmPrakash Muppirala <[email protected]> wrote: > Awesome! > > I'll post if I can remember any of my other common scenarios. > > Thanks, > Om > > On Mon, Apr 11, 2016 at 2:54 PM, Harbs <[email protected]> wrote: > >> Absolutely! >> >> I just ran this: >> var svg:XML = <svg><group><rect id="1" /><rect id="2" >> /></group><group><rect id="3" /><rect id="4" /></group></svg>; >> >> var rects:XMLList = svg..rect; >> trace(rects.toXMLString()); >> >> and got this in the console: >> <rect id="1"/><rect id="2"/><rect id="3"/><rect id="4”/> >> >> >> On Apr 12, 2016, at 12:42 AM, OmPrakash Muppirala <[email protected]> >> wrote: >> >>> Yay! That's fantastic news. >>> >>> Just curious. Will this case work? >>> >>> var svg:XML = <svg> >>> <group> >>> <rect id="1" /> >>> <rect id="2" /> >>> </group> >>> <group> >>> <rect id="3" /> >>> <rect id="4" /> >>> </group> >>> </svg> >>> >>> var rects:XMLList = svg..rect; >>> >>> //rects should contain all the rects in the svg, i.e. >>> <rect id="1"/> >>> <rect id="2"/> >>> <rect id="3"/> >>> <rect id="4"/> >>> >>> Thanks, >>> Om >>> >>> >>> On Mon, Apr 11, 2016 at 2:21 PM, Harbs <[email protected]> wrote: >>> >>>> I made some great progress today. >>>> >>>> I just compared the output of some pretty whacky xml processing in Flash >>>> to the output using the JS XML classes and the output was pretty close! >>>> >>>> There are definitely some issues I still need to work on (besides some >>>> compiler issues in JIRA), but I’m really happy with it already. I >> expect to >>>> be able to try and run some production code through the compiler in the >>>> next week or so and see what happens. >>>> >>>> On Apr 10, 2016, at 4:02 PM, Harbs <[email protected]> wrote: >>>> >>>>> I reached a milestone today with E4X. I have the first working test >>>> which reads an XML literal, writes it back out to a string and writes >> the >>>> value of an attribute using E4X notation in Javascript! >>>>> >>>>> Over the next couple of weeks I expect to be fixing a lot of issues >>>> related to XML and the better the test-case coverage we have, the better >>>> the quality will be. >>>>> >>>>> I’d like to put out a call for snippets of E4X code that people are >>>> using in the wild so we can incorporate tests for as many use cases as >> we >>>> can get. >>>>> >>>>> If you have code snippets to contribute, please respond! >>>>> >>>>> Thanks, >>>>> Harbs >>>>> >>>>> (P.S. There is currently a compiler issue with two of the XML methods, >>>> so the XML.js file needs a bit of editing before it can be used. >> Hopefully >>>> this issue will be fixed soon.) >>>> >>>> >> >>
