本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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();
}