Given:
<?xml version="1.0" encoding="utf-8"?> <Clients xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <FileDate>2016-10-12</FileDate> <Client> <Record_ID> <ClientCode>400057</ClientCode> </Record_ID> <Address> <AddressLine1>Dynamic Funds Tower</AddressLine1> </Address> <Notes> <Note> <Add_Date>10/5/2016 3:13:22 PM</Add_Date> <Add_User>rthomas</Add_User> <Change_Date>10/6/2016 12:19:02 PM</Change_Date> <Change_User>Daniel</Change_User> <Text>This is a note</Text> </Note> </Notes> </Client> <Client> <Record_ID> <ClientCode>101134</ClientCode> </Record_ID> <Address> <AddressLine1>100 North Michigan</AddressLine1> </Address> <Notes> <Note> <Add_Date /> <Add_User /> <Change_Date /> <Change_User /> <Text /> </Note> </Notes> </Client> <Client> <Record_ID> <ClientCode>101628</ClientCode> </Record_ID> <Address> <AddressLine1>900 Third Avenue, 30th Floor</AddressLine1> </Address> <Notes> <Note> <Add_Date>10/5/2016 3:13:22 PM</Add_Date> <Add_User>rthomas</Add_User> <Change_Date>10/6/2016 12:19:02 PM</Change_Date> <Change_User>Daniel</Change_User> <Text>This is a note</Text> </Note> </Notes> </Client> </Clients> as the XML source AND: <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0"> <xsd:element name="Clients" /> <xsd:element name="FileDate" type="xsd:date" /> <xsd:element name="Client"> <xsd:complexType> <xsd:sequence> <xsd:element name="Record_ID"> <xsd:complexType> <xsd:sequence> <xsd:element name="ClientCode" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="Address"> <xsd:complexType> <xsd:sequence> <xsd:element name="AddressLine1" nillable="true" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="Notes"> <xsd:complexType> <xsd:sequence> <xsd:element name="Note" nillable="true" > <xsd:complexType> <xsd:sequence> <xsd:element name="Add_Date" nillable="true" type="xsd:string" /> <xsd:element name="Add_User" nillable="true" type="xsd:string" /> <xsd:element name="Change_Date" nillable="true" type="xsd:string" /> <xsd:element name="Change_User" nillable="true" type="xsd:string" /> <xsd:element name="Text" nillable="true" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>
Does Client require a maxoccurs value to allow more than one client in the XML file. Every validator I can find validates an XML with multiple clients, yet maxoccurs is not used. Further, Note does not appear to require maxoccurs either. Is this because it is a complex type?
No comments:
Post a Comment