how to define Required Field in Flat File Schema?

Home Page Forums BizTalk 2004 – BizTalk 2010 how to define Required Field in Flat File Schema?

Viewing 1 reply thread
  • Author
    Posts
    • #16336

      a flat file with a field value null, e.g.

      Title,Name,,Address

      In the example the 3rd filed is null, i want this file to fail the validation against Schema, but it still pass through and not suspended even if the "Min Occurs" for this field is set to 1.

       Then i found out the Min Occurs is not checking for full, it's just check the field is there or not…..

      How should i do to make a field become a required one and suspend the file if the field is null?

    • #16339

      The minOccurs attribute only checks for the existence of the node, not the content.

      To create a constraint against the node content you need to derive your own types

      e.g.
      <element name="EmailAddress type="non-empty-string"/>
      <simpleType name='non-empty-string'>
        <restriction base='string'>
          <minLength value='1'/>
        </restriction>
      </simpleType>

      • #16353

        Thanks Greg, it spent me some time to figure it out to use the XML Schema editor…..really good feature

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.