From 22cf19e174bcee88b44968f2773d1bad2da2b54d Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 18 Jul 2012 03:59:10 -0700 Subject: bad sync with github windows client --- .../extras/ConfigDoc/HTMLXSLTProcessor.php | 86 ---------------------- 1 file changed, 86 deletions(-) delete mode 100644 lib/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php (limited to 'lib/htmlpurifier/extras/ConfigDoc') diff --git a/lib/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php b/lib/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php deleted file mode 100644 index f7095285b..000000000 --- a/lib/htmlpurifier/extras/ConfigDoc/HTMLXSLTProcessor.php +++ /dev/null @@ -1,86 +0,0 @@ -xsltProcessor = $proc; - } - - /** - * @note Allows a string $xsl filename to be passed - */ - public function importStylesheet($xsl) { - if (is_string($xsl)) { - $xsl_file = $xsl; - $xsl = new DOMDocument(); - $xsl->load($xsl_file); - } - return $this->xsltProcessor->importStylesheet($xsl); - } - - /** - * Transforms an XML file into compatible XHTML based on the stylesheet - * @param $xml XML DOM tree, or string filename - * @return string HTML output - * @todo Rename to transformToXHTML, as transformToHTML is misleading - */ - public function transformToHTML($xml) { - if (is_string($xml)) { - $dom = new DOMDocument(); - $dom->load($xml); - } else { - $dom = $xml; - } - $out = $this->xsltProcessor->transformToXML($dom); - - // fudges for HTML backwards compatibility - // assumes that document is XHTML - $out = str_replace('/>', ' />', $out); //
not
- $out = str_replace(' xmlns=""', '', $out); // rm unnecessary xmlns - - if (class_exists('Tidy')) { - // cleanup output - $config = array( - 'indent' => true, - 'output-xhtml' => true, - 'wrap' => 80 - ); - $tidy = new Tidy; - $tidy->parseString($out, $config, 'utf8'); - $tidy->cleanRepair(); - $out = (string) $tidy; - } - - return $out; - } - - /** - * Bulk sets parameters for the XSL stylesheet - * @param array $options Associative array of options to set - */ - public function setParameters($options) { - foreach ($options as $name => $value) { - $this->xsltProcessor->setParameter('', $name, $value); - } - } - - /** - * Forward any other calls to the XSLT processor - */ - public function __call($name, $arguments) { - call_user_func_array(array($this->xsltProcessor, $name), $arguments); - } - -} - -// vim: et sw=4 sts=4 -- cgit v1.2.3