364,112 Members | 2345 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

xml writeRaw in php 5.1.2 problem

prabirchoudhury
100+
P: 159
Hey all

I am tryng to do convert files details as base64 format and then wrireRaw into the xml file in php 5.1.2 and then covert it back to the original file format, but writeRaw is not supported in this php version. Is any other way to do. I tryed with xml "text" but it is nt working.

Expand|Select|Wrap|Line Numbers
  1. function writeb64XML($images, $savePath = 'test.xml', $indentSource = false, $xmlVersion = '1.0') {
  2.         $this->xml = new XMLWriter();
  3.         $this->xml->openURI($savePath);
  4.         if ($indentSource) {
  5.             $this->xml->setIndent(true);
  6.         }
  7.  
  8.         $this->xml->startDocument($xmlVersion);
  9.         $this->xml->startElement('images');
  10.         $this->xml->startElement('url');
  11.         $this->xml->Text($images["file_name"]);
  12.         $this->xml->endElement();
  13.         $this->xml->startElement('source');
  14.         $this->xml->writeRaw(base64_encode($images["file_data"]));
  15.         $this->xml->endElement();
  16.  
  17.         $this->xml->endElement();
  18.         $this->xml->endDocument();
  19.         return true;
  20.     }
  21.  
i am tryng to do in php 5.1.2 but "$this->xml->writeRaw(base64_encode($images["file_data"]));" is not supporting .. any one have any idea about that please. Thanks
Jan 10 '10 #1
Share this Question
Share on Google+
4 Replies


drhowarddrfine
Expert 2.5K+
P: 4,754
Isn't this a PHP question?
Jan 10 '10 #2

prabirchoudhury
100+
P: 159
thanks ...it may be xml related php question or other way around.. any idea about the problem?
Jan 10 '10 #3

drhowarddrfine
Expert 2.5K+
P: 4,754
I don't know PHP .
Jan 11 '10 #4

Dormilich
Expert Mod 5K+
P: 6,608
you could try the DOMDocument class, although that will require quite some memory (depending on the file size).
Jan 11 '10 #5

Post your reply

Help answer this question



Didn't find the answer to your XML question?

You can also browse similar questions: XML base64 decode encode writeraw xml