Expand my Community achievements bar.

New Root appears for data when rendering form

Avatar

Level 8

We are using the sample code below to render the form.

Just recently, we noticed that when the form is rendered and the XML is exported using Adobe Acrobat, we see a new root showing on top of the previous root node. For example, of the data structure looks as follows:

<root>

  <customer_name>John</customer_name>

</root>

it will become like the following:

<xfa:data>

  <root>

    <customer_name>John</customer_name>

  </root>

</xfa:data>

Sample code used:

    PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec(

    true, //boolean cacheEnabled

    null,//PDFVersion

    true,//boolean taggedPDF

    false,//boolean linearizedPDF

    null,//String seedPDF

    AcrobatVersion.Acrobat_9,

    null,//String xCIURI

    sCharSet,//String charset

    RenderAtClient.Yes,//key to dynamic forms!

    sLocale,// locale

    false, //standAlone

    FormModel.both,

    false//setXML

    );       

                   

            //Specify URI values that are required to render a form

            URLSpec uriValues = new URLSpec();

            uriValues.setContentRootURI("repository:///");

                   

            //Invoke the renderPDFForm method and write the

            //results to a client web browser

            FormsResult formOut = formsClient.renderPDFForm(

                        formName,               //formQuery

                        oInputData,             //inDataDoc

                        pdfFormRenderSpec,      //PDFFormRenderSpec

                        uriValues,                //urlSpec

                        null            //attachments

                        );

       

            //Create a Document object that stores form data

            myData = formOut.getOutputContent();

            myData.passivate();

            myData = readerExtensionsApply(sRECert, myFactory, myData);

Appreciate your help to resolve this problem.

Tarek

2 Replies

Avatar

Level 10

As far as i know Acrobats import/export methods only handle the data stored in the default data node xfa:data under xfa:datasets.

To get a different export result you can use a XSLT-stylesheet, which can be embedded through the forms data connection settings.

Avatar

Level 8

Actually that was very unusual. The extra root node "xfa:data" showed up only after the pdf was rendered from the server. Before that everything was normal.

Tarek