Index: trunk/extensions/DataTransclusion/WebDataTransclusionSource.php |
— | — | @@ -228,16 +228,16 @@ |
229 | 229 | $r[ $k ] = $v; |
230 | 230 | } |
231 | 231 | |
232 | | - return $r; |
233 | | - } else { |
234 | | - return $rec; |
235 | | - } |
| 232 | + $rec = $r; |
| 233 | + } |
236 | 234 | |
237 | 235 | foreach ( $rec as $k => $v ) { |
238 | 236 | if ( !is_null( $v ) && !is_string( $v ) && !is_int( $v ) ) { |
239 | 237 | $rec[ $k ] = $this->asString( $v ); |
240 | 238 | } |
241 | 239 | } |
| 240 | + |
| 241 | + return $rec; |
242 | 242 | } |
243 | 243 | |
244 | 244 | public function resolvePath( $data, $path, $split = true ) { |
Index: trunk/extensions/DataTransclusion/XmlDataTransclusionSource.php |
— | — | @@ -59,6 +59,7 @@ |
60 | 60 | |
61 | 61 | public function resolvePath( $dom, $xpath ) { |
62 | 62 | $lookup = new DOMXPath( $dom->ownerDocument ); |
| 63 | + |
63 | 64 | $res = $lookup->query( $xpath, $dom ); |
64 | 65 | |
65 | 66 | if ( $res instanceof DOMNodeList ) { |
— | — | @@ -88,28 +89,4 @@ |
89 | 90 | return "$v"; |
90 | 91 | } |
91 | 92 | |
92 | | - public function flattenRecord( $rec ) { |
93 | | - $rec = parent::flattenRecord( $rec ); |
94 | | - |
95 | | - if ( !$rec ) return $rec; |
96 | | - |
97 | | - foreach ( $rec as $k => $v ) { |
98 | | - if ( is_object($v) ) { |
99 | | - if ( $v instanceof DOMNodeList ) { |
100 | | - $v = $v->item( 0 ); |
101 | | - } |
102 | | - |
103 | | - if ( $v instanceof DOMNamedNodeMap ) { |
104 | | - $v = $v->item( 0 ); |
105 | | - } |
106 | | - |
107 | | - if ( $v instanceof DOMNode ) { |
108 | | - $rec[ $k ] = $v->textContent; |
109 | | - } |
110 | | - } |
111 | | - } |
112 | | - |
113 | | - return $rec; |
114 | | - } |
115 | | - |
116 | 93 | } |