Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

JAVA²Ù×÷XMLµÄÍêÕûÀý×Ó(²éѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý)

ÕâÊÇÒ»¸öÓÃJAVA W3C DOM ½øÐÐXML²Ù×÷µÄÀý×Ó£¬°üº¬Á˲éѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý¡¢±£´æµÄ»ù±¾²Ù×÷¡£½ÏÍêÕûµÄÃèÊöÁËÒ»¸öXMLµÄÕû¸ö²Ù×÷Á÷³Ì¡£ÊʺϸÕÈëÃÅJAVA XML²Ù×÷µÄÅóÓѲο¼ºÍѧϰ¡£
¼ÙÉèÓÐXMLÎļþ£ºtest1.xml
<?xml version="1.0" encoding="GBK"?>
<books>
<book>
<name>¹þÀï²¨ÌØ</name> ......

VC½âÎöXML ʹÓÃCMarkupÀà½âÎöXML

(Ò») ÏȽ²Ò»ÏÂXMLÖеÄÎïÊâ×Ö·û£¬ÊÖ¶¯ÌîдʱעÒâһϡ£
×Ö·û                   ×Ö·ûʵÌå
&                     ......

(4).¶ÁÈ¡XMLÎļþ

//¶ÁÈ¡XMLÎļþ
//1¡¢LoadfromFile×°ÈëXMLÎļþ
//2¡¢Ö¸¶¨Â·¾¶£¬¼¤»î¶ÁÈ¡
//3¡¢´ÓÄÚ´æÁ÷¶ÁÈ¡
//4¡¢´ÓÍøÂçÉÏÖ±½Ó»ñÈ¡
//1¡¢LoadfromFile×°ÈëXMLÎļþ
procedure TForm1.Button1Click(Sender: TObject);
begin
XMLDocument1.LoadfromFile('c:\temp\test.xml');
// XMLDocument1.Active := True;
Memo1.Lines := X ......

xml²Ù×÷

     protected void Button1_Click(object sender, EventArgs e)
        {
            //Ϊresponse(star)½Úµã ºÍ  Cabins(f) cabin½Úµã·Ö±ðÌí¼Ó¸ö
      &nbs ......

XML Schema ²Î¿¼ÊÖ²á1

XML Schema ²Î¿¼ÊÖ²á
XSD ÔªËØ
ÔªËØ
½âÊÍ
all
¹æ¶¨×ÓÔªËØÄܹ»ÒÔÈÎÒâ˳Ðò³öÏÖ£¬Ã¿¸ö×ÓÔªËØ¿É³öÏÖÁã´Î»òÒ»´Î¡£
annotation
annotation ÔªËØÊÇÒ»¸ö¶¥²ãÔªËØ£¬¹æ¶¨ schema µÄ×¢ÊÍ¡£
any
ʹ´´×÷Õß¿ÉÒÔͨ¹ýδ±» schema ¹æ¶¨µÄÔªËØÀ´À©Õ¹ XML Îĵµ¡£
anyAttribute
Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ