michael

michael

  • NA
  • 1
  • 0

generate xml file based on xsd and data

Oct 5 2007 3:38 AM

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>