本文整理匯總了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));
}
}
}