Xml parsing
Posted: Wed Apr 08, 2009 1:02 am
Hi all,
I need a search to be done on a xml file and print the found matches. Its a xml file with product and brands , by using php how can I do that.. Here is the format of xml..
- <categories>
- <category id="1" name="Flowline equipments">
- <products>
<product id="1">Hammer Unions</product>
<product id="2">Swivel Joints</product>
<product id="3">Pup Joints</product>
<product id="4">Chiksan Loops</product>
<product id="5">API Valves</product>
<product id="6">Manifolds</product>
<product id="7">Flanges & Fittings</product>
<product id="8">Ring Joint Gaskets</product>
<product id="9">Stud Bolts</product>
</products>
- <brands>
<brand id="1">FMC</brand>
<brand id="2">ANSON</brand>
<brand id="3">KEMPER</brand>
<brand id="4">SPM</brand>
<brand id="5">AMERICAN BLOCK</brand>
<brand id="6">SARA SAE</brand>
<brand id="7">PARVEEN OILFIELD</brand>
<brand id="8">WINDGLASS ENGINEERS</brand>
<brand id="9">SMITH</brand>
<brand id="10">LAMONS</brand>
<brand id="11">FLEXITALLIC</brand>
</brands>
</category>
</categories>
pls help
I need a search to be done on a xml file and print the found matches. Its a xml file with product and brands , by using php how can I do that.. Here is the format of xml..
- <categories>
- <category id="1" name="Flowline equipments">
- <products>
<product id="1">Hammer Unions</product>
<product id="2">Swivel Joints</product>
<product id="3">Pup Joints</product>
<product id="4">Chiksan Loops</product>
<product id="5">API Valves</product>
<product id="6">Manifolds</product>
<product id="7">Flanges & Fittings</product>
<product id="8">Ring Joint Gaskets</product>
<product id="9">Stud Bolts</product>
</products>
- <brands>
<brand id="1">FMC</brand>
<brand id="2">ANSON</brand>
<brand id="3">KEMPER</brand>
<brand id="4">SPM</brand>
<brand id="5">AMERICAN BLOCK</brand>
<brand id="6">SARA SAE</brand>
<brand id="7">PARVEEN OILFIELD</brand>
<brand id="8">WINDGLASS ENGINEERS</brand>
<brand id="9">SMITH</brand>
<brand id="10">LAMONS</brand>
<brand id="11">FLEXITALLIC</brand>
</brands>
</category>
</categories>
pls help