How to get java code generated by XML output using Xform engine

My application uses XForms to view it, and XForms generates XML output containing a user-defined response. If we include the following line

<fr:xforms-inspector xmlns:fr="http://orbeon.org/oxf/xml/form-runner"/> 

in the code we see the generated output on the screen. Therefore, for the username, if the user type amit, it will also have generated XML.

I really wanted to get this generated XML in my Java class to store it in the database and parse it and share its contents. I tried the following code to get this XML, but could not get the generated XML.

BufferedReader requestData = new BufferedReader(new InputStreamReader(request.getInputStream()));
StringBuffer stringBuffer = new StringBuffer();
String line;
try{
  while ((line = requestData.readLine()) != null) {
    stringBuffer.append(line);
  }
} catch (Exception e){}
   return stringBuffer.toString();
}

Please let me know what I'm doing badly.

+3
source share
1 answer

, Java JSP, XML, JSP XForms, XML, . Dom4j ; , ( , , , ):

Document queryDocument = xmlReader.read(request.getInputStream());
String query = queryDocument.getRootElement().getStringValue();

. , .

0

Source: https://habr.com/ru/post/1794394/


All Articles