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


PHP xml::setPath方法代码示例

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


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

示例1: string

 # get the project main description
 $main = $xmlClass->get_xml_element("main", $project);
 # initialize string class
 $stringClass = new string();
 # execute text2html function
 /*
 $name = $stringClass->text2html($name);
 $by = $stringClass->text2html($by);
 $intro = $stringClass->text2html($intro);
 $main = $stringClass->text2html($main);
 */
 #################
 # start XML creation process (MAIN FILE)
 $xmlClass->createXMLFile();
 # set the Path of the file
 $xmlClass->setPath("misc/groupware/writeable/projects/shared/" . $_GET['id'] . "/main.xml");
 ##############################ATTENTION!!!
 $xmlClass->setOverwrite(true);
 # add comment
 $xmlClass->add_comment(XML_CLASS_COMMENT);
 # open XML element
 $xmlClass->open_xml_element("main");
 # add XML element (Name)
 $xmlClass->add_xml_element("name", $name);
 # add XML element (MOTD)
 $xmlClass->add_xml_element("motd", $intro);
 # add XML element (Description)
 $xmlClass->add_xml_element("description", $main);
 # add XML element (Main block)
 $xmlClass->add_xml_element("MainBlock", "This is only a test text to view results of webpages parsing. Modify me!");
 # add XML element (ChangeLog)
开发者ID:BackupTheBerlios,项目名称:yac-svn,代码行数:31,代码来源:section.php

示例2: xml

} else {
    # create XML object
    $xmlClass = new xml();
    # start XML file cration
    $xmlClass->createXMLFile();
    # eregi all whitespaces from string
    $docTitle = eregi_replace(" ", "_", $_POST['title']);
    # if is checked the option `[crea categoria]' create a new directory in the
    # FlatDoc writeable directory
    if ($_POST['category'] == "[crea categoria]" and !file_exists(FNDOC_WRITEABLE . $_POST['newCategory'])) {
        if (mkdir(FNDOC_WRITEABLE . $_POST['newCategory'])) {
            echo "Categoria creata con successo!";
            $_POST['category'] = $_POST['newCategory'];
        } else {
            trigger_error("Impossiile creare la directory `" . $_POST['newCategory'] . "' in `" . FNDOC_WRITEABLE . "'", E_USER_ERROR);
        }
    } elseif ($_POST['category'] == "[crea categoria]") {
        trigger_error("Categoria già esistente, inserisco all'interno il documento.", E_USER_NOTICE);
        $_POST['category'] = $_POST['newCategory'];
    }
    # set XML file path
    $xmlClass->setPath(FNDOC_WRITEABLE . $_POST['category'] . "/" . $_POST['docPage'] . ".xml");
    # add Name XMLElement to contents
    $xmlClass->add_XML_element("name", $_POST['title']);
    # add MainText XMLElement to contents
    $xmlClass->add_XML_element("mainText", $_POST['mainText']);
    # set overwrite variable to true
    $xmlClass->setOverWrite(true);
    # complete XML file creation
    $xmlClass->closeXMLFile();
}
开发者ID:BackupTheBerlios,项目名称:yac-svn,代码行数:31,代码来源:section.php


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