I'm importing data from an XML file. I'm having trouble accessing some of the deeper nodes in the xml file.
Example of my xml here (chapter being the repeating item):
<article xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en" class="techreport">
<chapter>
<title> Title – Version 5.0.11.110 </title>
<subtitle> Release Notes </subtitle>
<info>...</info>
<sect1>
<title> Improvement </title>
<sect2>
<title> AP - Accounts Payable </title>
<itemizedlist>
<listitem xml:id="A50-3451-1">
<para>
Allow edit for Shipment Comment on Both Shipments after Post Invoice if Edit Shipment After Posting is enabled.
</para>
</listitem>
<listitem xml:id="A50-3487-2">
<para>
Make AP Generate Payment form and report all fields from AP Transaction.
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2>
<title> CB - Cash Book </title>
<itemizedlist>
<listitem xml:id="A50-3314-3">
<para>
Added StatementID, StatementLineNo and PeriodReconciled as available fields for the transactions band on the CB Unreconciled Transactions layout, making it easy to see if a transaction which is unreconciled as at the period reported on is on a statement, and reconciled subsequently.
</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<sect1>
<title> Bug Fix </title>
<sect2>
<title> ALL - All Modules </title>
<itemizedlist>
<listitem xml:id="A50-3400-1">
<para>
Fix possible A record already exists with that Layout (..) code - Error message.
</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>
</chapter>
</article>
And my template code so far:
{% set params0 = {
url: 'https://sitename/downloads/ReleaseNotes.xml',
type: 'xml',
element: 'chapter',
cache: 60,
} %}
{% set params1 = {
url: 'https://sitename/downloads/ReleaseNotes.xml',
type: 'xml',
element: 'sect1',
cache: 60,
} %}
{% set params2 = {
url: 'https://sitename/downloads/ReleaseNotes.xml',
type: 'xml',
element: 'sect2',
cache: 60,
} %}
{% set feed0 = craft.feedme.feed(params0) %}
{% set feed1 = craft.feedme.feed(params1) %}
{% set feed2 = craft.feedme.feed(params2) %}
{% for node in feed0 %}
<h4><strong>{{ node.title }}</strong></h4>
{% for node in feed1 %}
<p>{{ node.title }}</p>
{% for node in feed2 %}
<p>{{ node.title }}</p>
<p>{{ node.itemizedlist.listitem.para }}</p>
{% endfor %}
{% endfor %}
{% endfor %}
I've ended up using multiple feeds as I couldn't get to the "para" node at all. This maybe wrong.
I thought that <p>{{ node.itemizedlist.listitem.para }}</p>
would do the trick.
Can someone offer some help please.
node.itemizedlist[0].listitem.para
you will only get the first item :)