Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!

Issue with xfa.host.exportData("",0)??

Avatar

Former Community Member

Hello All,

The .xml file created by xfa.host.exportData("",0) failes to validate due to the presence of empty tags when submitting.

Below is a sample.......

The empty tags represent optional fields on my form. i.e TwoDoorPassengerVolumeMeasure is not required in some submissions.

How can remove these before generating this file?

Thanks in advance!!

<?xml version="1.0" encoding="UTF-8" ?>

- <v:CarlineSubmission xmlns:v="https://rrevm-veerr.ss.ec.gc.ca/">

- <v:SubmissionAuthorDetails>

  <v:ManufacturerCode>E97</v:ManufacturerCode>

  <v:ModelYear>2013</v:ModelYear>

  </v:SubmissionAuthorDetails>

- <v:CarlineInformationDetails>

  <v:ManufacturerDivisionCode>1</v:ManufacturerDivisionCode>

  <v:CarlineCode>2</v:CarlineCode>

  <v:CarlineClassCode>2</v:CarlineClassCode>

  <v:FullCarlineName>test</v:FullCarlineName>

- <v:VehicleVolumeMeasureDetails>

  <v:AveragePassengerVolumeMeasure>40.000</v:AveragePassengerVolumeMeasure>

  <v:AverageLuggageVolumeMeasure>35.000</v:AverageLuggageVolumeMeasure>

  <v:TwoDoorPassengerVolumeMeasure />

  <v:TwoDoorLuggageVolumeMeasure />

  <v:FourDoorPassengerVolumeMeasure />

  <v:FourDoorLuggageVolumeMeasure />

  <v:HatchbackPassengerVolumeMeasure />

  <v:HatchbackLuggageVolumeMeasure />

  </v:VehicleVolumeMeasureDetails>

  </v:CarlineInformationDetails>

  </v:CarlineSubmission>

2 Replies

Avatar

Level 10

Hi Ken,

Has your XML Schema got the minOccurs="0" for the TwoDoorPassengerVolumeMeasure element?  If it has there should be a dd:nullType="exclude" attribute added to the dataDescription section of your form (you should be able to find it in the XML Source view).  It sometimes doesn't get added but as far as I know only if the minOccurs is on a complex type, so you would then have to add it manually (we use a macro but it is quite specific to our style of XML Schema).

There is more about the nullType attribute at John Brinkman's blog http://blogs.adobe.com/formfeed/2009/12/null_data_handling.html

Good luck,

Bruce

Avatar

Former Community Member

Hello

Thanks for your help.

I believe you have answered my question but my PC is giving me issues right now. Not sure how I tag this as "answered"

Br

Ken