How to write a schema document ①russian Doll (Russian set of dolls)
②salami Slice (sausage slices)
③venetian Blind (blinds) Recommended
Second, Russian doll Russia set Eva As the name suggests, the way to write is a layer, only a root element, through and set the way to write complete.
Advantages: Clear Structure
Disadvantage: elements cannot be reused
<element name= "Books" >
<complexType>
<!--maxoccurs represents the maximum number of occurrences, unbounded the number of times unlimited. The default number is 1 times-->
<sequence maxoccurs= "unbounded" >
<element name= "book" >
<complexType>
<sequence minoccurs= "1" maxoccurs= "unbounded" >
<element name= "title" Type= "string"/>
<element name= "Content" type= "string"/>
<!--choice label attributes optional-->
<choice>
<element name= "Author" type= "string"/>
<element name= "Authors" >
<complexType>
<!--the elements in the All tab can appear sequentially, but the number is 1 times-->
<all>
<!--only one--> per element appears
<element name= "Author" type= "string"/>
</all>
</complexType>
</element>
</choice>
</sequence>
<!--the properties of the book, which must be--> after sequence in the schema
<attribute name= "id" type= "int" use= "required"/>
</complexType>
</element>
</sequence>
</complexType>
</element>
</schema>
second, salami slice sausage slices Benefits: can be maximized for reuse
Disadvantage: The root element is not clear. Book, ID, title, content all of the element can be the root element
Salamislice.xsd
<?xml version= "1.0" encoding= "UTF-8"?>
<schema xmlns= "Http://www.w3.org/2001/XMLSchema"
Targetnamespace= "Http://www.xy,com"
Xmlns:tns= "Http://www.xy.com"
elementformdefault= "qualified" >
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.