Skip to content

Commit

Permalink
Merge pull request #31 from ho-nl/fix/zero_elements
Browse files Browse the repository at this point in the history
fix: don't remove elements containing '0'
  • Loading branch information
PascalBrouwers authored Mar 21, 2022
2 parents 8fc8026 + 349243a commit fc838f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Streamer/FileXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ public function getIterator()
$generator = function (\Prewk\XmlStringStreamer $streamer) use ($limit) {
while (($node = $streamer->getNode()) && $limit > 0) {
$limit--;
yield array_filter(json_decode(json_encode(new \SimpleXMLElement($node, LIBXML_NOCDATA)), true));
yield array_filter(json_decode(json_encode(new \SimpleXMLElement($node, LIBXML_NOCDATA)), true),
function($value) {
return (is_array($value) ? count($value) > 0 : strlen($value));
}
);
}
};

Expand Down

0 comments on commit fc838f1

Please sign in to comment.