Xml parsing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
sanju
Forum Commoner
Posts: 65
Joined: Sat Jun 21, 2008 2:15 am
Location: Kochi, India

Xml parsing

Post by sanju »

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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Xml parsing

Post by Christopher »

http://us2.php.net/manual/en/refs.xml.php

There are many solutions in PHP. SimpleXML is the easiest way to read XML files.
(#10850)
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: Xml parsing

Post by susrisha »

what do you want to search for??
User avatar
sanju
Forum Commoner
Posts: 65
Joined: Sat Jun 21, 2008 2:15 am
Location: Kochi, India

Re: Xml parsing

Post by sanju »

I need to serch for the products and brands. Actually site is a static one and need to have a secrh option
Post Reply