| 
 Posted by David Haynes on 06/18/19 11:43 
amagondes@hotmail.com wrote: 
> Like Jon said just print the xml. Here is an example: 
>  
> <?php 
> header("Content-Type: text/xml"); 
>  
> echo "<?xml version=\"1.0\" ?>\n"; 
>  
> print "<response>\n"; 
> print "  <test>This is a test</test>\n"; 
> print "</response>\n"; 
>  
> ?> 
>  
> That way you can populate the content on the fly from a db or whatever. 
>  
 
This is OK unless you have a whack of XML to print. Then I would create  
a library that lets you instantiate an XML document, add elements and  
attributes to it, and finally print it. 
 
It's easy to do. The last time I did one it took about a day to get it  
all together with test scripts etc. 
 
-david-
 
  
Navigation:
[Reply to this message] 
 |