0

Hey guy's I have a SOAP call that returns something like this:

 <?xml version="1.0"
     encoding="utf-8"?><item> <dailystats>
     <date>2011-03-18</date>
     <impressions>17</impressions>
     <clicks>1</clicks> <leads>1</leads>
     <num_sales>0</num_sales> <sales>
     0.00</sales> <sub_sales> 0.00</sub_sales> <commission> 1.10</commission> click_thru_ratio>5.88%</click_thru_ratio>
     </dailystats> </item>

Now I want to make a script that posts this in a readable format. For example I want it to look like this:

Clicks: ( then here it searches in the code above for the ammount of clicks and posts them here ).

Is this possible and could anyone help me out?

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
damage000
  • 2,873
  • 2
  • 15
  • 6
  • 1
    You're looking for a [PHP Parser](http://stackoverflow.com/questions/188414/best-xml-parser-for-php). Possible Duplicates: http://stackoverflow.com/questions/3630866/php-parse-xml-string http://stackoverflow.com/questions/659369/parse-big-xml-in-php http://stackoverflow.com/questions/1582592/php-how-to-parse-this-xml http://stackoverflow.com/questions/3372692/parse-xml-in-php http://stackoverflow.com/questions/1706042/how-to-parse-xml-file-in-php – Bobby Apr 04 '11 at 09:41

1 Answers1

0

You can display your XML document with xslt

See : http://www.codewalkers.com/c/a/Miscellaneous/Transforming-XML-with-XSLT-and-PHP/3/

Always think template when you want to display data, and xslt is a perfect template engine.

remi bourgarel
  • 9,231
  • 4
  • 40
  • 73