|
|
@@ -58,10 +58,11 @@ class XML {
|
|
|
// default: UI::alert('warning', "TODO: read attributes from: d({$z->depth}) name($z->name)");
|
|
|
// }
|
|
|
while ($z->read() && $z->depth > $depth) {
|
|
|
- if (XMLReader::ELEMENT !== $z->nodeType) continue;
|
|
|
- // if ($z->depth == $depth + 2)
|
|
|
- $node[2][] = self::xmlReadRecurse($z);
|
|
|
- // else $node[2][] = "d({$z->depth}) name($z->name)";
|
|
|
+ switch ($z->nodeType) {
|
|
|
+ case XMLReader::CDATA: $node[2][] = (string)$z->value; break;
|
|
|
+ case XMLReader::TEXT: $node[2][] = (string)$z->value; break;
|
|
|
+ case XMLReader::ELEMENT: $node[2][] = self::xmlReadRecurse($z); break;
|
|
|
+ }
|
|
|
}
|
|
|
return $node;
|
|
|
}
|