Copy link to clipboard
Copied
Suppose I've got an XMLList that I'm working my way through and I want to quickly and easily get all the "text" from the node. In other works strip out all the <xmtag> mark up and possible attributes and just leave the content.
Is there an easy/fast way to do that?
<myNode>
<title>The title of an event here</title>
<presenter>Name and title of presenter here</presenter>
<date startTime="Somedate" />
<desc><![CDATA[Some text in here. It <b>might</b> have html or links or some such.]]></desc>
<resources>
<res>A list of some resources, downloads, etc.</res>
<res>Some other site or some such</res>
</resources>
</myNode>
if xml is your XML instance, after loading is complete:
trace(xml.descedants("*").text());
Copy link to clipboard
Copied
if xml is your XML instance, after loading is complete:
trace(xml.descedants("*").text());
Copy link to clipboard
Copied
Awesome. I'm going to give that at try and see if I can speed up my indexing code. A big chunk of it has been removing all the "junk" before stemming the words.
Copy link to clipboard
Copied
i'm not sure how fast that is but it's sure easy to code.
Copy link to clipboard
Copied
Yeah. My indexing is taking longer than I would like. So far I've been using RegEx and some other tricks. Just wanted to see if there was another way to approach it. Maybe it will be faster, maybe it won't, but I won't know until I try!
Copy link to clipboard
Copied
regex is slow. it's faster to use the flash string/array methods.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now