xml writeRaw in php 5.1.2 problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prabirchoudhury
    New Member
    • May 2009
    • 162

    xml writeRaw in php 5.1.2 problem

    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.

    Code:
    function writeb64XML($images, $savePath = 'test.xml', $indentSource = false, $xmlVersion = '1.0') {
    		$this->xml = new XMLWriter();
    		$this->xml->openURI($savePath);
    		if ($indentSource) {
    			$this->xml->setIndent(true);
    		}
    
    		$this->xml->startDocument($xmlVersion);
    		$this->xml->startElement('images');
            $this->xml->startElement('url');
    		$this->xml->Text($images["file_name"]);
    		$this->xml->endElement();
    		$this->xml->startElement('source');
    		$this->xml->writeRaw(base64_encode($images["file_data"]));
    		$this->xml->endElement();
    		  
    		$this->xml->endElement();
    		$this->xml->endDocument();
    		return true;
    	}
    i am tryng to do in php 5.1.2 but "$this->xml->writeRaw(base6 4_encode($image s["file_data"]));" is not supporting .. any one have any idea about that please. Thanks
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Isn't this a PHP question?

    Comment

    • prabirchoudhury
      New Member
      • May 2009
      • 162

      #3
      thanks ...it may be xml related php question or other way around.. any idea about the problem?

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        I don't know PHP .

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          you could try the DOMDocument class, although that will require quite some memory (depending on the file size).

          Comment

          Working...