xml-wrangler icon indicating copy to clipboard operation
xml-wrangler copied to clipboard

Lazy Load. How to stop after closing tag is reached

Open SDJeff opened this issue 1 year ago • 0 comments

If you have a bigger file and getting elements

$catalog_structure = $reader->value('T_NEW_CATALOG.CATALOG_GROUP_SYSTEM.CATALOG_STRUCTURE')->lazy();

 $i = 0;
 foreach ($catalog_structure as $item) { 

   // iterate items <CATALOG_STRUCTURE></CATALOG_STRUCTURE>

}

How to stop reading file after all elements are iterated. It loops to the end of the file even there cannot come any more item for this child elements.

SDJeff avatar Jan 30 '25 18:01 SDJeff