prowide / prowide-iso20022

Comprehensive business model and parser for all ISO 20022 messages
https://www.prowidesoftware.com
Apache License 2.0
147 stars 68 forks source link

Parsing issue with MX message of type xsys.003.001.01 #41

Open john236 opened 2 years ago

john236 commented 2 years ago

My issue sounds similar to https://github.com/prowide/prowide-iso20022/issues/39 but is about the xsys.003.001.01 message type.

The ThirdPartyRefusalReason element is of type SwAny but when I try to parse a message with a 4 character string in that element, for example: <Sw:ThirdPartyRefusalReason>ABCD</Sw:ThirdPartyRefusalReason> then SwAny.any is null.

zubri commented 2 years ago

I see. We need to find general solution for all Any types in the parser.

john236 commented 2 years ago

fyi, Swift have now changed the SwAny type so it must have a child element. For example:

<Sw:ThirdPartyRefusalReason>
  <Sw:Cd>ABCD</Sw:Cd>
</Sw:ThirdPartyRefusalReason>
zubri commented 2 years ago

Test case and a few exploration approaches have been pushed to: https://github.com/prowide/prowide-iso20022/pull/48

XmlAnyElement is expected to be parsed into a generic Element node.

The root cause is probably in our NamespaceAndElementFilter and MxReadImpl classes. But could not find a solution to fit al scenarios yet.