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