Dirk Gissing
Posts: 0
Joined: Sat Oct 12, 2013 4:18 pm

data mapping xml attributes

Hello,

I've looked at this topic:
https://getsatisfaction.com/apperyio/...

and saw that, if I were to map xml attributes, I have to create a generic service to do so. I have a two part question regarding this issue:

  1. The topic is 9 months old, has there been recent updates in handling xml attritbutes from the automatic response?

  2. If I have to create a generic service, could you provide me with a little tutorial on how to manually map this content in the generic service. I've already viewed the documentation on this, but I still can't seem to figure it out.

    My response is this:

    code
    <tr class="sectiontableentry1">
    <td class="nr">2</td>
    <td class="team">Twedo 1</td>
    <td class="played">18</td>
    <td class="wins">10</td>
    <td class="draws">4</td>
    <td class="losses">4</td>
    <td class="points">34</td>
    <td class="for">41</td>
    <td class="against">24</td>
    <td class="difference">17</td>
    <td class="penaltypoints">0</td>
    </tr>
    /code
    code
    <tr class="sectiontableentry1"><td nowrap="nowrap">14-12-13</td><td>Team 1 -Team 2</td><td style="text-align: center;">2-3</td></tr>
    /code

    How would I create a generic service to grab this content?
    If you have jquery or ajax tutorials/documentation I can follow, that would be great too!

    Thank you!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

data mapping xml attributes

Hi Dirk.

  1. Create new-Service REST

  2. Go to Settings tab and set URL, Data Type - xml

  3. On Request tab create request parameters which you need..

  4. OnTest tab enter values for request parameters and push "Test".

  5. After the response appears bellow click "Automaticaly Create Service Response".

  6. Goto Response tab and you will see here initialized response parameters.
    What aboute xml attributes - they are marked in response with "@" sign.

    So you can work with these response parameters like with others.
    Please find more here http://docs.appery.io/documentation/r...

Dirk Gissing
Posts: 0
Joined: Sat Oct 12, 2013 4:18 pm

data mapping xml attributes

Hello Alena,

I've tried this, it doesn't work.
This is a screenshot of the mapping:

Image

As you can see the code<td>/code element has only one content, and that td-element has multiple data in it. So I tried to do codevalue&#46;td[0]&#46;content and value&#46;td[1]&#46;content/code but it doesn't work.

Please advice!

Dirk Gissing
Posts: 0
Joined: Sat Oct 12, 2013 4:18 pm

data mapping xml attributes

UPDATE: Problem fixed!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

data mapping xml attributes

Hello! Thank you for update!

Return to “Issues”