ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: Schema (XSD) :: XSD ¸´ºÏ´¿ÔªËØ

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

Schema (XSD)
Schema (XSD) ½éÉ..
ΪºÎʹÓà XML Sch..
ÈçºÎ¶¨ÖÆ XSD
XSD - <schema..
XSD ¼òµ¥ÔªËØ
XSD ÊôÐÔ
XSD Ô¼ÊøÃæ
XSD ¸´ºÏÔªËØ
XSD ¸´ºÏ¿ÕÔªËØ
XSD ¸´ºÏ´¿ÔªËØ
XSD ¸´ºÏ´¿Îı¾
XSD »ìºÏÄÚÈݵĸ´..
XSD ָʾÆ÷¸´ºÏÀà..
XSD <any> ..
XSD <anyAttri..
XSD ÔªËØÌæ´ú
XSD ʵÀý
XSD ×Ö·û´®Êý¾ÝÀà..
XSD ÈÕÆÚÊý¾ÝÀàÐÍ
XSD СÊýÊý¾ÝÀàÐÍ

XSD ¸´ºÏ´¿ÔªËØ


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-29 ÐÞ¸Ä:2007-08-28 ä¯ÀÀ:4580 :: ::

An "elements-only" complex type contains an element that contains only other elements.
“ ´¿ÔªËØ£¨Elements-only£©” µÄ¸´ºÏÀàÐͰüº¬ÁËÒ»¸öÖ»°üº¬ÆäËüÔªËØµÄÔªËØ¡£


Complex Types Containing Elements Only
¸´ºÏÀàÐÍÖ»°üº¬ÔªËØ

An XML element, "person", that contains only other elements:
Ò»¸öXMLÔªËØ"person"Ö»º¬ÓÐÆäËüÔªËØ£º

<person>
<firstname>John</firstname>
<lastname>Smith</lastname>
</person>

You can define the "person" element in a schema, like this:
Äã¿ÉÒÔÔÚһƪschemaÀﶨÒå"person"ÔªËØ£¬ÈçÏÂËùʾ£º

<xs:element name="person">
<xs:complexType>

<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>

</xs:sequence>
</xs:complexType>
</xs:element>

Notice the <xs:sequence> tag. It means that the elements defined ("firstname" and "lastname") must appear in that order inside a "person" element.
Çë×¢Òâ<xs:sequence>±êÇ©¡£Õâ±íʾËù¶¨ÒåµÄÔªËØ("firstname" ºÍ "lastname")±ØÐëÔÚ"person"ÔªËØÀïÒÔ<xs:sequence>±êÇ©¶¨ÒåµÄ´ÎÐò³öÏÖ¡£

Or you can give the complexType element a name, and let the "person" element have a type attribute that refers to the name of the complexType (if you use this method, several elements can refer to the same complex type):
»òÕߣ¬Äã¿ÉÒÔΪcomplexTypeÔªËØ¶¨ÒåÒ»¸öÃû³Æ£¬ÈÃ"person"ÔªËØ°üº¬Ò»¸öÀàÐÍÊôÐÔ£¬¸ÃÀàÐÍÊôÐÔµÄÃû³Æ¿ÉÒÔÒýÓÃcomplexTypeÔªËØµÄÃû³Æ£¨Èç¹ûÄãÓÃÉÏÊö·½·¨£¬¼¸¸öÔªËØ¿ÉÒÔͬʱÒýÓÃÏàͬµÄ¸´ºÏÀàÐÍ£©£º

<xs:element name="person" type="persontype"/>
<xs:complexType name="persontype">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>

<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>

ÆÀÂÛ (0) All