xml shema°ïÖúÎĵµ5
XML Schema union ÔªËØ
¶¨ÒåºÍÓ÷¨
union ÔªËض¨Òå¶à¸ö simpleType ¶¨ÒåµÄ¼¯ºÏ¡£
ÔªËØÐÅÏ¢
³öÏÖ´ÎÊý
Ò»´Î
¸¸ÔªËØ
simpleType
ÄÚÈÝ
annotation¡¢simpleType
Óï·¨
<union
id=ID
memberTypes="list of QNames"
any attributes
>
(annotation?,(simpleType*))
</union>
£¨? ·ûºÅÉùÃ÷ÔÚ union ÔªËØÖиÃÔªËؿɳöÏÖÁã´Î»òÒ»´Î¡££©
ÊôÐÔ
ÃèÊö
id
¿ÉÑ¡¡£¹æ¶¨¸ÃÔªËصÄΨһµÄ ID¡£
memberTypes
¿ÉÑ¡¡£¹æ¶¨ÔÚ schema Öж¨ÒåµÄÄÚÖÃÊý¾ÝÀàÐÍ»ò simpleType ÔªËصÄÃû³ÆÁÐ±í¡£
any attributes
¿ÉÑ¡¡£¹æ¶¨´øÓÐ non-schema ÃüÃû¿Õ¼äµÄÈκÎÆäËûÊôÐÔ¡£
ʵÀý
Àý×Ó 1
±¾ÀýÊÇÒ»¸öºÏ²¢ÁËÁ½¸ö¼òµ¥ÀàÐ͵ļòµ¥ÀàÐÍ£º
<xs:element name="jeans_size">
<xs:simpleType>
<xs:union memberTypes="sizebyno sizebystring" />
</xs:simpleType>
</xs:element>
<xs:simpleType name="sizebyno">
<xs:restriction base="xs:positiveInteger">
<xs:maxInclusive value="42"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="sizebystring">
<xs:restriction base="xs:string">
<xs:enumeration value="small"/>
<xs:enumeration value="medium"/>
<xs:enumeration value="large"/>
</xs:restriction>
</xs:simpleType>
XML Schema unique ÔªËØ
¶¨ÒåºÍÓ÷¨
unique ÔªËØÖ¸¶¨ÊôÐÔ»òÔªËØÖµ£¨»òÕßÊôÐÔ»òÔªËØÖµµÄ×éºÏ£©ÔÚÖ¸¶¨·¶Î§ÄÚ±ØÐëÊÇΨһµÄ¡£ ¸ÃÖµ±ØÐëΨһ»òΪÁã¡£
unique ÔªËرØÐ밴˳Ðò°üº¬ÏÂÁÐÔªËØ£º
selector ÔªËØ
selector ÔªËØ°üº¬ XPath ±í´ïʽ£¬Ö¸¶¨Ò»¸öÔªËؼ¯£¬ÔÚÆäÖÐÓÉ field ÔªËØÖ¸¶¨µÄÖµ±ØÐëΨһ¡£
±ØÐëÓÐÒ»¸öÇÒÖ»ÓÐÒ»¸ö selector ÔªËØ¡£
field ÔªËØ
ÿһ¸ö field ÔªËؾù°üº¬Ò»¸ö XPath ±í´ïʽ£¬Ö¸¶¨
Ïà¹ØÎĵµ£º
¿ÉÄÜÄúÒѾÌý˵ÁË£¬±¾ÖÜÊÇ Microsoft ÊÂÒµ²¿ºÜ¹Ø¼üµÄÒ»ÖÜ¡£ÔÚ±¾ÖÜÔçЩʱºò£¬ÎÒÃÇÐû²¼½«¹«¿ª·¢ÐÐ Microsoft Office 2010 Beta¡£ÄúÊÇ·ñÔøÏ£ÍûÓëÍŶÓÒ»ÆðÔÚ Word Öй²Í¬´´×÷Ò»·ÝÎĵµ£¿ÄúÊÇ·ñÔøÏ£ÍûÔÚ Excel ÖÐͬʱ·ÖÎö³É¶ÑµÄÊý¾Ý£¿»òÕßÔÚ PowerPoint ÑÝʾÎĸåÖÐÍ»ÆƶàýÌåµÄÏÞÖÆ£¿ÄÇô£¬¸Ï¿ìÊÔÊÔ Beta °æ±¾°É¡£
¶ÔÓÚ±ê×¼ÉçÇø£ ......
[ÕªÒª]¿ÉÀ©Õ¹±êÖ¾ÓïÑÔ£¨¼ò³ÆXML£©ÔÚʵÏÖÐÅÏ¢±ê×¼»¯¡¢ÐÅÏ¢µÄ½»Á÷Óë¹²ÏíÉÏÓÐÆä¶ÀÌصļ¼ÊõÓÅÊÆ£¬Òò´ËËüÊܵ½Á˹㷺µÄÖØÊÓ¡£È«ÎÄÊ×ÏÈÌá³öÁË»ùÓÚXMLµÄÈý²ãClient/ServerÄ£ÐÍ£»È»ºó¶ÔÆä´ÓÊý¾Ý»ñÈ¡¡¢´«ÊäÖÁÏÔʾÒÔ¼°Íⲿ´¦ÀíµÄÓ¦ÓýøÐзÖÎö£»½Ó×ÅÒÔͼÊé×ÊÁϹÜÀíϵͳΪÀý£¬ËµÃ÷ÁËÆä¾ßÌåµÄʵÏÖ£»×îºó¶Ô»ùÓÚXMLµÄÈý²ãC/SÄ£ÐÍÔÚÐÅÏ¢±ê×¼» ......
1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒÌض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤×÷¡£ÓÉÓÚËüÊÇ»ùÓÚÐÅÏ¢²ã´ÎµÄ£¬Òò¶ ......
ÓÐÈË»áÎÊ£¬DTDºÍSchema¶¼ÊǶÔXMLÎĵµµÄÒ»ÖÖÔ¼Êø£¬ÎªÊ²Ã´²»¾ÍÑ¡ÆäÖÐÖ®Ò»£¬¶øÓÖÓÐSchemaÄØ¡£ÒòΪDTD°²È«¶ÈÌ«µÍÁË£¬Ò²¾ÍÊÇ˵ËüµÄÔ¼Êø¶¨ÒåÄÜÁ¦²»×㣬ÎÞ·¨¶ÔXMLʵÀýÎĵµ×ö³ö¸üϸÖµÄÓïÒåÏÞÖÆ¡£ÆäʵϸÐĵÄÈ˻ᷢÏÖ£¬ÔÚDTDÖУ¬Ö»ÓÐÒ»¸öÊý¾ÝÀàÐÍ£¬¾ÍÊÇPCDATA£¨ÓÃÔÚÔªËØÖУ©ºÍCDATA£¨ÓÃÔÚÊôÐÔÖУ©£¬ÔÚÀïÃæдÈÕÆÚÒ²ÐУ¬Êý×Ö»¹ÐУ¬×Ö·û ......