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


PHP CDataXML::xmlspecialchars方法代码示例

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


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

示例1: getXML

 public function getXML()
 {
     if (!$this->tag) {
         return "";
     }
     $xml = "<" . CDataXML::xmlspecialchars($this->tag) . $this->_getAttributs() . ">";
     $xml .= $this->startCDATA;
     $xml .= $this->data;
     $xml .= $this->endCDATA;
     $xml .= $this->_getChildren();
     $xml .= "</" . CDataXML::xmlspecialchars($this->tag) . ">";
     return $xml;
 }
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:13,代码来源:xmlcreator.php

示例2: switch

 function &__toString()
 {
     switch ($this->name) {
         case "cdata-section":
             $ret = "<![CDATA[";
             $ret .= $this->content;
             $ret .= "]]>";
             break;
         default:
             $isOneLiner = false;
             if (count($this->children) == 0 && $this->content == '') {
                 $isOneLiner = true;
             }
             $attrStr = "";
             if (is_array($this->attributes)) {
                 foreach ($this->attributes as $attr) {
                     $attrStr .= " " . $attr->name . "=\"" . CDataXML::xmlspecialchars($attr->content) . "\" ";
                 }
             }
             if ($isOneLiner) {
                 $oneLinerEnd = " /";
             } else {
                 $oneLinerEnd = "";
             }
             $ret = "<" . $this->name . $attrStr . $oneLinerEnd . ">";
             if (is_array($this->children)) {
                 foreach ($this->children as $child) {
                     $ret .= $child->__toString();
                 }
             }
             if (!$isOneLiner) {
                 if ($this->content != '') {
                     $ret .= CDataXML::xmlspecialchars($this->content);
                 }
                 $ret .= "</" . $this->name . ">";
             }
             break;
     }
     return $ret;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:40,代码来源:xml.php

示例3: UpdateListItems

 public function UpdateListItems($listName, $arChanges)
 {
     $arMethodParams = array('listName' => $listName);
     $updates = CXMLCreator::createTagAttributed('Batch OnError="Continue" DateInUtc="TRUE" Properties="TRUE"');
     $i = 0;
     foreach ($arChanges as $row) {
         $obRow = CXMLCreator::createTagAttributed('Method ID="' . $i++ . '"');
         if ($ID = intval($row['ID'])) {
             $obRow->setAttribute('Cmd', 'Update');
         } else {
             $obRow->setAttribute('Cmd', 'New');
             unset($row['ID']);
             $obRow->addChild(CXMLCreator::createTagAttributed('Field Name="ID"', 'New'));
             $obRow->addChild(CXMLCreator::createTagAttributed('Field Name="MetaInfo" Property="ReplicationID"', $row['ReplicationID']));
             unset($row['ReplicationID']);
         }
         foreach ($row as $fld => $value) {
             if (substr($fld, 0, 9) == 'MetaInfo_') {
                 $obRow->addChild(CXMLCreator::createTagAttributed('Field Name="MetaInfo" Property="' . CDataXML::xmlspecialchars(substr($fld, 9)) . '"', $value));
             } else {
                 if ($fld) {
                     $obRow->addChild(CXMLCreator::createTagAttributed('Field Name="' . CDataXML::xmlspecialchars($fld) . '"', $value));
                 }
             }
         }
         $updates->addChild($obRow);
     }
     $arMethodParams['updates'] = $updates;
     $RESULT = false;
     if ($this->__initialize() && $this->Call('UpdateListItems', $arMethodParams) && ($DOM = $this->RESPONSE->DOMDocument)) {
         $RESULT = array();
         $arResults = $DOM->elementsByName('Result');
         foreach ($arResults as $resultNode) {
             $arRes = array('ErrorCode' => $resultNode->children[0]->textContent(), 'Row' => $this->ConvertRows($resultNode));
             if ($arRes['Row']) {
                 $arRes['Row'] = $arRes['Row'][0];
             }
             $RESULT[] = $arRes;
         }
     }
     $fp = fopen($_SERVER['DOCUMENT_ROOT'] . '/sp_client5.log', 'a');
     fwrite($fp, $this->getRawRequest());
     fwrite($fp, $this->getRawResponse());
     fwrite($fp, "\n==========================================\n\n");
     fclose($fp);
     return $RESULT;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:47,代码来源:client.php


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