当前位置: 首页>>代码示例>>PHP>>正文


PHP DOMDocument::SaveXML方法代码示例

本文整理汇总了PHP中DOMDocument::SaveXML方法的典型用法代码示例。如果您正苦于以下问题:PHP DOMDocument::SaveXML方法的具体用法?PHP DOMDocument::SaveXML怎么用?PHP DOMDocument::SaveXML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DOMDocument的用法示例。


在下文中一共展示了DOMDocument::SaveXML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: enclose_nodes_by_chunk_mark_tag

 /**
  * Alters the dom to enclose the specified nodes with the micro-update
  * livepress mark tag.
  *
  * @access private
  *
  * @param array       $nodes       List of nodes to be enclosed.
  * @param DOMNode     $parent_node Parent node where the nodes will be enclosed.
  * @param DOMDocument $dom         The DOM where the nodes belongs.
  * @param array       $current_ids All the current used ids on updates.
  * @param DOMNode     $ref_node    The nodes will be inserted before this one.
  */
 private function enclose_nodes_by_chunk_mark_tag($nodes, $parent_node, $dom, $current_ids, $ref_node = null)
 {
     $chunk_mark = $dom->createElement(self::$chunks_tag);
     $chunk_id = $this->next_post_update_id($current_ids);
     $chunk_mark->setAttribute('id', $chunk_id);
     // Useful for one-line oEmbeds
     $chunk_mark->appendChild($dom->createTextNode("\n"));
     foreach ($nodes as $node) {
         $chunk_mark->appendChild($node);
     }
     // Useful for one-line oEmbeds
     $chunk_mark->appendChild($dom->createTextNode("\n"));
     $output = $dom->SaveXML($chunk_mark);
     $chunks_class = self::$chunks_class;
     if (preg_match('/\\[livepress_metainfo.+has_avatar.*\\]/s', $output)) {
         $chunks_class .= " " . self::$add_to_chunks_class_when_avatar;
     }
     $chunk_mark->setAttribute('class', $chunks_class);
     if ($ref_node) {
         $parent_node->insertBefore($chunk_mark, $ref_node);
     } else {
         $parent_node->appendChild($chunk_mark);
     }
 }
开发者ID:humanmade,项目名称:vip-mu-plugins-public,代码行数:36,代码来源:livepress-post.php

示例2: header

    $XmlRoot->appendChild($Item = $XmlDoc->createElement('addressvegas'));
    $Item->appendChild($XmlDoc->createCDATASection(sprintf($URLTemplate, 'IanseoVegas.php')));
    $XmlRoot->appendChild($Item = $XmlDoc->createElement('addresstowin'));
    $Item->appendChild($XmlDoc->createCDATASection('http://localhost:8888/ianseo/Modules/Boinx/Ianseoxtowin.xml'));
    $XmlRoot->appendChild($Item = $XmlDoc->createElement('danagetiming'));
    $Item->appendChild($XmlDoc->createCDATASection(sprintf($URLTemplate, '../DanageDisplay/Timing.php')));
    $XmlRoot->appendChild($Item = $XmlDoc->createElement('roundrobinscore'));
    $Item->appendChild($XmlDoc->createCDATASection(sprintf($URLTemplate, 'IanseoScoresRR.php')));
    $XmlRoot->appendChild($Item = $XmlDoc->createElement('roundrobinrank'));
    $Item->appendChild($XmlDoc->createCDATASection(sprintf($URLTemplate, 'IanseoQualRR.php')));
    // We'll be outputting a XML
    // It will be called boinxianseo.xml
    header('Cache-Control: no-store, no-cache, must-revalidate');
    header('Content-type: text/xml; charset=' . PageEncode);
    header('Content-Disposition: attachment; filename="boinxianseo.xml"');
    echo $XmlDoc->SaveXML();
    die;
}
chdir('Layers');
$Layers = glob('*.qtz');
if (!empty($_GET['Layer']) and in_array($_GET['Layer'], $Layers)) {
    // We'll be outputting a boix layer
    header('Content-type: application/x-quartzcomposer');
    // It will be called boinxianseo.xml
    header('Content-Disposition: attachment; filename="' . stripslashes($_GET['Layer']) . '"');
    readfile(stripslashes($_GET['Layer']));
    die;
}
require_once 'Common/Fun_FormatText.inc.php';
$PAGE_TITLE = get_text('TitleTourMenu', 'Tournament');
include 'Common/Templates/head.php';
开发者ID:brian-nelson,项目名称:ianseo,代码行数:31,代码来源:index.php

示例3: XML

 function XML()
 {
     global $CFG;
     $XmlDoc = new DOMDocument('1.0', 'UTF-8');
     $XmlRoot = $XmlDoc->createElement('FileList');
     $XmlRoot->setAttribute('Count', $this->count());
     $XmlDoc->appendChild($XmlRoot);
     foreach ($this->Files as $detail) {
         $FileNode = $XmlDoc->createElement('File');
         $XmlRoot->appendChild($FileNode);
         $tmpNode = $XmlDoc->createElement('Name', str_replace("//", "/", str_replace($CFG->DOCUMENT_PATH, "", $detail)));
         $FileNode->appendChild($tmpNode);
         if ($this->boolShowSize) {
             $tmpNode = $XmlDoc->createElement('Size', filesize($detail));
             $FileNode->appendChild($tmpNode);
         }
         if ($this->boolShowMD5) {
             $tmpNode = $XmlDoc->createElement('MD5', md5_file($detail));
             $FileNode->appendChild($tmpNode);
         }
     }
     return $XmlDoc->SaveXML();
 }
开发者ID:brian-nelson,项目名称:ianseo,代码行数:23,代码来源:FileList.php


注:本文中的DOMDocument::SaveXML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。