Expand my Community achievements bar.

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

XSD and empty tags

Avatar

Level 2

Hi,

Is there a way to setup a XSD or the XDP to omit XML tags which have empty fields in the form?

Let's say I have two checkbox groups. If you answer YES to the first one the second one opens up and needs to be filled in. If you answer NO then the second one does not get filled in. In the latter case, I dont want to XML for the checkbox group to be in the XML that will be produced.

Thanks

Tys

2 Replies

Avatar

Former Community Member

Nope ...the tags appear if the field is bound. If you do not want the field in the data stream then you woudl set the binding to none. This binding is not dynamic ....meaning that you cannot change it after it has been established when the form is rendered. You woudl have to write an XSLT transformation to modify the xml that has been submitted.

Paul

Avatar

Level 10

Hi Tys,

I might be misunderstanding this but If you define your schema elements with a minOccurs="0" attribute then generally the elements will be omitted from the resulting XML.  So something like;

<xs:element name="Field1" type="xs:string" minOccurs="0" />

A checkbox seems to be a bit different as by default it has values of 1 for on and 0 for off (so is never empty).  To get an xml element bound to a checkbox to be omitted from the resulting xml you seem to have to change the off value to an empty string, in the Object Binding tab.

CheckBox Off Value.JPG

Bruce