本文整理汇总了PHP中xml::output方法的典型用法代码示例。如果您正苦于以下问题:PHP xml::output方法的具体用法?PHP xml::output怎么用?PHP xml::output使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xml
的用法示例。
在下文中一共展示了xml::output方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: class
$xml->setElement('field', 'repository class (combine release&arch)', array('name' => 'repoclass'));
$xml->endSection();
if ($nres > $start) {
$repos = null;
$pkg->find(null, $start);
for ($i = $start; $i < $to; $i++) {
$pkg->find();
$xml->startSection('result', array('id' => $i));
$xml->fromArray(array('rank' => 10000 * $pkg->rank, 'pkgname' => $pkg->name, 'pkgver' => $pkg->version, 'pkgarch' => $pkg->arch, 'pkgloc' => $pkg->location, 'pkgfile' => $pkg->filename, 'pkgurl' => $pkg->url . $pkg->location . "/" . $pkg->filename, 'repover' => $pkg->repover, 'reponame' => $pkg->reponame, 'repoid' => $pkg->repoid, 'repourl' => $pkg->url, 'repoarch' => $pkg->repoarch, 'repoclass' => $pkg->repoclass));
$xml->endSection();
// echo (10000*$pkg->rank).$fs.$pkg->name.$fs.$pkg->version.$fs.$pkg->arch.$fs.$pkg->location.$fs.$pkg->filename.$fs.$pkg->url.$pkg->location."/".$pkg->filename.$fs.
// $pkg->repover.$fs.$pkg->reponame.$fs.$pkg->repoid.$fs.$pkg->url."\n";
}
}
$xml->endSection();
$xml->output();
} else {
/////////////////////////////////////////////////// MANIFEST.bz2 RESULTS ///////////////////////////////////////////////////////////
switch ($order) {
case "ranku":
$ord = 'rank desc';
break;
case "rankd":
$ord = 'rank';
break;
case "pkgu":
$ord = 'pkgname';
break;
case "pkgd":
$ord = 'pkgname desc';
break;
示例2: buildCap
/**
* Put CAP 1.2 content in $this->cap
*
* @return None
*/
function buildCap($cap)
{
$xml = new xml('1.0', 'utf-8', array('standalone' => 'yes'));
$xml->tag_open('alert', array('xmlns' => 'urn:oasis:names:tc:emergency:cap:1.2'));
$xml->tag_simple('identifier', $cap['identifier']);
$xml->tag_simple('sender', $cap['sender']);
$xml->tag_simple('sent', $cap['sent']);
$xml->tag_simple('status', $cap['status']);
$xml->tag_simple('msgType', $cap['msgType']);
$xml->tag_simple('references', $cap['references']);
$xml->tag_simple('scope', $cap['scope']);
$xml->tag_simple('source', $cap['source']);
$xml->tag_simple('restriction', $cap['restriction']);
$xml->tag_simple('addresses', $cap['addresses']);
$xml->tag_simple('code', $cap['code']);
$xml->tag_simple('note', $cap['note']);
$xml->tag_simple('incidents', $cap['incidents']);
foreach ($cap['info'] as $info) {
$xml->tag_open('info');
$xml->tag_simple('language', $info['language']);
$xml->tag_simple('category', $info['category']);
$xml->tag_simple('event', $info['event']);
$xml->tag_simple('responseType', $info['responseType']);
$xml->tag_simple('urgency', $info['urgency']);
$xml->tag_simple('severity', $info['severity']);
$xml->tag_simple('certainty', $info['certainty']);
$xml->tag_simple('audience', $info['audience']);
if (!empty($info['eventCode'][0]['valueName'])) {
foreach ($info['eventCode'] as $key => $eventCode) {
$xml->tag_open('eventCode');
$xml->tag_simple('valueName', $eventCode['valueName']);
$xml->tag_simple('value', $eventCode['value']);
$xml->tag_close('eventCode');
}
}
$xml->tag_simple('effective', $info['effective']);
$xml->tag_simple('onset', $info['onset']);
$xml->tag_simple('expires', $info['expires']);
$xml->tag_simple('senderName', $info['senderName']);
$xml->tag_simple('headline', $info['headline']);
$xml->tag_simple('description', $info['description']);
$xml->tag_simple('instruction', $info['instruction']);
$xml->tag_simple('web', $info['web']);
$xml->tag_simple('contact', $info['contact']);
if (!empty($info['parameter'][0]['valueName'])) {
foreach ($info['parameter'] as $key => $parameter) {
$xml->tag_open('parameter');
$xml->tag_simple('valueName', $parameter['valueName']);
$xml->tag_simple('value', $parameter['value']);
$xml->tag_close('parameter');
}
}
// foreach parameter
// look if area zone is used
foreach ($info['area'] as $key => $area) {
$xml->tag_open('area');
$xml->tag_simple('areaDesc', $area['areaDesc']);
$xml->tag_simple('polygon', $area['polygon']);
$xml->tag_simple('circle', $area['circle']);
if (!empty($area['geocode'][0]['valueName'])) {
foreach ($area['geocode'] as $key => $geocode) {
$xml->tag_open('geocode');
$xml->tag_simple('valueName', $geocode['valueName']);
$xml->tag_simple('value', $geocode['value']);
$xml->tag_close('geocode');
}
}
// foreach geocode
$xml->tag_close('area');
}
$xml->tag_close('info');
}
// Foreach info lang
$xml->tag_close('alert');
$this->cap = $xml->output();
}