You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<despatchNoteID="383265">
<detailID="1"isbn="9781909633773"Qty="1"Status="OK"UMC="1.86"></detail>
<detailID="2"isbn="9781909633896"Qty="1"Status="--- Book not in Catalogue --"UMC="0"></detail>
</despatchNote>
I want to turn each detail tag into a DespatchNoteLine 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):
$reader->elementMap = [
'{}detail' => function ($reader) {
$attributes = $reader->parseAttributes();
\Sabre\Xml\Element\Base::xmlDeserialize($reader); // <<<=== The fix.returnnewDespatchNoteLine($attributes);
},
...
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: