4
To parse a xml file in XOOPS you have a package xml in the ../class/xml directory in XOOPS 2.0.13.
1 - There is a parser call saxparser. You can use it directly or extend it if you want to save some informations during the file parsing. In this case you add attributes to save informations like parent informations.
2 - You must extend the class XmlTagHandler.
- getName return the name of the tag to perform. in your case it coundt be return 'product' if you want to perform the product tag.
- handleBeginElement : this funciton is execute when the parser begin the tag
- handleBeginElement : this funciton is execute when the parser begin the tag "getName()". You can here code an "echo" .
- handleEndElement : idem handleBeginElement at the end tag.
$parser = new xmlParser($fresource);
$parser->parse();
if ($parser->getErrors()) echo($parser->getErrors());
else echo($parser->getLog());
An other better solution is to use a xsl file to transform your xml file in HTML. There is useful function in PHP to do that...
Hope that help