saving xml file from php
Posted: Thu Jul 13, 2006 4:37 pm
Hello there, I'm sure this should be easy but I just can't work it out. Please help.
I've created a domxml doc like this:
Problem I'm having is that this doesn't save a document. It gives a fatal error. So does all the other combinations I've tried.
If anyone knows the right way to do this. Please put me out of my misery.
Cheers!
B
I've created a domxml doc like this:
Code: Select all
$docOut = domxml_new_doc("1.0");
$root = $docOut->create_element("locations");
$root = $docOut->append_child($root);
$detail = $docOut->create_element("location");
$detail = $root->append_child($detail);
$text = $docOut->create_text_node($LocationInfo);
$text = $detail->append_child($text);
print $docOut->save_xml("test.xml");If anyone knows the right way to do this. Please put me out of my misery.
Cheers!
B