1

I need to archive a database-driven flash as3 website. I exported a table to xml so now i have something like this:

<RECORDS>
  <RECORD>
    <id>home</id>
    <msg>bodytext</msg>
    <type>0</type>
    <lastEditDate>0000/0/0 00:00:00</lastEditDate>
    <lastAccessDate>2009/6/17 11:37:21</lastAccessDate>
    <timesAccessed>855</timesAccessed>
  </RECORD>
  <RECORD>
    <id>contact</id>
    <msg>contact body text</msg>
    <type>0</type>
    <lastEditDate>0000/0/0 00:00:00</lastEditDate>
    <lastAccessDate>2010/5/6 20:40:46</lastAccessDate>
    <timesAccessed>831</timesAccessed>
  </RECORD>
</RECORDS>

Now I would like to select the RECORD where id is set to home.

In SQL: SELECT * FROM table WHERE id='home'

How can i do the same thing with E4X for AS3 ?

1 Answer 1

2

I found out that it is as easy as this:

xml.RECORD.(id == 'home')

this will return the following:

<RECORD>
    <id>home</id>
    <msg>bodytext</msg>
    <type>0</type>
    <lastEditDate>0000/0/0 00:00:00</lastEditDate>
    <lastAccessDate>2009/6/17 11:37:21</lastAccessDate>
    <timesAccessed>855</timesAccessed>
  </RECORD>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.