开发者

Displaying information read from XML

开发者 https://www.devze.com 2023-02-28 21:16 出处:网络
Merged with XML parse by id help. (I\'m such a newbie at this that the answers just confuse me more. I need a direct, exact, solution to this problem, spelled out to me step by step)
Merged with XML parse by id help.

(I'm such a newbie at this that the answers just confuse me more. I need a direct, exact, solution to this problem, spelled out to me step by step)

I have 2 documents, test.php and test.xml. test.php will display the names of the faculty within a department. That's it, just a list. For example, for AT based on the XML document shown below:

John J. Doe
Jill J. Doe

From a previous page I use query strings to get an id; example: test.php?id=AT

I need to display all the employee names within the department that they select. Below is a snippet of my XML document.

<SOT>
    <DEPARTMENT name="Aviation Technology" id="AT">
        <EMPLOYEE type="Faculty">
            <LOGIN>bdbowen</LOGIN>
            <PASSWORD>bdbowen</PASSWORD>
            <NA开发者_高级运维ME>John J. Doe</NAME>
            <IMAGE>images/faculty/bdbown.jpg</IMAGE>
            <OFFICE>Knoy</OFFICE>
            <PHONE>765.494.2884</PHONE>
            <EMAIL>dsgriggs@purdue.edu</EMAIL>
        </EMPLOYEE>
        <EMPLOYEE type="Faculty">
            <LOGIN>bdbowen</LOGIN>
            <PASSWORD>bdbowen</PASSWORD>
            <NAME>Jill J. Doe</NAME>
            <IMAGE>images/faculty/bdbown.jpg</IMAGE>
            <OFFICE>Knoy</OFFICE>
            <PHONE>765.494.2884</PHONE>
            <EMAIL>dsgriggs@purdue.edu</EMAIL>
        </EMPLOYEE>
    </DEPARTMENT>
    <DEPARTMENT name="Mechanical Engineering Technology" id="MET">
        <EMPLOYEE type="Faculty">
            <LOGIN>bdbowen</LOGIN>
            <PASSWORD>bdbowen</PASSWORD>
            <NAME>John J. Doe</NAME>
            <IMAGE>images/faculty/bdbown.jpg</IMAGE>
            <OFFICE>Knoy</OFFICE>
            <PHONE>765.494.2884</PHONE>
            <EMAIL>dsgriggs@purdue.edu</EMAIL>
        </EMPLOYEE>
    </DEPARTMENT>
</SOT>

For instance, if they select the link that uses a GET to pull in the AT id, I want to display the following on the page:

John J. Doe
Jill J. Doe

How can I do that?

0

精彩评论

暂无评论...
验证码 换一张
取 消