當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Xml::createCData方法代碼示例

本文整理匯總了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;
 }
開發者ID:komcdo,項目名稱:winnow,代碼行數:32,代碼來源:WXmlUtils.class.php

示例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));
     }
 }
開發者ID:ralcr,項目名稱:Apple-s-Dictionary-App-database-generator,代碼行數:8,代碼來源:Xml.class.php

示例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));
     }
 }
開發者ID:marcdraco,項目名稱:Webrathea,代碼行數:15,代碼來源:Xml.class.php

示例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));
     }
 }
開發者ID:komcdo,項目名稱:winnow,代碼行數:15,代碼來源:Xml.class.php

示例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));
         }
     }
 }
開發者ID:slaskis,項目名稱:hxsinatra,代碼行數:13,代碼來源:Xml.class.php


注:本文中的Xml::createCData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。