XML CONVERTAR

0
Hello folks The customer requested to be able to enter excel sheet containing the billing details. then it will be converted into cXML structure  I started doing this by relying on XML Shcema because Mendix doesn't understand the cXML syntax .Now I am very close to reaching the appropriate structure but I am facing the following problem :  This is the result I want to reach :    <Credential domain="NetworkID">             <Identity>1000003983</Identity>             <SharedSecret>welcome</SharedSecret>         </Credential>  This is what I get now :    <Credential >            <domain>NetworkID</domain>              <Identity>1000003983</Identity>             <SharedSecret>welcome</SharedSecret>         </Credential> How can I put the value of a domain attribute inside a Credential entity tag.  Thanks in advance   
asked
1 answers
1

Hi Bahaa,

Did you declare domain as attribute in your XML schema? If not than you need to add this in your XML schema. 

Please see the below XML schema that I used to generate the XML that you wanted. 

XML Schema: 

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:element name="Credential">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Identity" minOccurs="0" type="xs:long"/>
        <xs:element name="SharedSecret" minOccurs="0" type="xs:string"/>
      </xs:sequence>
      <!-- This is where to declare attributes: -->
      <xs:attribute name="domain" type="xs:long"/>
    </xs:complexType>
  </xs:element>
</xs:schema>

 

This is the test microflow that I used to create credential object using Export to XML action

Export Mapping and XML Schema:

Result Output:

 

Hope this helps!

 

answered