1
krooman
XML Integration
  • 2006/4/3 9:10

  • krooman

  • Just popping in

  • Posts: 30

  • Since: 2004/11/30


Could anyone advise if there is a module to integrate XML . I have the following file to integrate. Thanks in advance
http://www.safarinow.com/engine/xmlapi/search.aspx

2
tripmon
Re: XML Integration
  • 2006/4/3 9:26

  • tripmon

  • Module Developer

  • Posts: 462

  • Since: 2004/2/28


Are you trying to backdoor this info?

ummm... the file you are referencing is just a dump.... there seems to be no formatting.

http://www.safarinow.com/engine/xmlapi/

offers a login screen, where my guess is they have numerous feeds setup. If you are just wanting to use the raw data, XOOPS modules, etc won't do much for you. You will have to write a program to parse the data.

If however, you are a subscriber to their service (syndication, whatever) chances are they output RSS or ATOM feeds of the data and once you login, they . These could be read by a headlines module or xhld (peak.ne.jp/xoops).

3
krooman
Re: XML Integration
  • 2006/4/3 17:04

  • krooman

  • Just popping in

  • Posts: 30

  • Since: 2004/11/30


excellent...you are spot on. Its an affiliate travel site i joined. I have checked and yes, i need to include my user name and password.
Thanks

4
oryxvet
Re: XML Integration
  • 2006/4/4 7:43

  • oryxvet

  • Just popping in

  • Posts: 24

  • Since: 2005/4/22


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

Login

Who's Online

309 user(s) are online (171 user(s) are browsing Support Forums)


Members: 0


Guests: 309


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits