1 | <?php |
||
11 | final class XmlRenderer implements RendererInterface |
||
12 | { |
||
13 | private $rules = array(); |
||
14 | |||
15 | // /** |
||
16 | // * Converts all HTML entities outside of CDATA elements to their corresponding |
||
17 | // * UTF-8 characters |
||
18 | // * |
||
19 | // * @param string $xmlString |
||
20 | // * @return string |
||
21 | // */ |
||
22 | // private function decodeEntitiesFromXml($xmlString) |
||
23 | // { |
||
24 | // $retVal = ''; |
||
25 | // |
||
26 | // $parts = preg_split( |
||
27 | // '/(<!\[CDATA\[.*?\]\]>)/s', |
||
28 | // $xmlString, |
||
29 | // -1, |
||
30 | // PREG_SPLIT_DELIM_CAPTURE |
||
31 | // ); |
||
32 | // |
||
33 | // foreach ($parts as $part) { |
||
34 | // if (strpos($part, '<![CDATA[') === 0) { |
||
35 | // $retVal .= $part; |
||
36 | // } else { |
||
37 | // $retVal .= html_entity_decode($part, ENT_QUOTES, 'UTF-8'); |
||
38 | // } |
||
39 | // } |
||
40 | // |
||
41 | // return $retVal; |
||
42 | // } |
||
43 | |||
44 | /** |
||
45 | * |
||
46 | * http://www.php.net/manual/en/domdocument.savexml.php#95252 |
||
47 | * |
||
48 | * @param string $xml |
||
49 | * @return string |
||
50 | */ |
||
51 | private function xml2xhtml($xml) |
||
62 | |||
63 | /** |
||
64 | * |
||
65 | * @param AbstractRule $rule |
||
66 | * @param int $weight |
||
67 | */ |
||
68 | 1 | public function registerRule(AbstractRule $rule, $weight = 0) |
|
78 | |||
79 | /** |
||
80 | * |
||
81 | * @param string $xmlCode |
||
82 | * @return string |
||
83 | */ |
||
84 | 1 | public function render($xmlCode) |
|
120 | |||
121 | /** |
||
122 | * |
||
123 | * @param string $xmlCode |
||
124 | * @return string |
||
125 | */ |
||
126 | 1 | public function firePreSaveEvent($xmlCode) |
|
143 | } |
||
144 |