Title: Xml post structure
Last modified: August 21, 2016

---

# Xml post structure

 *  Resolved [yanivjs](https://wordpress.org/support/users/yanivjs/)
 * (@yanivjs)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/xml-post-structure/)
 * Hi Zaus,
 * I need the following Xml output structure but can’t see the way to achieve it
   with the ‘Xml root elements’ and with the ‘mapping’:
 * <?xml version=”1.0″ encoding=”utf-8″?>
    <ROOT> <PERMISSION> <USERNAME>lalala</
   USERNAME> <PASSWORD> lala122</PASSWORD> </PERMISSION> <CARD_TYPE>customer</CARD_TYPE
   > <CUST_DETAILS> <P_N>John</P_N> <MAIL>john@yahoo@com</MAIL> <REM>Hi there</REM
   > <MAKOR>Website</MAKOR> </CUST_DETAILS> </ROOT>
 * I need the “</PERMISSION>” at the exact location as seen here, and not at the
   end of the output, so putting it in the “Xml root elements” doesn’t help.
 * This is the closest I get:
 * <?xml version=”1.0″ encoding=”UTF-8″?><root><PERMISSION><CUST_DETAILS>
    <USERNAME
   >lalala</USERNAME> <PASSWORD> lala122</PASSWORD> <CARD_TYPE>customer</CARD_TYPE
   > <P_N>John</P_N> <MAIL>john@yahoo@com</MAIL> <REM>Hi there</REM> <MAKOR>Website
   </MAKOR> </CUST_DETAILS></PERMISSION></root>
 * Any hint on how I can achieve the output structure that I need – (shown above,
   the first One here)where for example </permission> will appear after </password
   >, and <CUST_DETAILS> will appear after </CARD_TYPE>?
 * I do not know JS or PHP too well.
 * Thank you,
 * Yaniv
 * [https://wordpress.org/plugins/forms-3rdparty-integration/](https://wordpress.org/plugins/forms-3rdparty-integration/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/xml-post-structure/#post-4817590)
 * Sorry for the delay. You could write another hook similar to the [Forms 3rd-party XPost](https://github.com/zaus/forms-3rdparty-xpost),
   hooking later, to manipulate the [`$args['body']` string returned by the plugin](https://github.com/zaus/forms-3rdparty-xpost/blob/master/forms-3rdparty-xpost.php#L39).
   Something like:
 *     ```
       function my_cf7_xml_override($args, $service, $form) {
           $body = $args['body'];
   
           // pull out relevant contents via regex, substring, etc
           // re-wrap and combine back into body
   
           $args['body'] = $body;
           return $args;
       }
       add_filter('Forms3rdPartyIntegration_service_filter_args', 'my_cf7_xml_override', 13 /* later than original xpost plugin */, 3);
       ```
   
 * The better solution would be for XPost to interpret 3rdparty field names with
   a slash (or something else) to indicate element nesting, so you could map to `
   PERMISSIONS/USERNAME` rather than `USERNAME`. Can you [create a new issue](https://github.com/zaus/forms-3rdparty-xpost/issues)
   and link back to this thread?
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 12 months ago](https://wordpress.org/support/topic/xml-post-structure/#post-4817591)
 * Eh, I should have just made the issue for you — so I did: [https://github.com/zaus/forms-3rdparty-xpost/issues/1](https://github.com/zaus/forms-3rdparty-xpost/issues/1)
 * Please add comments there. I’ll try to get back to it soon.
 *  Plugin Author [zaus](https://wordpress.org/support/users/zaus/)
 * (@zaus)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/xml-post-structure/#post-4817606)
 * This functionality has been included in latest version of [https://wordpress.org/plugins/forms-3rd-party-xpost/](https://wordpress.org/plugins/forms-3rd-party-xpost/)—
   see FAQ for nesting elements.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Xml post structure’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/forms-3rdparty-integration.svg)
 * [Forms: 3rd-Party Integration](https://wordpress.org/plugins/forms-3rdparty-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forms-3rdparty-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forms-3rdparty-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/forms-3rdparty-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forms-3rdparty-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forms-3rdparty-integration/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [zaus](https://wordpress.org/support/users/zaus/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/xml-post-structure/#post-4817606)
 * Status: resolved