I'm currently busy writing an xsd at one point in time i whish that my xml must look like:
Expand|Select|Wrap|Line Numbers
- <object>
- <loc>
- <disk>
- <drive>c</drive>
- <path>temp\path</path>
- <files>*.*</files>
- </disk>
- </loc>
- <interval>
- ...
- </interval>
- </object>
Expand|Select|Wrap|Line Numbers
- <object>
- <loc>
- <network>
- <server>localhost</server>
- <path>temp\path</path>
- <files>*.*</files>
- </network>
- </loc>
- <interval>
- ...
- </interval>
- </object>
Expand|Select|Wrap|Line Numbers
- <object>
- <loc>
- <internet>
- <uri>123.456.789.123</uri>
- <path>temp\path</path>
- <files>*.*</files>(optional (if webservice))
- <port>8888</port>(optional)
- ....
- </internet>
- </loc>
- <interval>
- ...
- </interval>
- </object>
How to get to my question: How do I pull this off in my XSD?
This is what I tried:
Expand|Select|Wrap|Line Numbers
- <xs:complexType name="Location">
- <xs:sequence maxOccurs="1" minOccurs="1">
- <xs:choice maxOccurs="1" minOccurs="1">
- <xs:element name="localDisk" type="LocalDisk" maxOccurs="1" minOccurs="0" />
- <xs:element name="networkLocation" type="NetworkLocation" maxOccurs="1" minOccurs="0" />
- <xs:element name="internetSite" type="InternetSite" maxOccurs="1" minOccurs="0" />
- <xs:element name="secureInternetSite" type="SecureInternetSite" maxOccurs="1" minOccurs="0" />
- <xs:element name="ftpSite" type="FtpSite" maxOccurs="1" minOccurs="0" />
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="TextDataProvider">
- <xs:sequence>
- <xs:element name="location" type="Location" maxOccurs="1" minOccurs="1" />
- <xs:element name="interval" type="Interval" maxOccurs="1" minOccurs="1" />
- <xs:group ref="textSchema" maxOccurs="1" minOccurs="1" />
- </xs:sequence>
- <xs:attributeGroup ref="Identification" />
- </xs:complexType>
- <xs:complexType name="Configuration">
- <xs:sequence>
- <xs:choice maxOccurs="3" minOccurs="1">
- <xs:element name="textProviders" maxOccurs="unbounded" minOccurs="1" type="TextDataProviders" />
- <xs:element name="csvProviders" maxOccurs="unbounded" minOccurs="0" type="CsvDataProviders" />
- <xs:element name="xmlProviders" maxOccurs="unbounded" minOccurs="0" type="XmlDataProviders" />
- </xs:choice>
- </xs:sequence>
- </xs:complexType>
- <xs:element name="configuration" type="Configuration"></xs:element>
- <xs:complexType name="TextDataProviders">
- <xs:sequence>
- <xs:element name="dataprovider" type="TextDataProvider" minOccurs="0" maxOccurs="unbounded" />
- </xs:sequence>
- </xs:complexType>
I must be doing something wrong, I just can't see it at this time.
With kind regards,
- SL33PY