Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Extracting XML out of HTML form

Avatar

Level 4

Hello,

I created a xdp file and converted it into HTML using renderHTMLForm operation in workbench. Now I want to submit this HTML form to a servlet and extract the XML out of it.

I was able to submit it but the output is in some encoded format but not XML. Is there any way in which I can extract xml data from a HTML form at the click of a button?

Sample output which I got -

FSPAGENO_=0&FSPAGECOUNT_=2&FSFOCUS_=&FSCLICKEDBUTTON_=&FSINITIALIZED_=&firstName%5B0%5D=Alex&lastName%5B0%5D=Tim&Button1%5B0%5D=Button&textfield1%5B0%5D=&textfield2%5B0%5D=&FSAPPLICATIONDATA_=H4sIAAAAAAAAAM1Yx87kSI6%2

B91MU%2FmuiSlLKN7p6IO%2BllE0pLwN576WUefrRX93VM7M7wOxxExAQDH5kMJgRJIO%2F%2FW1vmy%2FvdJrLvvv%2BAX0DP76kXdwnZZd%2F%2F3Ad%2Fivx8bfff%2Fntb3sWfsnTLp3CpZ%2B%2Bf%2Fg8df878vGFekjeT2H4G%2FYNgkEMvpR8yuzJ8Ov1fblW6ObP0fePYlmGXwGgm

Thanks

1 Reply

Avatar

Former Community Member

Why not use regular expressions to parse the output?  You can isolate the fields and values to construct a new XML schema.