Hi Michael,
Try your xml like this..
<topic title="my topic">
<menu>
<section type="pubs">
<asset id="i" type="doc">doc.pdf</asset>
</section>
<section type="media">
<asset id="a" title="Presentation">pres.pptx</asset>
<asset id="b" title="animation">flash.swf</asset>
</section>
<section type="info">
<asset id="c" title="questions"></asset>
<asset id="d" title="something"></asset>
</section>
</menu>
</topic>
or
<topic title="my topic">
<menu>
<section type="pubs">
<asset id="i">
<type>doc</type>
<filename>doc.pdf</filename>
</asset>
</section>
<section type="media">
<asset id="a">
<title>Presentation</title>
<filename>pres.pptx</filename>
</asset>
<asset id="b">
<title>animation</title>
<filename>flash.swf</filename>
</asset>
</section>
<section type="info">
<asset id="c">
<title>questions</title>
</asset>
<asset id="d">
<title>something</title>
</asset>
</section>
</menu>
</topic>
I find the latter may be a little more work to build, but easier to
work with code wise. But that may just be me.
As far as your xmlList:XMLList not working, it is probably because of
the unclosed "section" tag.
All the "asset" tags are closed properly and so it can search through
those, but when you say descendants,
that includes the "section" tags and they are broken if they are not
all closed properly.
So the second is not actually dependent on the first, the second
can't complete.
Best,
Karl
On Jul 22, 2011, at 3:15 PM, Kenneth Kawamoto wrote:
That's not valid XML
Kenneth Kawamoto
http://www.materiaprima.co.uk/
On 22/07/2011 19:06, Mendelsohn, Michael wrote:
Hi list...
The second line returns an XMLList only if the first line (bug)
isn't commented out. If the first line is commented out, the
second line returns null.
How can it be possible that the second line's result depends on
the first line running?
Thanks,
- Michael M.
var bug:XMLList = topic..asset.(hasOwnProperty("@title"));
var xmlList:XMLList = topic.descendants("*").(hasOwnProperty
("@title")&& (@title == "Presentation"));
<topic title="my topic">
<menu>
<section type="pubs">
<asset id="i" type="doc" fileName="doc.pdf"/></section>
<section type="media">
<asset id="a" title="Presentation" fileName="pres.pptx"/>
<asset id="b" title="animation" fileName="flash.swf"/>
<section type="info">
<asset id="c" title="questions"/>
<asset id="d" title="something"/>
</section>
</menu>
</topic>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Karl DeSaulniers
Design Drumm
http://designdrumm.com
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders