Lines Matching +defs:text +defs:xml

33  * A xml document that follows the Web Api interface.
44 const XML_TYPE = "xml";
62 const CANONICAL = "xml";
75 * @param $text
77 * @throws ExceptionBadSyntax - if the document is not valid or the lib xml is not available
82 public function __construct($text, string $type = self::XML_TYPE)
85 if (empty($text)) {
86 throw new ExceptionBadSyntax("The xml text markup should not be empty.", self::CANONICAL);
92 throw new ExceptionBadSyntax("The php `libxml` module was not found on your installation, the xml/svg file could not be modified / instantiated", self::CANONICAL);
131 $text = $this->processTextBeforeLoading($text);
145 $result = $this->domDocument->loadXML($text, $options);
158 * (ie <xml encoding="utf-8"..>
164 $htmlEntityEncoded = mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8');
202 $message .= "Error: " . $error->message . ", Loaded text: " . $text;
211 // The xml dom object is null, we got NULL pointer exception everywhere
335 * LIBXML_NOXMLDECL (no xml declaration) does not work because only empty tag is recognized
358 * sudo apt-get install php-xml
365 $suffixBadMessage = "php extension is not installed. To install it, you need to install xml. Example: `sudo apt-get install php-xml`, `yum install php-xml`";
372 $loaded = extension_loaded("xml");
374 LogUtility::msg("The xml {$suffixBadMessage}");
562 * @param DOMElement $xml
565 function addAttributeValue($attName, $attValue, $xml)
573 $value = $xml->getAttribute($attName);
575 $xml->setAttribute($attName, $attValue);
577 $actualAttValue = $xml->getAttribute($attName);
580 $xml->setAttribute($attName, (string)$actualAttValue . " $attValue");
623 * If the text was a list
624 * of sibling text without parent
651 private function processTextBeforeLoading($text)
653 $text = str_replace(DOKU_LF, "", $text);
654 $text = preg_replace("/\r\n\s*\r\n/", "\r\n", $text);
655 $text = preg_replace("/\n\s*\n/", "\n", $text);
656 $text = preg_replace("/\n\n/", "\n", $text);
657 return $text;