Exemplo n.º 1
0
 public function begin()
 {
     $this->writer->openMemory();
     $this->writer->setIndent(true);
     $this->writer->setIndentString(str_repeat(' ', 4));
     $this->writer->startDocument('1.0', 'UTF-8');
 }
Exemplo n.º 2
0
 public function execute($input)
 {
     $this->isRoot = true;
     $this->writer = new XMLWriter();
     $this->writer->openMemory();
     $this->writer->startDocument('1.0', 'UTF-8');
     $this->writer->setIndent(true);
     $this->run($input);
     return $this->writer->flush();
 }
Exemplo n.º 3
0
 private function initialize()
 {
     if ($this->streamUri !== null) {
         $this->cursor->openUri($this->streamUri);
     } else {
         $this->cursor->openMemory();
     }
     $this->cursor->startDocument($this->marshaller->getSchemaVersion(), $this->marshaller->getEncoding());
     if ($this->marshaller->getIndent() > 0) {
         $this->cursor->setIndent((int) $this->marshaller->getIndent());
     }
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::openMemory();
     //parent::startDocument(); // this hack avoids the output of the <?xml version="1.0" element
     parent::setIndent(true);
     parent::setIndentString('  ');
 }
Exemplo n.º 5
0
 function fill_muc_config_form(array $packet, array $fill_info)
 {
     $ret_val_xml = "";
     $header = $packet["iq"]["@"];
     $nested_conf = $packet["iq"]["#"];
     $fields = $nested_conf["query"]["0"]["#"]["x"]["0"]["#"];
     unset($fields["title"]);
     unset($fields["instructions"]);
     unset($nested_conf["query"]["0"]["#"]["x"]["0"]["#"]);
     $header["type"] = "set";
     $to = $header["from"];
     $header["from"] = $header["to"];
     $header["to"] = $to;
     $nested_conf["query"]["0"]["#"]["x"]["0"]["@"]["type"] = "submit";
     foreach ($fill_info as $var => $value) {
         if (!$this->set_field_value($fields["field"], $var, $value)) {
             return false;
         }
     }
     //		var_dump($packet);
     // Building response array
     $response = array("iq" => array("@" => $header, "#" => $nested_conf));
     $response["iq"]["#"]["query"]["0"]["#"]["x"]["0"]["#"] = $fields;
     //		var_dump($response);
     //		var_dump($header);
     //		var_dump($nested_conf);
     //		var_dump($fields);
     /***********************************
      ******** Generate the XML
      ***********************************/
     $xml = new XmlWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString(' ');
     // Starting roots (usualy we've got only 1 root for a pck).
     foreach ($response as $key => $value) {
         $xml->startElement($key);
         if (is_array($value)) {
             // Attributes
             if (is_array($value["@"])) {
                 foreach ($value["@"] as $attr => $attr_value) {
                     $xml->writeAttribute($attr, $attr_value);
                 }
             }
             // Nested elements
             if (is_array($value["#"])) {
                 $this->write($xml, $value["#"]);
             }
         }
         $xml->endElement();
         $ret_val_xml = $xml->outputMemory(true);
     }
     return $ret_val_xml;
     //		var_dump($packet);
     //		var_dump($fill_info);
 }
Exemplo n.º 6
0
 private function initialise()
 {
     /* Setting XML header */
     @header("content-type: application/vnd.google-earth.kml+xml; charset=UTF-8");
     /* Initializing the XML Object */
     $xml = new XmlWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument('1.0', 'UTF-8');
     return $xml;
 }
Exemplo n.º 7
0
 public static function output_xml($data, $version = '0.1', $root = 'root', $parameters = array(), $sItemName = 'item')
 {
     $xml = new XmlWriter();
     $xml->openMemory();
     $xml->startDocument('1.0', 'UTF-8');
     $xml->startElement($root);
     $xml->setIndent(true);
     if (!empty($version)) {
         $xml->writeAttribute('version', $version);
     }
     foreach ($parameters as $paramk => $paramv) {
         $xml->writeAttribute($paramk, $paramv);
     }
     self::writexml($xml, $data, $sItemName);
     $xml->endElement();
     return $xml->outputMemory(true);
 }
Exemplo n.º 8
0
function getXml($results)
{
    $xml = new XmlWriter();
    $xml->openMemory();
    $xml->setIndent(true);
    // new
    $xml->setIndentString("    ");
    // new
    $xml->startDocument('1.0', 'UTF-8');
    $xml->startElement('root');
    write($xml, $results);
    $xml->endElement();
    $xml->endDocument();
    // new
    $data = $xml->outputMemory(true);
    //$file = file_put_contents(APPPATH . '../uploads/data.xml', $data);
    return $data;
}
 function exportJournal()
 {
     $writer = new XmlWriter();
     $writer->openURI($this->outputFolder . "/journal.xml");
     $writer->startDocument('1.0', 'utf-8');
     $writer->startElement('journal');
     $writer->setIndent(true);
     $this->exportJournalConfig($writer);
     $this->exportAnnouncements($writer);
     $this->exportReviewForms($writer);
     $this->exportUsers($writer);
     $this->exportGroups($writer);
     $this->exportSections($writer);
     $this->exportIssues($writer);
     $this->exportArticles($writer);
     $writer->endElement();
     $writer->flush();
     return $this->outputFolder . "/journal.xml";
 }
Exemplo n.º 10
0
 function outputXml($results, $xsltPath)
 {
     /* Setting XML header */
     @header("content-type: text/xml; charset=UTF-8");
     /* Initializing the XML Object */
     $xml = new XmlWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument('1.0', 'UTF-8');
     if (isset($xsltPath)) {
         $xml->WritePi('xml-stylesheet', 'type="text/xsl" href="' . $xsltPath . '"');
     }
     $xml->startElement('callback');
     $xml->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
     $xml->writeAttribute('xsi:noNamespaceSchemaLocation', 'schema.xsd');
     /* Function that converts each array element to an XML node */
     function write(XMLWriter $xml, $data)
     {
         foreach ($data as $key => $value) {
             if (is_array($value)) {
                 if (is_numeric($key)) {
                     #The only time a numeric key would be used is if it labels an array with non-uniqe keys
                     write($xml, $value);
                     continue;
                 } else {
                     $xml->startElement($key);
                     write($xml, $value);
                     $xml->endElement();
                     continue;
                 }
             }
             $xml->writeElement($key, $value);
         }
     }
     /* Calls previously declared function, passing our results array as parameter */
     write($xml, $results);
     /* Closing last XML node */
     $xml->endElement();
     /* Printing the XML */
     echo $xml->outputMemory(true);
 }
 public function executeXml(AgaviRequestDataHolder $request_data)
 {
     $report = $this->prepareReport($request_data);
     $xml = new XmlWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->startDocument('1.0', 'UTF-8');
     $xml->startElement('application');
     $xml->writeAttribute('name', $report['application']);
     $xml->startElement('status');
     $xml->text($report['status']);
     $xml->endElement();
     $connections = $report['connections'];
     $xml->startElement('connections');
     foreach ($connections['stats'] as $name => $value) {
         $xml->writeAttribute($name, $value);
     }
     $xml->writeElement('status', $connections['status']);
     $xml->startElement('stats');
     foreach ($connections['stats'] as $name => $value) {
         $xml->writeElement($name, $value);
     }
     $xml->endElement();
     // connections/stats
     foreach ($connections['details'] as $name => $value) {
         $xml->startElement('connection');
         $xml->writeAttribute('name', $name);
         if (is_array($value)) {
             $this->array2xml($value, $xml);
         } else {
             $xml->writeCData((string) $value);
         }
         $xml->endElement();
     }
     $xml->endElement();
     // connections
     $xml->endElement();
     // application
     $xml->endDocument();
     return $xml->outputMemory();
 }
Exemplo n.º 12
0
 public function render($response, $viewModel)
 {
     $xml = new XmlWriter();
     $xml->openMemory();
     $xml->startDocument('1.0', 'UTF-8');
     $xml->setIndent(true);
     $data = $viewModel->toArray();
     $rootNode = $viewModel->getRootNodeName();
     if (!$rootNode) {
         $rootNode = key($data);
         $data = $data[$rootNode];
     }
     if (is_array($data)) {
         $xml->startElement($rootNode);
         $this->write($xml, $data);
         $xml->endElement();
     } else {
         $xml->writeElement($rootNode, utf8_encode($data));
     }
     $response->headers->set('Content-Type', 'application/xml;charset=utf-8');
     $response->setContent($xml->outputMemory(true));
 }
Exemplo n.º 13
0
 /**
  * Build an XML Data Set
  *
  * @param array $data
  *        	Associative Array containing values to be parsed into an XML Data Set(s)
  * @param string $startElement
  *        	Root Opening Tag, default data
  * @return string XML String containig values
  * @return mixed Boolean false on failure, string XML result on success
  */
 public function buildXML($data, $startElement = 'data')
 {
     if (!is_array($data)) {
         $err = 'Invalid variable type supplied, expected array not found on line ' . __LINE__ . " in Class: " . __CLASS__ . " Method: " . __METHOD__;
         trigger_error($err);
         // if($this->_debug) echo $err;
         return false;
         // return false error occurred
     }
     $xml = new \XmlWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     if ($this->version || $this->encoding) {
         $xml->startDocument($this->version, $this->encoding);
     }
     $xml->startElement($startElement);
     $this->writeEl($xml, $data);
     $xml->endElement();
     // write end element
     // returns the XML results
     return $xml->outputMemory(true);
 }
Exemplo n.º 14
0
 public function html($mysqli_stmt)
 {
     $xml = new XmlWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString("\t");
     $xml->startElement('table');
     $xml->writeAttribute('class', $this->tbl_class);
     $xml->startElement('thead');
     $xml->startElement('tr');
     //////////////////////////////////
     // Column Headers
     /////////////////////////////////
     $cntcol = count($this->col_classes);
     $altcol = 0;
     foreach (array_keys($this->cols) as $th) {
         $xml->startElement('th');
         $xml->writeAttribute('scope', 'col');
         if ($this->col_classes[$altcol] != "") {
             $xml->writeAttribute('class', $this->col_classes[$altcol]);
         }
         $altcol = ++$altcol % $cntcol;
         if (substr($th, 0, 2) == "__") {
             $xml->text('');
         } else {
             //Sorting
             $dir = "A";
             if (isset($_GET["sn"]) && $_GET["sn"] == $th && $_GET["sd"] == "A") {
                 $dir = "D";
             }
             $xml->startElement('a');
             $xml->startAttribute('href');
             $xml->writeRaw(quickgrid::get_href(["sn" => $th, "sd" => $dir, "p" => 1]));
             $xml->endAttribute();
             $xml->text($th);
             $xml->endElement();
             //a
         }
         $xml->endElement();
         //th
     }
     $xml->endElement();
     //tr
     $xml->endElement();
     //thead
     $xml->startElement('tfoot');
     $xml->startElement('tr');
     $xml->startElement('td');
     $xml->writeAttribute('colspan', count($this->cols));
     //////////////////////////////////
     // Pager
     /////////////////////////////////
     $last = ceil($this->row_count / $this->per_page);
     $length = 8;
     $lbound = $this->cur_page - $length / 2;
     $ubound = $this->cur_page + $length / 2;
     if ($lbound < 1) {
         $lbound = 1;
     }
     if ($ubound > $last) {
         $ubound = $last;
     }
     if ($this->cur_page != 1) {
         $xml->startElement('a');
         $xml->startAttribute('href');
         $xml->writeRaw(quickgrid::get_href(["p" => $this->cur_page - 1]));
         $xml->endAttribute();
         $xml->text("<");
         $xml->endElement();
         //a
     }
     for ($i = $lbound; $i <= $ubound; $i++) {
         if ($i != $this->cur_page) {
             $xml->startElement('a');
             $xml->startAttribute('href');
             $xml->writeRaw(quickgrid::get_href(["p" => $i]));
             $xml->endAttribute();
             $xml->text("{$i}");
             $xml->endElement();
             //a
         } else {
             $xml->startElement('span');
             $xml->text("{$i}");
             $xml->endElement();
             //span
         }
     }
     if ($this->cur_page != $last) {
         $xml->startElement('a');
         $xml->startAttribute('href');
         $xml->writeRaw(quickgrid::get_href(["p" => $this->cur_page + 1]));
         $xml->endAttribute();
         $xml->text(">");
         $xml->endElement();
         //a
     }
     $xml->endElement();
     //td
     $xml->endElement();
     //tr
     $xml->endElement();
     //tfoot
     $xml->startElement('tbody');
     //////////////////////////////////
     // Table Data
     /////////////////////////////////
     $cntrow = count($this->row_classes);
     $altrow = 0;
     $cntcol = count($this->col_classes);
     $altcol = 0;
     $result = $mysqli_stmt->get_result();
     while ($row = $result->fetch_assoc()) {
         $xml->startElement('tr');
         if ($this->row_classes[$altrow] != "") {
             $xml->writeAttribute('class', $this->row_classes[$altrow]);
         }
         $altrow = ++$altrow % $cntrow;
         foreach (array_keys($this->cols) as $th) {
             $xml->startElement('td');
             if ($this->col_classes[$altcol] != "") {
                 $xml->writeAttribute('class', $this->col_classes[$altcol]);
             }
             $altcol = ++$altcol % $cntcol;
             if (isset($this->td_formats[$th]) && is_callable($this->td_formats[$th])) {
                 $tmp = $this->td_formats[$th];
                 $xml->writeRaw(call_user_func($tmp, $row));
             } else {
                 $td = $this->cols[$th];
                 if (isset($row[$td])) {
                     $xml->text($row[$td]);
                 } else {
                     $xml->text('');
                 }
             }
             $xml->endElement();
             //td
         }
         $xml->endElement();
         //tr
     }
     $xml->endElement();
     //tbody
     $xml->endElement();
     //table
     return $xml->outputMemory();
 }
Exemplo n.º 15
0
 protected function init()
 {
     if (!$this->inited) {
         if (!$this->outputFilepath) {
             throw new \Exception('outputFilepath option is not valid');
         }
         $writer = new \XmlWriter();
         $writer->openUri('file://' . rawurlencode($this->outputFilepath));
         $writer->setIndent(true);
         $writer->startDocument('1.0', 'utf-8');
         $writer->startElement('SERVER');
         $this->xmlWriter = $writer;
         $this->inited = true;
     }
 }
Exemplo n.º 16
0
 /**
  * Serializes given array. The array indices must be string to use them as
  * as element name.
  * 
  * @param array $array      The object to serialize represented in array.
  * @param array $properties The used properties in the serialization process.
  * 
  * @return string
  */
 public function serialize($array, $properties = null)
 {
     $xmlVersion = '1.0';
     $xmlEncoding = 'UTF-8';
     $standalone = Utilities::tryGetValue($properties, self::STANDALONE);
     $defaultTag = Utilities::tryGetValue($properties, self::DEFAULT_TAG);
     $rootName = Utilities::tryGetValue($properties, self::ROOT_NAME);
     $docNamespace = Utilities::tryGetValue($array, Resources::XTAG_NAMESPACE, null);
     if (!is_array($array)) {
         return false;
     }
     $xmlw = new \XmlWriter();
     $xmlw->openMemory();
     $xmlw->setIndent(true);
     $xmlw->startDocument($xmlVersion, $xmlEncoding, $standalone);
     if (is_null($docNamespace)) {
         $xmlw->startElement($rootName);
     } else {
         foreach ($docNamespace as $uri => $prefix) {
             $xmlw->startElementNS($prefix, $rootName, $uri);
             break;
         }
     }
     unset($array[Resources::XTAG_NAMESPACE]);
     self::_arr2xml($xmlw, $array, $defaultTag);
     $xmlw->endElement();
     return $xmlw->outputMemory(true);
 }
Exemplo n.º 17
0
/**
 * Construct the whole DCAT-AP document given an array of dump info
 *
 * @param array $data data-blob of i18n and config variables
 * @return string: xmldata
 */
function outputXml(array $data)
{
    // Initializing the XML Object
    $xml = new XmlWriter();
    $xml->openMemory();
    $xml->setIndent(true);
    $xml->setIndentString('    ');
    // set namespaces
    $xml->startDocument('1.0', 'UTF-8');
    $xml->startElementNS('rdf', 'RDF', null);
    $xml->writeAttributeNS('xmlns', 'rdf', null, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');
    $xml->writeAttributeNS('xmlns', 'dcterms', null, 'http://purl.org/dc/terms/');
    $xml->writeAttributeNS('xmlns', 'dcat', null, 'http://www.w3.org/ns/dcat#');
    $xml->writeAttributeNS('xmlns', 'foaf', null, 'http://xmlns.com/foaf/0.1/');
    $xml->writeAttributeNS('xmlns', 'adms', null, 'http://www.w3.org/ns/adms#');
    $xml->writeAttributeNS('xmlns', 'vcard', null, 'http://www.w3.org/2006/vcard/ns#');
    // Calls previously declared functions to construct xml
    writePublisher($xml, $data);
    writeContactPoint($xml, $data);
    $dataset = array();
    // Live dataset and distributions
    $liveDistribs = writeDistribution($xml, $data, 'ld', null);
    if ($data['config']['api-enabled']) {
        $liveDistribs = array_merge($liveDistribs, writeDistribution($xml, $data, 'api', null));
    }
    array_push($dataset, writeDataset($xml, $data, null, $liveDistribs));
    // Dump dataset and distributions
    if ($data['config']['dumps-enabled']) {
        foreach ($data['dumps'] as $key => $value) {
            $distIds = writeDistribution($xml, $data, 'dump', $key);
            array_push($dataset, writeDataset($xml, $data, $key, $distIds));
        }
    }
    writeCatalog($xml, $data, $dataset);
    // Closing last XML node
    $xml->endElement();
    // Printing the XML
    return $xml->outputMemory(true);
}
Exemplo n.º 18
0
 /**
  * Function builds OpenPayU Xml Document
  * @access public
  * @param string $data
  * @param string $rootElement
  * @param string $version
  * @param string $encoding
  * @param string $rootElementXsi
  * @return string $xml
  */
 public static function buildXmlFromArray($data, $rootElement, $version = '1.0', $encoding = 'UTF-8', $rootElementXsi = null)
 {
     if (!is_array($data)) {
         return null;
     }
     $xml = new XmlWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->startDocument($version, $encoding);
     $xml->startElementNS(null, 'OpenPayU', 'http://www.openpayu.com/20/openpayu.xsd');
     $xml->startElement($rootElement);
     if (!empty($rootElementXsi)) {
         $xml->startAttributeNs('xsi', 'type', 'http://www.w3.org/2001/XMLSchema-instance');
         $xml->text($rootElementXsi);
         $xml->endAttribute();
     }
     self::convertArrayToXml($xml, $data);
     $xml->endElement();
     $xml->endElement();
     $xml->endDocument();
     return trim($xml->outputMemory(true));
 }
Exemplo n.º 19
0
 /**
  * Generates the XML output and saves it to a file or returns it as a string
  *
  * @return null|int Returns the number of bytes written to a local file or false on failure
  */
 protected function generate()
 {
     $w = new \XmlWriter();
     $w->openMemory();
     $w->setIndent(true);
     $w->setIndentString("    ");
     $w->startDocument('1.0', 'utf-8');
     $w->startElement($this->rootname);
     while ($object = $this->getRow()) {
         // Start a new row for each object
         $w->startElement($this->rowname);
         foreach ($object as $key => $value) {
             if ($this->suppress && in_array($key, $this->suppress)) {
                 continue;
             }
             $this->isValidName($key);
             // Check if the key contains another object
             if (is_object($value)) {
                 // Start parent element containing rows of each object
                 $w->startElement($key . "s");
                 // $value is an array of objects
                 foreach ($value as $obj) {
                     $w->startElement($key);
                     foreach ($obj as $field => $val) {
                         $this->isValidName($key);
                         $w->writeElement($field, $val);
                     }
                     $w->endElement();
                 }
                 $w->endElement();
             } else {
                 // Write each object's property->value as <key>value</key>
                 if ($this->hasChildren && in_array($key, $this->hasChildren)) {
                     $stripped = $this->stripHtml($value);
                     $w->startElement($key);
                     foreach ($stripped as $para) {
                         $w->writeElement('p', $para);
                     }
                     $w->endElement();
                 } else {
                     $w->writeElement($key, $value);
                 }
             }
         }
         $w->endElement();
     }
     $w->endElement();
     $w->endDocument();
     $this->xml = $w->outputMemory();
     // write to file
     if (isset($this->filename) && $this->local) {
         $success = file_put_contents($this->filename, $this->xml);
         return $success;
     } elseif (isset($this->filename) && $this->download) {
         $this->outputHeaders();
         file_put_contents('php://output', $this->xml);
         exit;
     }
 }
 public static function Obj2XML($obj)
 {
     $xml = new XmlWriter();
     $xml->openMemory();
     $xml->setIndent(TRUE);
     $xml->startElement(get_class($obj));
     $xml->writeAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
     $xml->writeAttribute("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
     self::getObject2XML($xml, $obj);
     $xml->endElement();
     $xml->endElement();
     return $xml->outputMemory(true);
 }
Exemplo n.º 21
0
<?php

$xml = new XmlWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->startDocument();
$xml->startElement('test');
$xml->writeElement('foo', null);
$xml->writeElement('foo2', "");
$xml->writeElement('foo3');
$xml->startElement('bar');
$xml->endElement('bar');
$xml->endElement();
$xml->endElement();
print $xml->flush(true);
print "\n";
$xw = new XMLWriter();
$xw->openMemory();
$xw->setIndent(true);
$xw->startDocument();
$xw->startElementNS('test', 'test', 'urn:x-test:');
$xw->writeElementNS('test', 'foo', null, '');
$xw->writeElementNS(null, 'bar', 'urn:x-test:', '');
$xw->writeElementNS(null, 'bar', 'urn:x-test:', NULL);
$xw->writeElementNS(null, 'bar', 'urn:x-test:');
$xw->writeElementNS(null, 'bar', '', '');
$xw->endElement();
$xw->endDocument();
print $xw->flush(true);
Exemplo n.º 22
0
 /**
  * Generates the XML output and saves it to a file or returns it as a string
  *
  * @return null|int Returns the number of bytes written to a local file or false on failure
  */
 protected function generate()
 {
     $w = new \XmlWriter();
     $w->openMemory();
     $w->setIndent(true);
     $w->setIndentString("    ");
     $w->startDocument('1.0', 'utf-8');
     $w->startElement($this->rootname);
     $row = $this->getRow();
     $keys = array_keys($row);
     foreach ($keys as $key) {
         $this->isValidName($key);
     }
     do {
         $w->startElement($this->rowname);
         foreach ($row as $key => $value) {
             if ($this->suppress && in_array($key, $this->suppress)) {
                 continue;
             }
             if ($this->hasChildren && in_array($key, $this->hasChildren)) {
                 $stripped = $this->stripHtml($value);
                 $w->startElement($key);
                 foreach ($stripped as $para) {
                     $w->writeElement('p', $para);
                 }
                 $w->endElement();
             } else {
                 $w->writeElement($key, $value);
             }
         }
         $w->endElement();
     } while ($row = $this->getRow());
     $w->endElement();
     $w->endDocument();
     $this->xml = $w->outputMemory();
     // write to file
     if (isset($this->filename) && $this->local) {
         $success = file_put_contents($this->filename, $this->xml);
         return $success;
     } elseif (isset($this->filename) && $this->download) {
         $this->outputHeaders();
         file_put_contents('php://output', $this->xml);
         exit;
     }
 }
Exemplo n.º 23
0
 /**
  * Serializes the atom into XML representation.
  * 
  * @param array $properties The atom properties.
  * 
  * @return string
  */
 private function _serializeAtom($properties)
 {
     $xmlw = new \XmlWriter();
     $xmlw->openMemory();
     $xmlw->setIndent(true);
     $xmlw->startDocument(strtoupper($this->_xmlVersion), $this->_xmlEncoding, 'yes');
     $xmlw->startElementNS(null, 'entry', $this->_atomNamespaceName);
     $xmlw->writeAttribute("xmlns:{$this->_dataServicesPrefix}", $this->_dataServicesNamespaceName);
     $xmlw->writeAttribute("xmlns:{$this->_dataServicesMetadataPrefix}", $this->_dataServicesMetadataNamespaceName);
     $xmlw->writeElement('title');
     $xmlw->writeElement('updated', Utilities::isoDate());
     $xmlw->startElement('author');
     $xmlw->writeElement('name');
     $xmlw->endElement();
     $xmlw->writeElement('id');
     $xmlw->startElement('content');
     $xmlw->writeAttribute('type', Resources::XML_CONTENT_TYPE);
     $xmlw->startElementNS($this->_dataServicesMetadataPrefix, 'properties', null);
     $this->_generateProperties($xmlw, $properties);
     $xmlw->endElement();
     $xmlw->endElement();
     $xmlw->endElement();
     return $xmlw->outputMemory(true);
 }