XML Schema Oxygen validation problems

MrsEdwardCullen

New Member
I have a couple problems with generating XML Schema for an XML document. The XML document should look like this:\[code\]<HEADER> <ID>64639</ID> .... <INCIDENT> <HEADER>64639</HEADER> </INCIDENT> <INCIDENT> <HEADER>64639</HEADER> </INCIDENT> ....</HEADER>\[/code\]So far I achieved the following structure:\[code\]<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"><xsd:element name="HEADER"> <xsd:complexType> <xsd:all> <xsd:element minOccurs="1" name="ID" nillable="false" type="xsd:integer"/> </xsd:all> </xsd:complexType> <xsd:key name="SYS_C0032500"> <xsd:selector xpath="."/> <xsd:field xpath="ID"/> </xsd:key> <xsd:keyref name="SYS_C0032500_HEADER.ID_INCIDENT.HEADER_" refer="SYS_C0032500"> <xsd:selector xpath="INCIDENT"/> <xsd:field xpath="HEADER"/> </xsd:keyref></xsd:element><xsd:element name="INCIDENT"> <xsd:complexType> <xsd:all> <xsd:element minOccurs="1" name="HEADER" nillable="false" type="xsd:integer"/> </xsd:all> </xsd:complexType> <xsd:key name="IDK"> <xsd:selector xpath="."/> <xsd:field xpath="HEADER"/> </xsd:key></xsd:element></xsd:schema>\[/code\]The criteria of this task to use the and elements to simulate database constraints. Currently I get an error message that says: \[quote\] Engine name: Xerces Severity: error Description: cvc-complex-type.2.4.d: Invalid content was found starting with element 'INCIDENT'. No child element is expected at this point. Start location: 3:6 End location: 3:14 URL: http://www.w3.org/TR/xmlschema-1/#cvc-complex-type\[/quote\]My other problem comes with the more INCIDENT parts. How can I add more INCIDENT elements, when the has no maxOccurs attribute?Thanks for every help!Regards, Joe
 
Back
Top