Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

XML Schema°ïÖúÎĵµ3

XML Schema attributeGroup ÔªËØ
¶¨ÒåºÍÓ÷¨
attributeGroup ÔªËØÓÃÓÚ¶ÔÊôÐÔÉùÃ÷½øÐÐ×éºÏ£¬ÕâÑùÕâЩÉùÃ÷¾ÍÄܹ»ÒÔ×éºÏµÄÐÎʽºÏ²¢µ½¸´ÔÓÀàÐÍÖС£
ÔªËØÐÅÏ¢
³öÏÖ´ÎÊý
ÎÞÏÞÖÆ
¸¸ÔªËØ
attributeGroup¡¢complexType¡¢schema¡¢restriction (simpleContent)¡¢extension (simpleContent)¡¢restriction (complexContent)¡¢extension (complexContent)
ÄÚÈÝ
annotation¡¢attribute¡¢attributeGroup¡¢anyAttribute
Óï·¨
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
£¨? ·ûºÅÉùÃ÷ÔÚ attributeGroup ÔªËØÖУ¬ÔªËؿɳöÏÖÁã´Î»òÒ»´Î£¬* ·ûºÅÉùÃ÷ÔªËؿɳöÏÖÁã´Î»ò¶à´Î¡££©
ÊôÐÔ
ÃèÊö
id
¿ÉÑ¡¡£¹æ¶¨¸ÃÔªËصÄΨһµÄ ID¡£
name
¿ÉÑ¡¡£¹æ¶¨ÊôÐÔ×éµÄÃû³Æ¡£name ºÍ ref ÊôÐÔ²»ÄÜͬʱ³öÏÖ¡£
ref
¿ÉÑ¡¡£¹æ¶¨¶ÔÖ¸¶¨µÄÊôÐÔ×éµÄÒýÓá£name ºÍ ref ÊôÐÔ²»ÄÜͬʱ³öÏÖ¡£
any attributes
¿ÉÑ¡¡£¹æ¶¨´øÓРnon-schema ÃüÃû¿Õ¼äµÄÈκÎÆäËûÊôÐÔ¡£
ʵÀý
<xs:attributeGroup name="personattr">
  <xs:attribute name="attr1" type="string"/>
  <xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>
<xs:complexType name="person">
  <xs:attributeGroup ref="personattr"/>
</xs:complexType>
ÉÏÃæµÄÀý×Ó¶¨ÒåÁËÒ»¸öÃûΪ "personattr" µÄÊôÐÔ×飬ÔÚÃûΪ "person" µÄ¸´ÔÓÀàÐÍÖÐʹÓá£
XML Schema choice ÔªËØ
¶¨ÒåºÍÓ÷¨
XML Schema µÄ choice ÔªËؽöÔÊÐí°üº¬ÔÚ <choice> ÉùÃ÷ÖеÄÔªËØÖ®Ò»³öÏÖÔÚ°üº¬ÔªËØÖС£
ÔªËØÐÅÏ¢
³öÏÖ´ÎÊý
ÔÚ group ºÍ complexType ÔªËØÖÐΪһ´Î£»ÆäËûΪÎÞÏÞÖÆ¡£
¸¸ÔªËØ
group¡¢choice¡¢sequence¡¢complexType¡¢restriction (simpleContent)¡¢extension (simpleContent)¡¢restriction (complexContent)¡¢extension (complexContent)
ÄÚÈÝ
annotation¡¢any¡¢choice¡¢element¡¢group¡¢sequence
Óï·¨
<choice
id=ID
maxOccu


Ïà¹ØÎĵµ£º

ÊÖ°ÑÊÖ½ÌÄãC#¶ÁÈ¡XMLÎļþ

C#¶ÁÈ¡XML×ÊÁÏ
Ò» C#¶ÁÈ¡XML×ÊÁÏ
À©³ä±ê¼ÇÓïÑÔXML£¨eXtensible Markup Language£©£¬ÊÇÓÉWÈýC»ú¹ØÖƶ©µÄ¡£×öΪÓÃÒÔ´úÌæHTMLÓïÑÔµÄÒ»ÖÖÐÂʽµÄ±ê¼ÇÓïÑÔ£¬XMLÄÚ²¿ÓÐןܶà¸ù±¾»ù×¼£¬XMLÄËÊǾ­¹ýÓëÕâЩÏà¸É»ù×¼µØ×éºÏ£¬Ó¦ÓÃÓÚ¿Æѧ¼ÆËã¡¢µç×Ó³ö°æ¡¢¶àýÌåϵÌåÀý×÷ºÍµç×ÓÉÌÎñµÄ¡£C££×÷ΪһÖÖÐÂʽµÄ³ÌÐòÓïÑÔ£¬ÊÇ.Net¹¹¼ÜµÄÒ»¸öÖ ......

³õѧXML£¨Ò»£©

XML¶¨Ò壺Óɱê¼Ç¼°ÆäËù±ê¼ÇµÄÄÚÈݹ¹³ÉµÄÎı¾Îļþ¡£
XML×÷ÓãºÓÃÀ´ÃèÊöÊý¾ÝµÄ½á¹¹£¬ÓÐЧ·ÖÀëÊý¾ÝµÄ½á¹¹ºÍ±íʾ£¬¿ÉÒÔ×÷ΪÊý¾Ý½»»»µÄ±ê×¼¸ñʽ¡£
XMLÌص㣺1¡¢¿ÉÒÔ×Ô¶¨Òå±ê¼Ç£¬±ê¼ÇÃû³ÆÊǶÔËù±ê¼ÇµÄÊý¾ÝÄÚÈݺ¬ÒåµÄ³éÏ󣬶ø²»ÊÇÊý¾ÝµÄÏÔʾ¸ñʽ¡£
            &n ......

»ùÓÚXMLµÄÈý²ãC/SÄ£ÐÍ

[ÕªÒª]¿ÉÀ©Õ¹±êÖ¾ÓïÑÔ£¨¼ò³ÆXML£©ÔÚʵÏÖÐÅÏ¢±ê×¼»¯¡¢ÐÅÏ¢µÄ½»Á÷Óë¹²ÏíÉÏÓÐÆä¶ÀÌصļ¼ÊõÓÅÊÆ£¬Òò´ËËüÊܵ½Á˹㷺µÄÖØÊÓ¡£È«ÎÄÊ×ÏÈÌá³öÁË»ùÓÚXMLµÄÈý²ãClient/ServerÄ£ÐÍ£»È»ºó¶ÔÆä´ÓÊý¾Ý»ñÈ¡¡¢´«ÊäÖÁÏÔʾÒÔ¼°Íⲿ´¦ÀíµÄÓ¦ÓýøÐзÖÎö£»½Ó×ÅÒÔͼÊé×ÊÁϹÜÀíϵͳΪÀý£¬ËµÃ÷ÁËÆä¾ßÌåµÄʵÏÖ£»×îºó¶Ô»ùÓÚXMLµÄÈý²ãC/SÄ£ÐÍÔÚÐÅÏ¢±ê×¼» ......

[ת]XMLÏê½â Schema

ÓÐÈË»áÎÊ£¬DTDºÍSchema¶¼ÊǶÔXMLÎĵµµÄÒ»ÖÖÔ¼Êø£¬ÎªÊ²Ã´²»¾ÍÑ¡ÆäÖÐÖ®Ò»£¬¶øÓÖÓÐSchemaÄØ¡£ÒòΪDTD°²È«¶ÈÌ«µÍÁË£¬Ò²¾ÍÊÇ˵ËüµÄÔ¼Êø¶¨ÒåÄÜÁ¦²»×㣬ÎÞ·¨¶ÔXMLʵÀýÎĵµ×ö³ö¸üϸÖµÄÓïÒåÏÞÖÆ¡£ÆäʵϸÐĵÄÈ˻ᷢÏÖ£¬ÔÚDTDÖУ¬Ö»ÓÐÒ»¸öÊý¾ÝÀàÐÍ£¬¾ÍÊÇPCDATA£¨ÓÃÔÚÔªËØÖУ©ºÍCDATA£¨ÓÃÔÚÊôÐÔÖУ©£¬ÔÚÀïÃæдÈÕÆÚÒ²ÐУ¬Êý×Ö»¹ÐУ¬×Ö·û ......

c# ´ÓXML¶ÁÊý¾Ý

C#
 DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("~/Config/User_yhlx_Jb.xml"));
DataView dv = ds.Tables[0].DefaultView;
//dv.RowFilter = "State=0";
this.DropDownList1.DataSource = dv;
this.DropDownList1.DataTextField = "text";
this ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ