Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Control over submitted XML data

Avatar

Level 1

I am an advanced Designer user. I use a submit button to send form XML to a server - all fine. The issue I have is that the XML needs to be in a specific format to fit in with a specific schema), not just the standard form fields.

So....

Is there any way to use javascript on the form to modify the XML before it is sent using the XML submit button?

I realize that it would be possible to "post-process" the XML by using a program at the server to transform the XML to the format I need after it has been submitted, but because of integration issues, this is an option I am hoping to avoid. The same applies to calling a webservice from the form - it would solve the XML formatting problem, but first prize is to do all the processing of the XML in the form, and avoid any server side processes.

Thanks,


Ed

0 Replies

Avatar

Level 10

The structure of the xml that is submitted is controlled by the hierarchy of the form unless you use a schema or sample XML data file in the dat aview. In those cases the schema format or sample xml format will be followed. so I woudl simply import the schema into the DataSource view and bind the fields that you want to the apppropriate fields in the schema. After that the data will be submitted in the schema defined format.

Hope that helps

Paul

Avatar

Level 2

When you define your form using a schema or sample XML, you get the opportunity to "Transform outgoing data" by specifying an XSLT script.

When you provide a script here, it will execute against your data before it is submitted.

Your other option is to bypass the submit processing and use FormCalcs put/post methods to explicitly format your message.

  John

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now