Skip to Main Content
Categories Feature request
Created by Asger Smidt
Created on Sep 26, 2024

XsdValidate: Make IgnoreWhitespace configurable

The origin of this feature request is this support case: https://bizbrains.atlassian.net/browse/PTI-383?atlOrigin=eyJpIjoiYTZmZWZkZDE2NDQ3NDBlNzhiM2IzNTMwMjRhM2FmMGEiLCJwIjoiaiJ9


The Edifact disassembler very deliberately accepts fields that contain nothing but whitespace, since it has no way to determine whether the sender and receiver consider that a valid value of the field. This becomes a problem if the disassembled Edifact is then put through XSD validation.

In all the Microsoft Edifact schemas, the minLength value of text fields is 1, the rule being that if a field is completely empty it should not be created in the Xml. In Link, the XSD validation has the property IgnoreWhitespace hard coded to true. As such, if a field contains nothing but whitespace, the validation sees it as empty and the validation of the field then fails because the length of the field is perceived as 0.

As far as I can tell, the XSD validation has worked like that probably as far back as EdiPortal, so this is not a new issue. On the other hand, I think maybe the Biztalk Edifact disassembler does not include whitespace-only fields in the Xml output. This, combined with the fact that receiving Edifact containg whitespace-only fields is a rare occurrence may explain why we haven't come across this problem before now.

The proposed solution is simple: Add a boolean IgnoreWhitespace property to the config of the XsdValidate step, with a default value of true for backwards compatibility's sake.

  • Attach files