當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleXMLElement::saveXml方法代碼示例

本文整理匯總了PHP中SimpleXMLElement::saveXml方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleXMLElement::saveXml方法的具體用法?PHP SimpleXMLElement::saveXml怎麽用?PHP SimpleXMLElement::saveXml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleXMLElement的用法示例。


在下文中一共展示了SimpleXMLElement::saveXml方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getResultsXml

 public function getResultsXml()
 {
     $xml = new SimpleXMLElement('<stats/>');
     $xml->clients = $this->_stats->clients;
     $xml->domains = $this->_stats->domains;
     $xml->mail_boxes = $this->_stats->mail_boxes;
     $xml->databases = $this->_stats->databases;
     return (string) $xml->saveXml();
 }
開發者ID:plesk,項目名稱:pm-exercises,代碼行數:9,代碼來源:Reporter.php

示例2: setXml

 /**
  * Set XML
  *
  * @param SimpleXMLElement $xml OSM XML
  *
  * @return Services_OpenStreetMap_Comment
  */
 public function setXml(SimpleXMLElement $xml)
 {
     $this->xml = $xml->saveXml();
     $obj = $xml->xpath('//' . $this->getType());
     $kids = array();
     foreach ($obj[0]->children() as $child) {
         $key = (string) $child->attributes()->k;
         if ($key != '') {
             $this->tags[$key] = (string) $child->attributes()->v;
         }
         $name = (string) $child->getName();
         $kids[$name] = (string) $child;
     }
     $this->tags = $kids;
     if (isset($kids['id'])) {
         $this->setId($kids['id']);
     }
     $this->obj = $obj;
     return $this;
 }
開發者ID:AndrOrt,項目名稱:Services_Openstreetmap,代碼行數:27,代碼來源:Comment.php

示例3: setXml

 /**
  * Set XML.
  *
  * @param SimpleXMLElement $xml OSM XML
  *
  * @return Services_OpenStreetMap_Object
  */
 public function setXml(SimpleXMLElement $xml)
 {
     $this->xml = $xml->saveXml();
     $obj = $xml->xpath('//' . $this->getType());
     foreach ($obj[0]->children() as $child) {
         $key = (string) $child->attributes()->k;
         if ($key != '') {
             $this->tags[$key] = (string) $child->attributes()->v;
         }
     }
     $this->obj = $obj;
     return $this;
 }
開發者ID:AndrOrt,項目名稱:Services_Openstreetmap,代碼行數:20,代碼來源:Object.php

示例4: setXml

 /**
  * Set XML
  *
  * @param SimpleXMLElement $xml OSM XML
  *
  * @return Services_OpenStreetMap_Note
  */
 public function setXml(SimpleXMLElement $xml)
 {
     $this->xml = $xml->saveXml();
     $obj = $xml->xpath('//' . $this->getType());
     $kids = array();
     foreach ($obj[0]->children() as $child) {
         $key = (string) $child->attributes()->k;
         if ($key != '') {
             $this->tags[$key] = (string) $child->attributes()->v;
         }
         $name = (string) $child->getName();
         if ($name == 'comments') {
             $comments = array();
             foreach ($child->children() as $gchild) {
                 $comment = new Services_OpenStreetMap_Comment();
                 $comment->setXml($gchild);
                 $comments[] = $comment;
             }
             $kids[] = $comments;
         } elseif ($name == 'id') {
             $this->setId((double) $child);
         }
     }
     $this->comments = new Services_OpenStreetMap_Comments($comments);
     $this->tags = $kids;
     $this->obj = $obj;
     return $this;
 }
開發者ID:AndrOrt,項目名稱:Services_Openstreetmap,代碼行數:35,代碼來源:Note.php


注:本文中的SimpleXMLElement::saveXml方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。