Hi Dominik,
There are tools that provided with a set of XML documents (one or more)
will be able to generate a schema for you. Then you can just adjust
that schema as you like. One such tool is TRANG that is also integrated
through a GUI in oXygen:
http://www.thaiopensource.com/relaxng/trang.html
For instance on your sample file it gives the following XML Schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="
http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="docDefinition">
<xs:complexType>
<xs:sequence>
<xs:element ref="tagDefinition"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:integer"/>
</xs:complexType>
</xs:element>
<xs:element name="tagDefinition">
<xs:complexType>
<xs:sequence>
<xs:element ref="attribute"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:integer"/>
<xs:attribute name="label" use="required" type="xs:NCName"/>
<xs:attribute name="tagName" use="required" type="xs:NCName"/>
</xs:complexType>
</xs:element>
<xs:element name="attribute">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="value"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:integer"/>
<xs:attribute name="label" use="required" type="xs:NCName"/>
<xs:attribute name="name" use="required" type="xs:NCName"/>
<xs:attribute name="type" use="required" type="xs:NCName"/>
</xs:complexType>
</xs:element>
<xs:element name="value">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:NCName">
<xs:attribute name="id" use="required" type="xs:integer"/>
<xs:attribute name="label" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
Best Regards,
George