Domain to XML without namespace

0
To generate the XML files for the new international payment format pain.008, we are using a domain to xml mapping in a microflow. When i create an xml file or a string containing the generated xml, every item has ns1: in front of the tag name (example below). Is there a way to disable this namespace part when generating the xml from the Domain to xml mapping? Example part of xml: <?xml version='1.0' encoding='utf-8'?> <ns1:Document xmlns:ns1="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"> <ns1:CstmrDrctDbtInitn> <ns1:GrpHdr> <ns1:MsgId>90040000-11912-20130530153645</ns1:MsgId> <ns1:CreDtTm>2013-05-30T15:36:45.100Z</ns1:CreDtTm> <ns1:NbOfTxs>1</ns1:NbOfTxs> What i would like is xml like: <?xml version='1.0' encoding='utf-8'?> <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"> <CstmrDrctDbtInitn> <GrpHdr> <MsgId>90040000-11912-20130530153645</MsgId> <CreDtTm>2013-05-30T15:36:45.100Z</CreDtTm> <NbOfTxs>1</NbOfTxs>
asked
2 answers
1

It's not possible to generate xml without a namespace in a domain to xml mapping. Is there a reason you don't want a namespace? Because I would recommend always using a namespace in xml.

answered
3

I found an answer in the xsd.

<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">

The parts:

elementFormDefault="qualified"

and

targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"

declare all elements in the xml are part of the targetNamespace This results in the following statement in the generated xml:

<ns1:Document xmlns:ns1="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">

Where the part

xmlns:ns1="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"

states that all elements with ns1: are part of the namespace. "urn:iso......"

In conclusion: the Mendix framework is following the xsd/xml rules and there is no error.

Solved bij google/research, added the answer for future reference.

EDIT: I cannot set my own answer as the best answer, but it is solved.

answered