Title: How to read XML?
Last modified: August 30, 2016

---

# How to read XML?

 *  [Aldun](https://wordpress.org/support/users/aldun/)
 * (@aldun)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/how-to-read-xml/)
 * Hi,
 * Currently I’m trying to read a few elements from an XML file, to be able to list
   them on a page (or post if that would make it easier). I’ve tried several things:
   WP All Import, Site Import plugin, writing my own PHP, converting it to JSON 
   and then reading it etc. Yet probably due my lack of knowledge about this topic
   I still haven’t been able to.
 * What I’m looking to do is to take the ‘name’ and ‘thumbnail’ from each ‘item’
   at [http://www.boardgamegeek.com/xmlapi/collection/Zuiderspel?own=1&version=1](http://www.boardgamegeek.com/xmlapi/collection/Zuiderspel?own=1&version=1),
   and list them on a page on my site, each item in a new div.
 * Would anybody know how I could tackle this? Perhaps through code or a plugin.
 * Thanks

Viewing 1 replies (of 1 total)

 *  Thread Starter [Aldun](https://wordpress.org/support/users/aldun/)
 * (@aldun)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/how-to-read-xml/#post-6857753)
 * Addition:
 * What I’m currently trying is through the following code
 *     ```
       <script>function loadDoc(){
       var xhttp = new XMLHttpRequest();
       xhttp.onreadystatechange = function() {
       if (xhttp.readyState == 4 && xhttp.status == 200) {
       myFunction(xhttp);
       }
       };
       xhttp.open("GET", "http://www.boardgamegeek.com/xmlapi/collection/Zuiderspel?own=1&version=1", true);
       }
       xhttp.send();
   
       function myFunction(xml){
       console.log("test");
       }
   
       </script>
       ```
   
 * With in the myFunction obviously the right code to place it in divs. However,
   this gives me ‘Unexpected token ILLEGAL’ for a reason I can’t find out. I’ve 
   tried changing the xhttp.open to the local xml file on my server, but with the
   same results.

Viewing 1 replies (of 1 total)

The topic ‘How to read XML?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [Aldun](https://wordpress.org/support/users/aldun/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/how-to-read-xml/#post-6857753)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
