Mega Code Archive

 
Categories / XML Tutorial / XML Schema
 

Fixed Order Optional Elements

<?xml version="1.0" ?> <schema xmlns="http://www.w3.org/2001/10/XMLSchema" targetNamespace="http://www.rntsoft.comns/" xmlns:end="http://www.rntsoft.com/">     <element name = "Add">        <complexType>            <sequence>              <element name = "Namespace" minOccurs = "0" maxOccurs = "1" />              <element name = "FilePath" />           </sequence>        </complexType>     </element> </schema> So, both of the following would be valid instances: <Add>    <Namespace>http://www.rntsoft.com/books</Namespace>    <FilePath>http://www.rntsoft.com/books/books.xsd</FilePath> </Add> <Add>    <FilePath>http://www.rntsoft.com/books/books.xsd</FilePath> </Add>