{"id":14180706,"date":"2021-03-14T20:46:42","date_gmt":"2021-03-14T20:46:42","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/access-a-specific-value-in-xml-file\/"},"modified":"2021-03-14T20:46:42","modified_gmt":"2021-03-14T20:46:42","slug":"access-a-specific-value-in-xml-file","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/access-a-specific-value-in-xml-file\/","title":{"rendered":"Access a specific value in xml file"},"content":{"rendered":"<p>Hello, I have bought wp all import with woocommerce and i need access a value in the following xml format. The xml has properties i need to use to map it to individual fields.<\/p>\n<p>I want set indiviual field _woosea_gender to value of &lt;propid&gt;41&lt;\/propid&gt; (M\u00e4nner\/Frauen etc.)<\/p>\n<pre><code>\n    &lt;properties&gt;\n      &lt;prop&gt;\n        &lt;propid&gt;144&lt;\/propid&gt;\n        &lt;property&gt;Benutzerlevel&lt;\/property&gt;\n        &lt;valueid&gt;796&lt;\/valueid&gt;\n        &lt;values&gt;\n          &lt;value&gt;\n            &lt;id&gt;796&lt;\/id&gt;\n            &lt;title&gt;More Experienced&lt;\/title&gt;\n          &lt;\/value&gt;\n        &lt;\/values&gt;\n        &lt;value&gt;More Experienced&lt;\/value&gt;\n      &lt;\/prop&gt;\n      &lt;prop&gt;\n        &lt;propid&gt;41&lt;\/propid&gt;\n        &lt;property&gt;Geeignet f\u00fcr&lt;\/property&gt;\n        &lt;valueid&gt;230&lt;\/valueid&gt;\n        &lt;values&gt;\n          &lt;value&gt;\n            &lt;id&gt;230&lt;\/id&gt;\n            &lt;title&gt;M\u00e4nner&lt;\/title&gt;\n          &lt;\/value&gt;\n        &lt;\/values&gt;\n        &lt;value&gt;M\u00e4nner&lt;\/value&gt;\n      &lt;\/prop&gt;\n      &lt;prop&gt;\n        &lt;propid&gt;25&lt;\/propid&gt;\n        &lt;property&gt;Farbe&lt;\/property&gt;\n        &lt;valueid&gt;209&lt;\/valueid&gt;\n        &lt;values&gt;\n          &lt;value&gt;\n            &lt;id&gt;209&lt;\/id&gt;\n            &lt;title&gt;Schwarz&lt;\/title&gt;\n          &lt;\/value&gt;\n        &lt;\/values&gt;\n        &lt;value&gt;Schwarz&lt;\/value&gt;\n      &lt;\/prop&gt;\n    &lt;\/properties&gt;\n<\/code><\/pre>\n<p>The &lt;prop&gt; element is on a different number in each item, so I can&#8217;t just drag and drop it to my field. I need to access the &lt;value&gt; of the &lt;prop&gt; element by the &lt;propid&gt;. The &lt;propid&gt; is always the same for the value I need to use in my custom attribute field.<\/p>\n<p>Thanks for any help<\/p>\n","protected":false},"template":"","class_list":["post-14180706","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14180706","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14180706\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14180706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}