0
Answer

generate xml file based on xsd and data

michael

michael

17y
1.9k
1

I wonder wether it is possible to generate a XML file based on one or several xsd file(s) AND data. For example, I have some data who looks like this:

name;value
bmw;5
audi;100
nokia;N95

The XSD file may looks like this:
  <element name="cars">
    <complexType>
      <complexContent>
        <extension base="xn:NrmClassXmlType">
          <sequence>
            <element name="attributes" minOccurs="0">
              <complexType>
                <all>
                  <element name="bmw" minOccurs="0" />
                </all>
              </complexType>
            </element>
         </sequence>
        </extension>
      </complexContent>
    </complexType>
  </element>
  <element name="mobilephones">
    <complexType>
      <complexContent>
        <extension base="xn:NrmClassXmlType">
          <sequence>
            <element name="attributes" minOccurs="0">
              <complexType>
                <all>
                  <element name="nokia" minOccurs="0" />
                </all>
              </complexType>
            </element>
         </sequence>
        </extension>
      </complexContent>
    </complexType>
  </element>