ee2-rest
ee2-rest copied to clipboard
Handle an different node?
I have a API response (not controlled by me) as follows:
<ArrayOfXmlNode xmlns:xsd="http://www.w3.org/2001/XMLSchema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance xmlns="http://www.petango.com/>
<XmlNode>
<adoptableSearch xmlns=">
<ID>11422849</ID>
<Name>Perry</Name>
</adoptableSearch>
</XmlNode>
<XmlNode>
<adoptableSearch xmlns=">
<ID>11422850</ID>
<Name>John</Name>
</adoptableSearch>
</XmlNode>
<XmlNode xsi:nil="true"/>
</ArrayOfXmlNode>
{exp:rest name="api_url" base="XmlNode"}
{adoptableSearch}
<div class="person">{ID} {Name}</div>
{/adoptableSearch}
{/exp:rest}
My problem is that the last node in my API response doesn't get handled properly and I end up getting this output in my HTML file:
<div class="person">11422850 John</div>
{adoptableSearch}
<div class="person"> </div>
{/adoptableSearch}