dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: XML Search

  1. #1
    Senior Member
    Join Date
    May 2003
    Posts
    160

    XML Search

    I need to search by state ... You will see what I mean

    PHP Code:
    <?xml version="1.0" encoding="UTF-8"?>

    <classes>

    <class state="NJ">
    <text desc="NJ Text 1"></text>
    <text desc="NJ Text 1-1"></text>
    </class>

    <class state="NJ">
    <text desc="NJ Text 2"></text>
    <text desc="NJ Text 2-1"></text>
    </class>

    <class state="NJ">
    <text desc="NJ Text 3"></text>
    <text desc="NJ Text 3-1"></text>
    </class>

    <class state="CA">
    <text desc="CA Text 1"></text>
    <text desc="CA Text 1-1"></text>
    </class>

    <class state="TX">
    <text desc="TX Text 1"></text>
    <text desc="TX Text 1-1"></text>
    </class>

    <class state="TX">
    <text desc="TX Text 2"></text>
    <text desc="TX Text 2-1"></text>
    </class>


    </classes>
    I want to display all the classes that are NJ ... I wrote a program ... but I lost it and I can't remember how I did it.

    thanks for the help

    -s

  2. #2
    nobody
    Join Date
    Aug 2002
    Posts
    269
    xmlArray = xmlObject.lastChild.childNodes;
    for (n=0;n< xmlArray.length;n++){
    if (xmlArray[n].attributes.state == "NJ"){//or == searchVariable
    display(); // some function
    }
    }
    kra, kra

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center