Optional elements should not create XML Tags when empty

E

Eugen

Hi,

I have this schema definition:

<xs:element minOccurs="0" name="MaxNo_Entries">
<xs:annotation>
<xs:documentation>Maximale Anzahl Einträge</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="fintstype:num">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="9999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>

This is part of the new german banking standard, which can be found under
(http://www.hbci-zka.de/spec/4_0.htm) only in german, sorry. This is an
official standard, so I am unable to make any changes to these schemas. By
the way, the current MSXML Parser is still unable to verify XML against
these schemas! I hope this gets fixed, since Xerces and XML Spy so not have
such problems.

However, when I create a form and add a field "MaxNo_Entries", it is an
optional field, and i do not have to fill it with data. But when I exctract
the XML from "thisXDocument.DOM.documentElement.xml" I get an empty XML Tag
<MaxNo_Entries> resulting in an invalid XML Document, since "MaxNo_Entries"
is optional, but when it is present, it must be filled with at least one
character.

How can I tell Infopath to remove this XML Tag, if it is empty?

Greetings
Eugen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top