Export to XML produces faulty XML, is there anyone with Javacode or other solution to export XML?

0
Hello, we are currently implementing SEPA for one of our clients. The application is still in version 2.5.8 of the Modeler. For SEPA, payments will have to exported to an XML-file. This is possible with version 2.5.8. However, one of the elements (Amt) in the XML-file has a child-element (InstdAmt), which in turn has an attribute (Ccy) defined. So in the xml it should look like: < Amt >   < InstdAmt Ccy="" > < /InstdAmt > < /Amt > And though the previews in the modeler seem to say that the Ccy attribute indeed belongs to InstdAmt, the actual exported file consistently has the attribute at the Amt-element. < Amt Ccy="" >   < InstdAmt > < /InstdAmt > < /Amt > We have filed a support request with Mendix, but they asked for a slimmed down version of our model for them to test and reproduce the problem against. But this is difficult, since the model is huge. Is there anyone who has - in the past - made Java-code to export to XML or has another solution?
asked
2 answers
1

Martijn,

Like Samet said it might be an issue with the used version. I tried to export the xml based on the follwoing xsd (Mx 4.4.4):

    <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Amt">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="InstdAmt">
          <xs:complexType>
            <xs:simpleContent>
              <xs:extension base="xs:string">
                <xs:attribute type="xs:string" name="Ccy"/>
              </xs:extension>
            </xs:simpleContent>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

This delivers the follwing xml as expected:

<?xml version='1.0' encoding='UTF-8'?>
<Amt>
          <InstdAmt Ccy="b">a</InstdAmt>
</Amt>
answered
1

Hi Erwin, Achiel,

we are also in the process of upgrading the application to 4.6.0. And we already found out that the XML is formed good there.

The arrangement with the client is now to exclude the XML-export from the next production-delivery, to then upgrade the test-environment to 4.6.0 with the XML-export added. The client will then have to fully test the application again. Then we'll bring the 4.6.0 version to production.

Thanks for the replies!

answered