Helpful Information
 
 
Category: Programming Languages More
XML queries

Tough questions.

Say I have the following xml script :

<DATA>
<STOCK NAME="Microsoft" INDUSTRY="Software" />
<QUOTES COMPANY_NAME="Microsoft">
<TRADE PRICE="56" HIGH="80" />
<TRADE PRICE="66" HIGH="85" />
<TRADE PRICE="58" HIGH="79" />
</QUOTES>

<STOCK NAME="Intel" INDUSTRY="Hardware" />
<QUOTES COMPANY_NAME="Intel">
<TRADE PRICE="42" HIGH="60" />
<TRADE PRICE="32" HIGH="75" />
<TRADE PRICE="38" HIGH="62" />
</QUOTES>
</DATA>


How can I parse the code(i'm using PHP) to show only trade data(eg. price) for only Microsoft?
Does XML have a whereas function or something similar??

thanx

Use XSLT, good articles can be found on Devshed:

http://www.devshed.com/Server_Side/XML/XSLBasics/XSLBasics1/