0

I am trying to build a very simple price comparison script.

Until now, I wrote a code that gets some product xml feeds from shops and with the help of XSLT I create a single-global xml of all those input XMLs. I use the XSLT because the shops have different names for elements.

Now I want to take it one step further and I want to create a search form that will display me the products let's say I have the term "laptop".

I know how to create a form, but I need a coding guidance to understand how to make it to search in my XML file (products.xml) and display let's say the

Thank you

3

2 Answers 2

2

You might want to check out http://php.net/manual/en/class.xmlreader.php

Using that it is pretty easy to navigate through an XML file and grab all the info you need.

EDIT: On second thought, http://php.net/manual/en/book.simplexml.php is a MUCH simpler way to achieve what you're trying to do. Hence the name, I guess ;)

Sign up to request clarification or add additional context in comments.

1 Comment

Hi there, I came across this earlier, because I am not an advanced programmer and I go step by step, is this an alternative for DOM or SimpleXML ?
2

You can use SimpleXML library to parse your xml file. In my opinion SimpleXML is easier to use than xmlreader. Though SimpleXML is introduced on php5.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.