|Hello! It seems that to post messages in this forum is wrong way to decide your question, becaus anyone have answered previuos person :). But i decided to try :).|
So. DOMIT is the real good thing for working with xml as DOM. But i have some trubles with it.
Well i have XML file like this:
So i have problem to open file after getting string from <file> node content.
//..getting <file> node as $fileNode
$filename = $fileNode->firstChild->toString();
$fp = fopen( $filename, 'w' ); // and in this code warrning appears "can not open stream" $filename have wrong string format, i think.
What will i have to do to get right string with filename?
I`m thinking about such way as to save file path as attribute of <file>, but it`s not very good for my xml.
|2007-05-29 05:30:53 - In reply to message 1 from Artem|
You could try putting the file name node in a CDATA section:
This will treat the contents of the node as plain text.
|2007-05-29 05:50:20 - In reply to message 2 from John Heinstein|
|Thanks a lot!!! :) and one more question. If i want to save html in my xml of prev. example. I have to keep my html in CDATA tags too, have`n i?|
ANd i can to get html by this way:
$html = $conten->firstChild->toString();
Is it right?