Closed judgej closed 8 years ago
Yes you absolutely have to advance the reader, because the reader doesn't have a way to know what your intent is.
Thankfully it's pretty easy. Instead of \Sabre\Xml\Element\Base::xmlDeserialize($reader);
, just call $reader->next();
Leaving this open as a documentation bug.
That works great - thanks.
This is my XML fragment:
I want to turn each
detail
tag into aDespatchNoteLine
object. The following goes into an infinite loop, creating DespatchNoteLine objects until the request runs out of memory.I get around this by parsing the inner elements (even though there are no inner elements):
Is this expected behaviour? Should it be necessary to always explicitly parse or "consume" inner elements? My impression is that not parsing what's inside the
detail
elements would simply discard what's in there. But perhaps I'm looking at it wrong - the parser will parse everything and the mapping is a layer that sits on top of that.Any thoughts?