Page 1 of 1

data mapping xml attributes

Posted: Wed Mar 05, 2014 12:28 am
by Dirk Gissing

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!


data mapping xml attributes

Posted: Wed Mar 05, 2014 3:04 am
by Alena Prykhodko

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...


data mapping xml attributes

Posted: Thu Mar 06, 2014 6:53 pm
by Dirk Gissing

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!


data mapping xml attributes

Posted: Thu Mar 06, 2014 7:09 pm
by Dirk Gissing

UPDATE: Problem fixed!


data mapping xml attributes

Posted: Thu Mar 06, 2014 7:23 pm
by Maryna Brodina

Hello! Thank you for update!