本文整理汇总了PHP中Xml::createCData方法的典型用法代码示例。如果您正苦于以下问题:PHP Xml::createCData方法的具体用法?PHP Xml::createCData怎么用?PHP Xml::createCData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xml
的用法示例。
在下文中一共展示了Xml::createCData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: importXml
static function importXml($elem, $model)
{
$n = null;
if ($elem->nodeType == Xml::$Element) {
$n = Xml::createElement($elem->getNodeName());
$keys = $elem->attributes();
while ($keys->hasNext()) {
$key = $keys->next();
$n->set($key, $elem->get($key));
unset($key);
}
$children = $elem->iterator();
while ($children->hasNext()) {
$n->addChild(com_wiris_util_xml_WXmlUtils::importXml($children->next(), $model));
}
} else {
if ($elem->nodeType == Xml::$Document) {
$n = com_wiris_util_xml_WXmlUtils::importXml($elem->firstElement(), $model);
} else {
if ($elem->nodeType == Xml::$CData) {
$n = Xml::createCData($elem->getNodeValue());
} else {
if ($elem->nodeType == Xml::$PCData) {
$n = Xml::createPCData($elem->getNodeValue());
} else {
throw new HException("Unsupported node type: " . Std::string($elem->nodeType));
}
}
}
}
return $n;
}
示例2: __character_data_handler
static function __character_data_handler($parser, $data)
{
if (strlen($data) === 1 && htmlentities($data) != $data || htmlentities($data) == $data) {
Xml::$build->addChild(Xml::createPCData(htmlentities($data)));
} else {
Xml::$build->addChild(Xml::createCData($data));
}
}
示例3: __character_data_handler
static function __character_data_handler($parser, $data)
{
$d = Xml::__decodeent($data);
if (strlen($data) === 1 && $d !== $data || $d === $data) {
$last = Xml::$build->_children[Xml::$build->_children->length - 1];
if (null !== $last && (is_object($_t = $last->nodeType) && !$_t instanceof Enum ? $_t === Xml::$PCData : $_t == Xml::$PCData)) {
$_g = $last;
$_g->set_nodeValue(_hx_string_or_null($_g->get_nodeValue()) . _hx_string_or_null($d));
} else {
Xml::$build->addChild(Xml::createPCData($d));
}
} else {
Xml::$build->addChild(Xml::createCData($data));
}
}
示例4: __character_data_handler
static function __character_data_handler($parser, $data)
{
$d = Xml::__decodeent($data);
if (strlen($data) === 1 && $d !== $data || $d === $data) {
$last = Xml::$build->_children[Xml::$build->_children->length - 1];
if (null !== $last && $last->nodeType == Xml::$PCData) {
$_g = $last;
$_g->setNodeValue($_g->getNodeValue() . $d);
} else {
Xml::$build->addChild(Xml::createPCData($d));
}
} else {
Xml::$build->addChild(Xml::createCData($data));
}
}
示例5: __character_data_handler
static function __character_data_handler($parser, $data)
{
$lc = Xml::$build->_children === null || Xml::$build->_children->length === 0 ? null : Xml::$build->_children[Xml::$build->_children->length - 1];
if ($lc !== null && Xml::$PCData == $lc->nodeType) {
$lc->setNodeValue($lc->getNodeValue() . htmlentities($data));
} else {
if (strlen($data) === 1 && htmlentities($data) != $data || htmlentities($data) == $data) {
Xml::$build->addChild(Xml::createPCData(htmlentities($data)));
} else {
Xml::$build->addChild(Xml::createCData($data));
}
}
}