philsturgeon / ee2-rest

Integrate RESTful API's into your ExpressionEngine 2.0 website with this Rest module.
http://devot-ee.com/add-ons/rest
34 stars 13 forks source link

Handle an different node? #12

Open kayzee opened 10 years ago

kayzee commented 10 years ago

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}