当前位置: 首页>>代码示例>>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;未经允许,请勿转载。