Attributes on XSD Schema Bound Form

Avatar

Avatar

jnicholas330

Avatar

jnicholas330

jnicholas330

17-11-2016

I have a form that is bound to a schema that has a definition like this:

<xsd:complexType name="File">

        <xsd:simpleContent>

            <xsd:extension base="xsd:base64Binary">

                <xsd:attribute name="fileName" type="xsd:string" use="optional"/>

                <xsd:attribute name="mimeType" type="xsd:string" use="optional"/>

            </xsd:extension>

        </xsd:simpleContent>

    </xsd:complexType>

The problem is that when the data is exported using Acrobat XI's Export Data (as XML) option, the attributes (which are not bound), are included in the output, i.e.

<FileValue fileName="" mimeType=""/>

Which causes issue when validating the schema, using XMLSpy. The output I expect (and need is this):

<FileValue />

Is there a way to accomplish this?

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar

_Bruce_Robertson

MVP

Avatar

_Bruce_Robertson

MVP

_Bruce_Robertson
MVP

21-11-2016

Hi,

I asked the same question of John Brinkman in his FormFeed blog under his article of Null Data Handling .  It's a great shame the comments are no longer visible on the blog as there was a great deal of useful information but he was not aware of a way of excluding null content in an attribute, so I would assume there is not one.

I would suggest investigating an XSLT assigned in the Transform Outgoing Data option of your Data Connection.  I ended up handling the attributes on the server before XSD validation as I thought at the time that would allow me to perform any other hacks that might be needed, but the XSLT would be easier and more self contained.

Regards

Bruce

Avatar

Avatar

jnicholas330

Avatar

jnicholas330

jnicholas330

25-11-2016

Bruce,

I found the old thread here:

Null Data Handling « FormFeed

I'll have to look at a way of relaxing the schema to accommodate this.

J