Posted by Alistair Baillie SS2002 on 05/17/05 16:24
You just echo it out to the browser like that, and send the XML content
header.
(Or save it into a variable, for storing into a file)
eg:
<?php
header("Content-type: text/xml");
echo "
<response>\n
<data>\n
<parts>\n
<part>\n
<number>bla</number>\n
</part>\n
</parts>\n
</data>\n
</response>";
?>
"Gary Quiring" <gquiring@msn.com> wrote in message
news:5epj81dn4lb63elmhs5pqt6ao1lqjlno0c@4ax.com...
>I need to create an XML string using PHP5. The examples I have followed
>seem to
> be using out dated libary calls. I tried new_xmldoc() and new
> DomDocument.
> Both get undefined errors. How do I create an XML string where it will
> look
> something like this:
>
> <response>
> <data>
> <parts>
> <part>
> <number>bla</number>
> <price>9999</price>
> <uom>EA</uom>
> <locations>
> <location>
> <id>bla</id>
> <qty>9999</qty>
> </location>
> </locations>
> </part>
> </parts>
> </data>
> </response>
>
> Thanks
> Gary Quiring
>
Navigation:
[Reply to this message]
|