v.1.25.3.2

XMas

XMas generates XML and WSDL files from an XSD one

XSD 2 XML

Select or drag and drop an XSD file.

The XSD file is validated during the loading phase.

If the validation file is ok, the XSD 2 XML feature is ready to produce an XML file demo. The file is based on the Selected XML root element and the chosen options.

Choose one between the interfaces contained

and decide what kind of output to produce.

With Just Structure selected, the XML structure is produced without occurrences and data simulation

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<ZTEST_LIGEST xmlns:tns="urn:nick4name.eu:test"
              xmlns="urn:nick4name.eu:test">
	<I_BANUM/>
	<I_BANFN/>
	<I_BEDAT/>
	<T_RDA>
		<item>
			<BNFPO/>
			<MATNR/>
			<MENGE/>
			<MEINS/>
		</item>
	</T_RDA>
</ZTEST_LIGEST>

Unselecting Just Structure produces an XML without data simulation but considering the occurrences

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<ZTEST_LIGEST xmlns:tns="urn:nick4name.eu:test"
              xmlns="urn:nick4name.eu:test">
	<I_BANUM/>
	<I_BANFN/>
	<I_BEDAT/>
	<T_RDA>
		<item>
			<BNFPO/>
			<MATNR/>
			<MENGE/>
			<MEINS/>
		</item>
		<item>
			<BNFPO/>
			<MATNR/>
			<MENGE/>
			<MEINS/>
		</item>
	</T_RDA>
</ZTEST_LIGEST>

Selecting Data Simulation, elements, and attributes are filled with random data based on data types and restrictions.

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<ZTEST_LIGEST xmlns:tns="urn:nick4name.eu:test"
              xmlns="urn:nick4name.eu:test">
	<I_BANUM>-1482740340</I_BANUM>
	<I_BANFN>vVP</I_BANFN>
	<I_BEDAT>2050-70-70</I_BEDAT>
	<T_RDA>
		<item>
			<BNFPO>25837</BNFPO>
			<MATNR>okxAScqGSWGLuzCArluR</MATNR>
			<MENGE>974760514.129</MENGE>
			<MEINS>XH</MEINS>
		</item>
	</T_RDA>
</ZTEST_LIGEST>

With Anonymize XML the XML is generated without namespaces

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<ZTEST_LIGEST>
  <I_BANUM>-1648222006</I_BANUM>
  <I_BANFN>nY</I_BANFN>
  <I_BEDAT>8726-04-23</I_BEDAT>
  <T_RDA>
    <item>
      <BNFPO>80745</BNFPO>
      <MATNR>mlcLnJrFkXCGgSKcjhcAQOixFWLQtf</MATNR
      <MENGE>676361219.181</MENGE>
      <MEINS>j</MEINS>
    </item>
  </T_RDA>
</ZTEST_LIGEST>

With Prepare XML for validation, the XML file is produced by referencing the current XSD which will validate its structure.

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<ZTEST_LIGEST p1:noNamespaceSchemaLocation="GenericRequestReply_test_rda.xsd"
              xmlns:p1="http://www.w3.org/2001/XMLSchema-instance">
	<I_BANUM>84514286</I_BANUM>
	<I_BANFN>VucgWcJ</I_BANFN>
	<I_BEDAT>2704-67-45</I_BEDAT>
	<T_RDA>
		<item>
			<BNFPO>58260</BNFPO>
			<MATNR>oHBmCWEIlBgYgbVCcUwqfSSSGnuNQEChsgqgxmx</MATNR>
			<MENGE>1805189581.154</MENGE>
			<MEINS>N</MEINS>
		</item>
	</T_RDA>
</ZTEST_LIGEST>

If the XSD file is not configured to validate the produced XML file and others of the same type, XMas will propose to adjust it

Removed tags are retained as commented on

<?xml version="1.0" encoding="utf-8"?>
<!--Removed: targetNamespace=urn:nick4name.eu:test-->
<!--Removed: xmlns=urn:nick4name.eu:test-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <xsd:element name="ZTEST_LIGEST">
    <xsd:complexType>
      <xsd:sequence>

With Validate the XML produced, the generated XML file is immediatly validated by the current XSD file.

A message confirms this

Known limitations

If the XSD contains features that are not yet supported, the file is not imported and an error is notified

Currently:

Features supportedFeatures not yet supported
Root elements definition by reference (type attribute) or without reference (xsd:complexType under xsd:element, nested)
xsd:all
xsd:attribute @ref
xsd:complexType
xsd:simpleType
xsd:restriction
xsd:simpleContent
xsd:complexContent
xsd:simpleContent
xsd:extension
xsd:enumeration
xsd:choice
xsd:group
xsd:attributeGroup
xsd:union
xsd:…

The namespace are not fully supported in XSD 2 XML functionalities.

XSD 2 WSDL

If you want to generate a WSDL file from the XSD one select XSD 2 WSDL

You have:

  • To set the direction of the interface under Root elements. If there is more than one interface you can also set just one, in inbound mode, to prepare the WSDL for an asynchronous scenario;
  • To confirm or set a Namespace;
  • To set a service name, Service name;
  • Optionally, you can set up 2 endpoints;
  • You can decide to produce an indented or linearized output, Save linearized.

Known limitations

WSDL generation supports just one xsd:schema structure with one or two root elements. The root elements exceeding are ignored.

XML 2 XSD

If you want to generate an XSD file from the XML template select XML 2 XSD

Select or drag and drop an XML file.

The XML file is validated during the loading phase.

If the validation file is okay, the XML 2 XSD feature is ready to produce an XSD file. The file produced is based on the options selected.

Starting from the following XML template

<ZMAT_EXT>
   <IDOC>
      <E1MARAM>
         <MATNR>40000414</MATNR>
         <ZE1MARACUST>
            <ZZRICETTA>R00274</ZZRICETTA>
            <ZZMAND_PIST>000</ZZMAND_PIST>
         </ZE1MARACUST>
         <ZMATCUST>
            <MSGFN>005</MSGFN>
            <CLASS>Z_CAMPI_AGG</CLASS>
         </ZMATCUST>
         <ZMATCUST>
            <MSGFN>005</MSGFN>
            <CLASS>Z_CAMPI_PLS</CLASS>
         </ZMATCUST>
      </E1MARAM>
   </IDOC>
</ZMAT_EXT>

With no options selected, an XSD is produced with all elements set to optional, minOccurs=“0”, and with only the type to describe the element data type based on the tag value, type=“xs:integer”.

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ZMAT_EXT">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="IDOC" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="E1MARAM" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="MATNR" minOccurs="0" type="xs:integer" />
                    <xs:element name="ZE1MARACUST" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="ZZRICETTA" minOccurs="0" type="xs:string" />
                          <xs:element name="ZZMAND_PIST" minOccurs="0" type="xs:integer" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="ZMATCUST" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="MSGFN" minOccurs="0" type="xs:integer" />
                          <xs:element name="CLASS" minOccurs="0" type="xs:string" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

With Set all tags as mandatory, all XSD elements and structures are set with minOccurs to 1

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ZMAT_EXT">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="IDOC" minOccurs="1" maxOccurs="1">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="E1MARAM" minOccurs="1" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="MATNR" minOccurs="1" maxOccurs="1" type="xs:integer" />
                    <xs:element name="ZE1MARACUST" minOccurs="1" maxOccurs="1">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="ZZRICETTA" minOccurs="1" maxOccurs="1" type="xs:string" />
                          <xs:element name="ZZMAND_PIST" minOccurs="1" maxOccurs="1" type="xs:integer" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="ZMATCUST" minOccurs="1" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="MSGFN" minOccurs="0" type="xs:integer" />
                          <xs:element name="CLASS" minOccurs="0" type="xs:string" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

With Add attributes FormDefault and elementFormDefault, the attributes attributeFormDefault and elementFormDefault are added unqualifying the attributes with a prefix and qualifying the elements with a prefix

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified">
  <xs:element name="ZMAT_EXT">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="IDOC" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="E1MARAM" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="MATNR" minOccurs="0" type="xs:integer" />
                    <xs:element name="ZE1MARACUST" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="ZZRICETTA" minOccurs="0" type="xs:string" />
                          <xs:element name="ZZMAND_PIST" minOccurs="0" type="xs:integer" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="ZMATCUST" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="MSGFN" minOccurs="0" type="xs:integer" />
                          <xs:element name="CLASS" minOccurs="0" type="xs:string" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

With the Add maxLength restriction for empty tags too option, the type attribute of xs:element is replaced by a simpleType structure containing the appropriate element based on the value of the tag in the XML template, e.g., the maxLength or totalDigit element.

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ZMAT_EXT">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="IDOC" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="E1MARAM" minOccurs="0">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="MATNR" minOccurs="0">
                      <xs:simpleType>
                        <xs:restriction base="xs:integer">
                          <xs:totalDigits value="8" />
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:element>
                    <xs:element name="ZE1MARACUST" minOccurs="0">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="ZZRICETTA" minOccurs="0">
                            <xs:simpleType>
                              <xs:restriction base="xs:string">
                                <xs:maxLength value="6" />
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                          <xs:element name="ZZMAND_PIST" minOccurs="0">
                            <xs:simpleType>
                              <xs:restriction base="xs:integer">
                                <xs:totalDigits value="3" />
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="ZMATCUST" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="MSGFN" minOccurs="0">
                            <xs:simpleType>
                              <xs:restriction base="xs:integer">
                                <xs:totalDigits value="3" />
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                          <xs:element name="CLASS" minOccurs="0">
                            <xs:simpleType>
                              <xs:restriction base="xs:string">
                                <xs:maxLength value="11" />
                              </xs:restriction>
                            </xs:simpleType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

These options can create an xs:element instead of a xs:complexType basing on the following create options.

With Element name, an xs:element will be created with @name attribute, named as the XML root and incorporating an xs:complexType.

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ZMAT_EXT">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="IDOC" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
[...]
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

With DataType name, will be created the XSD file directly with the xs:compexType with @name attribute, named as the XML root

<?xml version="1.0" encoding="utf-8"?>
<!-- Generated with XMas by Nick4Name (https://www.nick4name.eu) -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="ZMAT_EXT">
    <xs:sequence>
      <xs:element name="IDOC" minOccurs="0">
        <xs:complexType>
          <xs:sequence>
[...]
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

This option is useful for creating a data type that different xs:elements can use for their own typing.

Always updated

XMas checks for updates at every run.

You can download XMas from here.