XML CDATA Use to get the original node content details code Introduction
String withoutcdata = "<?xml version=\" 1.0\ "encoding=\" utf-8\ "?>" + "<result><data><script >alert (\ "\");</script></data></result> "; XmlDocument doc = new XmlDocument (); Doc. LOADXML (withoutcdata); String value = Doc. selectSingleNode ("Result/data"). InnerText; Value = alert (\ "\"), where "<script></script>" is processed, not all node content string withcdata = "<?xml version=\" 1.0\ "encoding=\" utf-8\ "?>" + "<result><data><![ Cdata[<script>alert (\ "\");</script>]]></data></result> "; Doc. LOADXML (withcdata); String orivalue = Doc. selectSingleNode ("Result/data"). InnerText; Orivale = <script>alert (\ "\"); </script> so it takes all the node content.
The above is the use of XML CDATA to get the original node content of the details of the code introduced content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!