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


PHP XMLStringer::startXML方法代碼示例

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


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

示例1: toXML

 public function toXML($env)
 {
     $xs = new XMLStringer();
     $xs->startXML();
     $xs->elementStart('me:env', array('xmlns:me' => MagicEnvelope::NS));
     $xs->element('me:data', array('type' => $env['data_type']), $env['data']);
     $xs->element('me:encoding', null, $env['encoding']);
     $xs->element('me:alg', null, $env['alg']);
     $xs->element('me:sig', null, $env['sig']);
     $xs->elementEnd('me:env');
     $string = $xs->getString();
     common_debug($string);
     return $string;
 }
開發者ID:Br3nda,項目名稱:statusnet-debian,代碼行數:14,代碼來源:magicenvelope.php

示例2: toXML

 /**
  * Create an <me:env> XML representation of the envelope.
  *
  * @return string representation of XML document
  */
 public function toXML()
 {
     $xs = new XMLStringer();
     $xs->startXML();
     $xs->elementStart('me:env', array('xmlns:me' => self::NS));
     $xs->element('me:data', array('type' => $this->data_type), $this->data);
     $xs->element('me:encoding', null, $this->encoding);
     $xs->element('me:alg', null, $this->alg);
     $xs->element('me:sig', null, $this->getSignature());
     $xs->elementEnd('me:env');
     $string = $xs->getString();
     return $string;
 }
開發者ID:phpsource,項目名稱:gnu-social,代碼行數:18,代碼來源:magicenvelope.php

示例3: toXML

 /**
  * Create an <me:env> XML representation of the envelope.
  *
  * @return string representation of XML document
  */
 public function toXML(Profile $target = null, $flavour = null)
 {
     $xs = new XMLStringer();
     $xs->startXML();
     // header, to point out it's not HTML or anything...
     if (Event::handle('StartMagicEnvelopeToXML', array($this, $xs, $flavour, $target))) {
         // fall back to our default, normal Magic Envelope XML.
         // the $xs element _may_ have had elements added, or could get in the end event
         $xs->elementStart('me:env', array('xmlns:me' => self::NS));
         $xs->element('me:data', array('type' => $this->data_type), $this->data);
         $xs->element('me:encoding', null, $this->encoding);
         $xs->element('me:alg', null, $this->alg);
         $xs->element('me:sig', null, $this->getSignature());
         $xs->elementEnd('me:env');
         Event::handle('EndMagicEnvelopeToXML', array($this, $xs, $flavour, $target));
     }
     return $xs->getString();
 }
開發者ID:bashrc,項目名稱:gnusocial-debian,代碼行數:23,代碼來源:magicenvelope.php

示例4: toXML

 public function toXML()
 {
     $xs = new XMLStringer();
     $xs->startXML();
     $xs->elementStart('XRD', array('xmlns' => XRD::XRD_NS));
     if ($this->host) {
         $xs->element('hm:Host', array('xmlns:hm' => XRD::HOST_META_NS), $this->host);
     }
     if ($this->expires) {
         $xs->element('Expires', null, $this->expires);
     }
     if ($this->subject) {
         $xs->element('Subject', null, $this->subject);
     }
     foreach ($this->alias as $alias) {
         $xs->element('Alias', null, $alias);
     }
     foreach ($this->links as $link) {
         $titles = array();
         if (isset($link['title'])) {
             $titles = $link['title'];
             unset($link['title']);
         }
         $xs->elementStart('Link', $link);
         foreach ($titles as $title) {
             $xs->element('Title', null, $title);
         }
         $xs->elementEnd('Link');
     }
     $xs->elementEnd('XRD');
     return $xs->getString();
 }
開發者ID:stevertiqo,項目名稱:StatusNet,代碼行數:32,代碼來源:xrd.php


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