Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml to php - help- newbie

Status
Not open for further replies.

Goat

Programmer
Jul 13, 2000
36
DK
Greetings

I am wanting to pass a xml file to PHP, which will then turn it into a pdf using this-
The xml file is a flight Itenary.

The current system is very inflexible. So we are changing to having our online flight booking system output files as an xml file. This then needs to be picked up, and converted into a pdf.

I'v found a php script which can convert a text file into a pdf ( see the link above) which works well.

I've never worked with PHP before but it seems to be the way to.

I hope somebody can give me some good suggestions as to how to get this to work.
 
PHP has a native xml parser, xpat, which is servicable for most XML applications. It's a bit more clunky that the java parsers, but it gets the job done. The biggest drawback is that it is, in my opinion, slow. To be honest, if it were a small document with set elements I wouldn't be afraid to write it once using xpat, and once just parsing the xml through a series of regular expression filters to see which runs fastest.
 
You could also use the XML DOM anyway as long as you are know that your users will be running IE5+. You could wrap everything in PHP and echo just the XML to the browser, which has MSXML DOM built in.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top