XMLNS tag is unexpected in XMLPort (Business Central)

Dear readers,

I have some PEPPOL 2.0 ( UBL ) files that are sent to me by an external source;

These Invoice XML files have quite some namespaces; (The BOLD one is causing the problems)

www.w3.org/.../XMLSchema-instance"](http://www.w3.org/2001/XMLSchema-instance) xmlns=“urn:oasis:names:specification:ubl:schema:xsd:Invoice-2” xmlns:qdt=“urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2” xmlns:ccts=“urn:oasis:names:specification:ubl:schema:xsd:CoreComponentParameters-2” xmlns:stat=“urn:oasis:names:specification:ubl:schema:xsd:DocumentStatusCode-1.0” xmlns:cbc=“urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2” xmlns:cac=“urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2” xmlns:udt=“urn:un:unece:uncefact:data:draft:UnqualifiedDataTypesSchemaModule:2”>

I’ve added all namespaces in my XMLport

Namespaces = “” = ‘urn:oasis:names:specification:ubl:schema:xsd:Invoice-2’,
qdt = ‘urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2’,
ccts = ‘urn:un:unece:uncefact:documentation:2’,
stat = ‘urn:oasis:names:specification:ubl:schema:xsd:DocumentStatusCode-1.0’,
cbc = ‘urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2’,
cac = ‘urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2’,
udt = ‘urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2’;

However when I try to read the valid UBL (XML) file, I’ll receive the Error message

pastedimage1630308511214v1.png

I’ve tried using the DefaultNameSpace tag, (with the UseDefaultNameSpace = true), mixing the order but nothing seems to work.
Other programs read the file without problems, so it must be an XMLPort problem.

Looking at XMLPort 1602 Sales Invoice - PEPPOL 2.0 which is basically the same thing except “Export only”, instead of Import what I need, the Namespaces are declared the same way. (One is missing, but removing this from my file doesn’t change a thing.)

The only way to read the File is to strip the xmlns namespace from the XML data, then the file will be read correctly.

When I Export this XMLPort, the file structure is identical, except the xmlns (so the “default” one) is listed LAST instead of second as it is in the files that the external party generates.

I’m not sure if this is a bug, or if my code is wrong, but I hope someone knows the answer here