Lines Matching defs:text
51 * Check of the text is a valid XML
52 * @param $text
55 public static function isXml($text)
60 new XmlDocument($text);
71 * @param $text
76 public static function format($text)
78 if (empty($text)) {
79 throw new \Exception("The text should not be empty");
82 $doc->loadXML($text);
92 * @param $text
96 public static function normalize($text)
98 if (empty($text)) {
99 throw new ExceptionBadSyntax("The text should not be empty");
101 $xmlDoc = new XmlDocument($text, XmlDocument::XML_TYPE);
109 * @param $text
112 public static function extractTextWithoutCdata($text)
114 $text = str_replace("/*<![CDATA[*/", "", $text);
115 $text = str_replace("/*!]]>*/", "", $text);
116 $text = str_replace("\/", "/", $text);
117 return $text;
120 public static function preprocessText($text)
129 * Tip: To get the text of a node:
251 if ($leftNode->nodeName == "#text") {
278 if ($leftChildNode->nodeName == "#text") {
287 if ($rightChildNode->nodeName == "#text") {
330 throw new \RuntimeException("The right text should not be empty");
335 throw new \RuntimeException("The left text should not be empty");