<p>I will use your JSON source data instead of the XML, since that is easier to handle in DataTables.</p>
<p>Here is a basic demo, to start with, followed by some explanatory notes:</p>
<pre><code>&lt;!doctype html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
  &lt;meta charset=&quot;UTF-8&quot;&gt;
  &lt;title&gt;Demo&lt;/title&gt;

  &lt;script src=&quot;https://code.jquery.com/jquery-3.5.1.min.js&quot;&gt;&lt;/script&gt;
  &lt;script src=&quot;https://cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js&quot;&gt;&lt;/script&gt;
  &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;https://cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css&quot;&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;div style=&quot;margin: 20px;&quot;&gt;

    &lt;table id=&quot;arxivtable&quot; class=&quot;display&quot; style=&quot;width:100%&quot;&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;title&lt;/th&gt;
          &lt;th&gt;id&lt;/th&gt;
          &lt;th&gt;link&lt;/th&gt;
          &lt;th&gt;author&lt;/th&gt;
          &lt;th&gt;published&lt;/th&gt;
          &lt;th&gt;summary&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
&lt;/table&gt;


&lt;/div&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
    
  $(document).ready(function(){

    $('#arxivtable').DataTable({
      &quot;ajax&quot;: {
        url: &quot;YOUR_URL_GOES_HERE&quot;,
        dataSrc: &quot;feed.entry&quot;
      },
      &quot;columns&quot;: [
        {&quot;data&quot;: &quot;title&quot;},
        { &quot;data&quot;: &quot;id&quot; },
        { &quot;data&quot;: &quot;link[].@href&quot; },
        { &quot;data&quot;: &quot;author.name&quot; },
        { &quot;data&quot;: &quot;published&quot; },
        { &quot;data&quot;: &quot;summary&quot; }
      ]
    });
    
  });

&lt;/script&gt;


&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p><strong>Notes</strong></p>
<p>1 - Because you have provided hard-coded HTML column headers, you need to make sure the number of those headers matches the number of columns defined in the DataTable. Alternatively, you can remove the HTML <code>&lt;thead&gt;</code> section and use the DataTables <a href="https://datatables.net/reference/option/columns.title" rel="nofollow noreferrer"><code>columns.title</code></a> option.</p>
<p>2 - Your Ajax JSON source data contains an array <code>[ ... ]</code>. DataTables needs to know where this array is located in your JSON response, as part of the Ajax handling option, so that it can iterate over that array. Each element in the array will be used to create a row of HTML table data. The <code>ajax.dataSrc</code> option therefore needs to be set accordingly:</p>
<pre><code>dataSrc: &quot;feed.entry&quot;
</code></pre>
<p>Once you have set the above Ajax JSON starting point correctly, then you can use field names for each separate column <code>data</code> value - as shown below.</p>
<p>3 - The <code>author</code> JSON value is actually an object:</p>
<pre><code>&quot;author&quot;: {
  &quot;name&quot;: &quot;Xiaomin Chen&quot;
},
</code></pre>
<p>Therefore you need to drill down into that to get the field you want to show in the DataTable:</p>
<pre><code>{ &quot;data&quot;: &quot;author.name&quot; },
</code></pre>
<p>4 - I removed your column renderer function to keep my initial demo simple, but it can be used to access fields and sub-fields - and concatenate strings and other values as needed (as in your example in the question).</p>
<p>5 - The <code>link</code> JSON value is actually an array of objects. For my basic demo, I just accessed the final entry in that array, and then took the href field:</p>
<pre><code>{ &quot;data&quot;: &quot;link[].@href&quot; },
</code></pre>
<p>This may not be what you want. You may want to only choose links of a certain type, or choose all links, or something different.</p>
<p>This is where DataTables is limited in what it can handle. It cannot display arbitrary nested JSON values of this type (not surprisingly).</p>
<p>In such cases, you would need to re-structure the JSON, prior to sending it to DataTables - or restructure it in a <a href="https://datatables.net/reference/option/ajax.dataSrc#Examples" rel="nofollow noreferrer"><code>dataSrc</code> function</a> inside DataTables itself:</p>
<pre><code>&quot;dataSrc&quot;: function ( json ) { ...transform and return your JSON here... }
</code></pre>
<p>6 - I was not sure what you wanted to display for <code>{ &quot;data&quot;: &quot;journal&quot; }</code>. I did not see anything called <code>journal</code> in the JSON.</p>
<p>7 - Note that all the source JSON data outside of the <code>feed.entry</code> array is also not available to DataTables. DataTables can only iterate over that outer array. Anything you may also need which is not in that outer array would need to be added to the array, to be accessible to DataTables.</p>
<hr />
<p>See also <a href="https://datatables.net/examples/ajax/objects_subarrays.html" rel="nofollow noreferrer">Nested object data (arrays)</a> and <a href="https://datatables.net/examples/ajax/deep.html" rel="nofollow noreferrer">Nested object data (objects)</a> for more related notes.</p>
How to output response of type atom/xml feed into Jquery DataTable?
<p>How to output response of type atom/xml feed (from arxiv call) into Jquery DataTable?</p>
<p>I have the datatable working for a <a href="https://datatables.net/manual/ajax" rel="nofollow noreferrer">simple json from Ajax call</a> to flask server example.</p>
<p>When i try to do it with the xml from an arxiv api response, i cant seem to get it to display in the datatable (though i can just print the raw xml using <code>&lt;pre lang=&quot;xml&quot; &gt;</code> or json).</p>
<p>I also tried to convert to json first via python dictionary, but still couldnt get it formatted into datatable as im unsure how to access the properties properly in the Ajax call when theyre deeper than the first level as in the basic example linked.</p>
<p>The HTML in template:</p>
<pre><code>&lt;table id=&quot;arxivtable&quot; class=&quot;display&quot; style=&quot;width:100%&quot;&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;title&lt;/th&gt;
          &lt;th&gt;id&lt;/th&gt;
          &lt;th&gt;link&lt;/th&gt;
          &lt;th&gt;author&lt;/th&gt;
          &lt;th&gt;published&lt;/th&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
&lt;/table&gt;
</code></pre>
<p>I tried via xml :</p>
<pre><code>  $('#arxivtable').DataTable({
            &quot;ajax&quot;: {
                // &quot;url&quot;: &quot;static/objects2.txt&quot;, // This works for the static file
                &quot;url&quot;: &quot;/get_arxivpapers&quot;, // This now works too thanks to @kthorngren
                &quot;dataType&quot;: &quot;xml&quot;,
                &quot;type&quot;:&quot;GET&quot;,
                &quot;dataSrc&quot;: &quot;{{name}}&quot;,
                &quot;contentType&quot;:&quot;application/atom+xml&quot;
            },
            &quot;columns&quot;: [
                {&quot;data&quot;: &quot;title&quot;},
                {
                        &quot;data&quot;: &quot;link&quot;,
                        &quot;render&quot;: function(data, type, row, meta){
                           if(type === 'display'){
                               data = '&lt;a href=&quot;' + data + '&quot;&gt;' + data + '&lt;/a&gt;';
                           }

                           return data;
                        }
                      },
                      { &quot;data&quot;: &quot;id&quot; },
                      { &quot;data&quot;: &quot;link&quot; },
                       { &quot;data&quot;: &quot;author&quot; },
                       { &quot;data&quot;: &quot;journal&quot; },
                       { &quot;data&quot;: &quot;published&quot; },
                       { &quot;data&quot;: &quot;summary&quot; }

            ]
            });
</code></pre>
<p>JSON from AJAX call:</p>
<pre><code>    {
  &quot;feed&quot;: {
    &quot;@xmlns&quot;: &quot;http://www.w3.org/2005/Atom&quot;,
    &quot;link&quot;: {
      &quot;@href&quot;: &quot;http://arxiv.org/api/query?search_query%3Dall%3Aeinstein%26id_list%3D%26start%3D0%26max_results%3D2&quot;,
      &quot;@rel&quot;: &quot;self&quot;,
      &quot;@type&quot;: &quot;application/atom+xml&quot;
    },
    &quot;title&quot;: {
      &quot;@type&quot;: &quot;html&quot;,
      &quot;#text&quot;: &quot;ArXiv Query: search_query=all:einstein&amp;id_list=&amp;start=0&amp;max_results=2&quot;
    },
    &quot;id&quot;: &quot;http://arxiv.org/api/vehKAQR+bheXtHwJw3qx/OG/XXw&quot;,
    &quot;updated&quot;: &quot;2022-06-14T00:00:00-04:00&quot;,
    &quot;opensearch:totalResults&quot;: {
      &quot;@xmlns:opensearch&quot;: &quot;http://a9.com/-/spec/opensearch/1.1/&quot;,
      &quot;#text&quot;: &quot;36970&quot;
    },
    &quot;opensearch:startIndex&quot;: {
      &quot;@xmlns:opensearch&quot;: &quot;http://a9.com/-/spec/opensearch/1.1/&quot;,
      &quot;#text&quot;: &quot;0&quot;
    },
    &quot;opensearch:itemsPerPage&quot;: {
      &quot;@xmlns:opensearch&quot;: &quot;http://a9.com/-/spec/opensearch/1.1/&quot;,
      &quot;#text&quot;: &quot;2&quot;
    },
    &quot;entry&quot;: [
      {
        &quot;id&quot;: &quot;http://arxiv.org/abs/1801.05533v2&quot;,
        &quot;updated&quot;: &quot;2018-11-22T14:04:43Z&quot;,
        &quot;published&quot;: &quot;2018-01-17T03:05:51Z&quot;,
        &quot;title&quot;: &quot;Einstein-Weyl structures on almost cosymplectic manifolds&quot;,
        &quot;summary&quot;: &quot;&quot;,
        &quot;author&quot;: {
          &quot;name&quot;: &quot;Xiaomin Chen&quot;
        },
        &quot;arxiv:comment&quot;: {
          &quot;@xmlns:arxiv&quot;: &quot;http://arxiv.org/schemas/atom&quot;,
          &quot;#text&quot;: &quot;accepted by Periodica Mathematica Hungarica, 14 pages, no figures&quot;
        },
        &quot;link&quot;: [
          {
            &quot;@href&quot;: &quot;http://arxiv.org/abs/1801.05533v2&quot;,
            &quot;@rel&quot;: &quot;alternate&quot;,
            &quot;@type&quot;: &quot;text/html&quot;
          },
          {
            &quot;@title&quot;: &quot;pdf&quot;,
            &quot;@href&quot;: &quot;http://arxiv.org/pdf/1801.05533v2&quot;,
            &quot;@rel&quot;: &quot;related&quot;,
            &quot;@type&quot;: &quot;application/pdf&quot;
          }
        ],
        &quot;arxiv:primary_category&quot;: {
          &quot;@xmlns:arxiv&quot;: &quot;http://arxiv.org/schemas/atom&quot;,
          &quot;@term&quot;: &quot;math.DG&quot;,
          &quot;@scheme&quot;: &quot;http://arxiv.org/schemas/atom&quot;
        },
        &quot;category&quot;: [
          {
            &quot;@term&quot;: &quot;math.DG&quot;,
            &quot;@scheme&quot;: &quot;http://arxiv.org/schemas/atom&quot;
          },
          {
            &quot;@term&quot;: &quot;53D10, 53D15&quot;,
            &quot;@scheme&quot;: &quot;http://arxiv.org/schemas/atom&quot;
          }
        ]
      },
      {
        &quot;id&quot;: &quot;http://arxiv.org/abs/0802.2137v3&quot;,
        &quot;updated&quot;: &quot;2008-04-01T04:36:21Z&quot;,
        &quot;published&quot;: &quot;2008-02-15T04:40:56Z&quot;,
        &quot;title&quot;: &quot;&quot;,
        &quot;summary&quot;: &quot;.&quot;,
        &quot;author&quot;: {
          &quot;name&quot;: &quot;&quot;
        },
        &quot;arxiv:comment&quot;: {
          &quot;@xmlns:arxiv&quot;: &quot;http://arxiv.org/schemas/atom&quot;,
          &quot;#text&quot;: &quot;18 pages, added Theorem 5&quot;
        },
        &quot;link&quot;: [
          {
            &quot;@href&quot;: &quot;http://arxiv.org/abs/0802.2137v3&quot;,
            &quot;@rel&quot;: &quot;alternate&quot;,
            &quot;@type&quot;: &quot;text/html&quot;
          },
          {
            &quot;@title&quot;: &quot;pdf&quot;,
            &quot;@href&quot;: &quot;http://arxiv.org/pdf/0802.2137v3&quot;,
            &quot;@rel&quot;: &quot;related&quot;,
            &quot;@type&quot;: &quot;application/pdf&quot;
          }
        ],
        &quot;arxiv:primary_category&quot;: {
          &quot;@xmlns:arxiv&quot;: &quot;http://arxiv.org/schemas/atom&quot;,
          &quot;@term&quot;: &quot;math.DG&quot;,
          &quot;@scheme&quot;: &quot;http://arxiv.org/schemas/atom&quot;
        },
        &quot;category&quot;: [
          {
            &quot;@term&quot;: &quot;math.DG&quot;,
            &quot;@scheme&quot;: &quot;http://arxiv.org/schemas/atom&quot;
          },
          {
            &quot;@term&quot;: &quot;53C30; 53C25&quot;,
            &quot;@scheme&quot;: &quot;http://arxiv.org/schemas/atom&quot;
          }
        ]
      }
    ]
  }
}
</code></pre>
<p>Or the original atom/xml:</p>
<pre><code>&lt;feed xmlns=&quot;http://www.w3.org/2005/Atom&quot;&gt;
  &lt;link href=&quot;http://arxiv.org/api/query?search_query%3Dall%3Aeinstein%26id_list%3D%26start%3D0%26max_results%3D2&quot; rel=&quot;self&quot; type=&quot;application/atom+xml&quot;&gt;
  &lt;title type=&quot;html&quot;&gt;ArXiv Query: search_query=all:einstein&amp;amp;id_list=&amp;amp;start=0&amp;amp;max_results=2&lt;/title&gt;
  &lt;id&gt;http://arxiv.org/api/vehKAQR+bheXtHwJw3qx/OG/XXw&lt;/id&gt;
  &lt;updated&gt;2022-06-14T00:00:00-04:00&lt;/updated&gt;
  &lt;opensearch:totalresults xmlns:opensearch=&quot;http://a9.com/-/spec/opensearch/1.1/&quot;&gt;36970&lt;/opensearch:totalresults&gt;
  &lt;opensearch:startindex xmlns:opensearch=&quot;http://a9.com/-/spec/opensearch/1.1/&quot;&gt;0&lt;/opensearch:startindex&gt;
  &lt;opensearch:itemsperpage xmlns:opensearch=&quot;http://a9.com/-/spec/opensearch/1.1/&quot;&gt;2&lt;/opensearch:itemsperpage&gt;
  &lt;entry&gt;
    &lt;id&gt;http://arxiv.org/abs/1801.05533v2&lt;/id&gt;
    &lt;updated&gt;2018-11-22T14:04:43Z&lt;/updated&gt;
    &lt;published&gt;2018-01-17T03:05:51Z&lt;/published&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;summary&gt; 
&lt;/summary&gt;
    &lt;author&gt;
      &lt;name&gt;&lt;/name&gt;
    &lt;/author&gt;
    &lt;arxiv:comment xmlns:arxiv=&quot;http://arxiv.org/schemas/atom&quot;&gt;accepted by Periodica Mathematica Hungarica, 14 pages, no figures&lt;/arxiv:comment&gt;
    &lt;link href=&quot;http://arxiv.org/abs/1801.05533v2&quot; rel=&quot;alternate&quot; type=&quot;text/html&quot;&gt;
    &lt;link title=&quot;pdf&quot; href=&quot;http://arxiv.org/pdf/1801.05533v2&quot; rel=&quot;related&quot; type=&quot;application/pdf&quot;&gt;
    &lt;arxiv:primary_category xmlns:arxiv=&quot;http://arxiv.org/schemas/atom&quot; term=&quot;math.DG&quot; scheme=&quot;http://arxiv.org/schemas/atom&quot;&gt;
    &lt;category term=&quot;math.DG&quot; scheme=&quot;http://arxiv.org/schemas/atom&quot;&gt;
    &lt;category term=&quot;53D10, 53D15&quot; scheme=&quot;http://arxiv.org/schemas/atom&quot;&gt;
  &lt;/category&gt;&lt;/category&gt;&lt;/arxiv:primary_category&gt;&lt;/entry&gt;
  &lt;entry&gt;
    &lt;id&gt;http://arxiv.org/abs/0802.2137v3&lt;/id&gt;
    &lt;updated&gt;2008-04-01T04:36:21Z&lt;/updated&gt;
    &lt;published&gt;2008-02-15T04:40:56Z&lt;/published&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;summary&gt;
&lt;/summary&gt;
    &lt;author&gt;
      &lt;name&gt;&lt;/name&gt;
    &lt;/author&gt;
    &lt;arxiv:comment xmlns:arxiv=&quot;http://arxiv.org/schemas/atom&quot;&gt;&lt;/arxiv:comment&gt;
    &lt;link href=&quot;http://arxiv.org/abs/0802.2137v3&quot; rel=&quot;alternate&quot; type=&quot;text/html&quot;&gt;
    &lt;link title=&quot;pdf&quot; href=&quot;http://arxiv.org/pdf/0802.2137v3&quot; rel=&quot;related&quot; type=&quot;application/pdf&quot;&gt;
    &lt;arxiv:primary_category xmlns:arxiv=&quot;http://arxiv.org/schemas/atom&quot; term=&quot;math.DG&quot; scheme=&quot;http://arxiv.org/schemas/atom&quot;&gt;
    &lt;category term=&quot;math.DG&quot; scheme=&quot;http://arxiv.org/schemas/atom&quot;&gt;
    &lt;category term=&quot;53C30; 53C25&quot; scheme=&quot;http://arxiv.org/schemas/atom&quot;&gt;
  &lt;/category&gt;&lt;/category&gt;&lt;/arxiv:primary_category&gt;&lt;/entry&gt;
&lt;/feed&gt;
</code></pre>
<p>The End Point:</p>
<pre><code>@app.route('/get_arxivpapers')
def getArxivPapers(name=&quot;einstein&quot;):

    max_results = 2
    searchterm = name.replace(&quot;_&quot;, &quot;&amp;#32&quot;)
    url = 'http://export.arxiv.org/api/query?search_query=all:' + searchterm + '&amp;start=0&amp;' + 'max_results='+ str(max_results)
    data = urllib.request.urlopen(url)

    # data_dict = xmltodict.parse(data)
    # json_data = json.dumps(data_dict)
    # print(json_data)
    # return jsonify(json_data)

    return data.read().decode('utf-8')
</code></pre>