I have an XML file that looks like this:
<custom_fields type="array">
<custom_field>
<name>Format</name>
<value>Goodun</value>
<type>text</type>
<permission>read_only</permission>
</custom_field>
<custom_field>
<name>Remark</name>
<value />
<type>text</type>
<permission>read_only</permission>
</custom_field>
<custom_field>
<name>Sequence Number</name>
<value>244</value>
<type>text</type>
<permission>read_only</permission>
</custom_field>
</custom_fields>
When I create an XSD, I get
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="address here">
<xs:element name="custom_fields">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="custom_field">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="name" type="xs:string" />
<xs:element minOccurs="0" name="value" type="xs:string" />
<xs:element minOccurs="0" name="type" type="xs:string" />
<xs:element minOccurs="0" name="permission" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="type" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
</xs:schema>
The problem is the schema needs to be explicit for each child node. For example, It's OK if the "remark" custom_field has no value, but not ok for the other two nodes Format and Sequence Number.
Can anyone advise how to have a schema be specific down to rach element name in a sequence?