Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've been trying to get at the nested file urls in the code below, in order to assign them to attached files for the node:
<files>
<div class="item-list">
<ul>
<li class="first">http://site.com/files/PD_Case_Study_Porgera_0.pdf
</li>
<li>http://site.com/files/PD_Case_Study_Porgera_1.pdf
</li>
</ul>
</div>
</files>
Using the setting code files/div/ul/li
returns nothing in the debug however using files
does return the whole content intact.
I'm using the XPath XML Parser and not the XPath HTML - since HTML is XML and my code is a mix of both.
Am I missing some special code to call nested
thanks
Comments
Comment #1
dawnbuie CreditAttribution: dawnbuie commentedComment #2
asif_khan CreditAttribution: asif_khan commentedhi
this is a bug i also have same problem i am using xpath HTML and when i query for //div it gives everything but i use //div//p[@'samething'] it return only first para but when i debug this query i get complete result but it doesn't save complete.
thank you
Comment #3
erwangel CreditAttribution: erwangel commentedSame problem here ! A xpath query that returns all <p> inside a <div>, saves only the first <p> although correctly displayed in debug (xpathparser:0 : with all <p>) . Tried with "Select the queries you would like to return raw XML or HTML" unchecked, same result.
Comment #4
twistor CreditAttribution: twistor commentedThis sounds like an XPath query problem.
I will need more information to be able to help.
I need a full sample of the XML, or at least enough to see the *whole* structure.
Then I need to know the context, and the field mappings that you're trying to accomplish.
Comment #5
twistor CreditAttribution: twistor as a volunteer commented