Helpful Information
Category: Programming Languages More
XML queries

Tough questions.

Say I have the following xml script :

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

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

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??


Use XSLT, good articles can be found on Devshed: