# How to access remote XML file

**URL:** <https://zola.discourse.group/t/how-to-access-remote-xml-file/2200>\
**Category:** Support\
**Created:** [July 8, 2024, 6:40pm UTC](https://zola.discourse.group/t/how-to-access-remote-xml-file/2200 "2024-07-08T18:40:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/steve/32/1257_2.png) [@steve](https://zola.discourse.group/u/steve)\
**Post date:** [July 8, 2024, 6:40pm UTC](https://zola.discourse.group/t/how-to-access-remote-xml-file/2200/1 "2024-07-08T18:40:16Z")

</div>

I wanted to make use of `load_data` to fetch a remote XML file:

`https://pixelfed.scot/users/steve.atom`

So I have:

```auto
{% set response = load_data(url="https://pixelfed.scot/users/steve.atom", format="xml") %}

```

What I’m struggling with now is how to process the response. If I try to output it I just get `[Object]`.

I’m sure this is very simple, but I’m struggling to get my head round it. Any pointers? Thanks!

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 9, 2024, 7:27am UTC](https://zola.discourse.group/t/how-to-access-remote-xml-file/2200/2 "2024-07-09T07:27:13Z")

</div>

This is going to be converted to a object matching the XML format. No way to pretty print it right now sadly (it does work as expected in tera v2) so it is trial and error

---

<div class="post-metadata">

**Author:** ![steve](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/steve/32/1257_2.png) [@steve](https://zola.discourse.group/u/steve)\
**Post date:** [July 9, 2024, 7:52am UTC](https://zola.discourse.group/t/how-to-access-remote-xml-file/2200/3 "2024-07-09T07:52:30Z")

</div>

Thanks for the reply!

No issue printing it out as I can view the raw XML, however I just can’t work out the syntax for accessing the data - is there an example it the docs anywhere?

Sorry for what is probably a very basic question!

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [July 9, 2024, 8:02am UTC](https://zola.discourse.group/t/how-to-access-remote-xml-file/2200/4 "2024-07-09T08:02:12Z")

</div>

Something like `response["your_field"]` should work

---

<div class="post-metadata">

**Author:** ![steve](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/steve/32/1257_2.png) [@steve](https://zola.discourse.group/u/steve)\
**Post date:** [July 9, 2024, 8:39am UTC](https://zola.discourse.group/t/how-to-access-remote-xml-file/2200/5 "2024-07-09T08:39:43Z")

</div>

Ah, that’s got me closer, I was missing the quotes.

So the part I’m trying to loop over (looking at the XML) is the “entry” part, which looks like this:

```auto
<entry>
<media:content url="xxx">
</entry>

```

All I really want out of this is the image URL from that \<media field.

If I do this:

```auto
{% for entry in response["feed"]["entry"] %}
     {{ entry }}
{% endfor %}

```

I just get:

```auto
Tried to iterate using key value on variable `response["feed"]["entry"]`, but it is missing a key

```
