@@ 144-154 (lines=11) @@ | ||
141 | protected static function parseChildren( $DOMElement ) { |
|
142 | $result = array(); |
|
143 | foreach ( $DOMElement->childNodes as $child ) { |
|
144 | if ( $child instanceof DOMCharacterData ) { |
|
145 | if ( self::$preserveWhiteSpace || trim( $child->data )!=='' ) { |
|
146 | $result[] = new ar_htmlNode( $child->data ); |
|
147 | } |
|
148 | } else if ( $child instanceof DOMCdataSection ) { |
|
149 | if ( self::$preserveWhiteSpace || trim( $child->data )!=='' ) { |
|
150 | $result[] = self::cdata( $child->data ); |
|
151 | } |
|
152 | } else if ( $child instanceof DOMNode ) { |
|
153 | $result[] = self::el( $child->tagName, self::parseAttributes( $child ), self::parseChildren( $child ) ); |
|
154 | } |
|
155 | } |
|
156 | return self::nodes( $result ); |
|
157 | } |
@@ 235-245 (lines=11) @@ | ||
232 | if ( self::$preserveWhiteSpace || trim( $child->data )!=='' ) { |
|
233 | $result[] = new ar_xmlNode('<!--'.$child->data.'-->'); |
|
234 | } |
|
235 | } else if ( $child instanceof DOMCharacterData ) { |
|
236 | if ( self::$preserveWhiteSpace || trim( $child->data )!=='' ) { |
|
237 | $result[] = new ar_xmlNode($child->data); |
|
238 | } |
|
239 | } else if ( $child instanceof DOMCdataSection ) { |
|
240 | if ( self::$preserveWhiteSpace || trim( $child->data )!=='' ) { |
|
241 | $result[] = self::cdata( $child->data ); |
|
242 | } |
|
243 | } else if ( $child instanceof DOMElement ) { |
|
244 | $result[] = self::el( $child->tagName, self::parseAttributes( $child ), self::parseChildren( $child ) ); |
|
245 | } |
|
246 | } |
|
247 | return self::nodes( $result ); |
|
248 | } |