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

Xml Schema

Standards
"DTD" was the first formalized standard, but is rarely used anymore.
"XDR" was an early attempt by Microsoft to provide a more comprehensive standard than DTD. This standard has pretty much been abandoned now in favor of XSD.
"XSD" is currently the de facto standard for describing XML documents. There are 2 versions in use 1.0 and 1.1, which are on the whole the same (you have to dig quite deep before you notice the difference). An XSD schema is itself an XML document, there is even an a XSD schema to describe the XSD standard.
There are also a number of other standards but their take up has been patchy at best.
<xs:element/>
Sample:
<xs:element name="Customer_order" type="xs:integer" minOccurs ="0" maxOccurs="unbounded" default="unknown"|fixed=" UK"/>
Complex type
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element name="Dob" type="xs:date" />
<xs:element name="Address" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
XML sample
<Customer>
<Dob> 2000-01-12T12:13:14Z </Dob>
<Address> 34 thingy street, someplace, sometown, w1w8uu </Address>
</Customer>
There are 3 types of compositors <xs:sequence>, <xs:choice> and <xs:all>. These compositors allow us to determine how the child elements within them appear within the XML document.
Compositor
Description
Sequence
The child elements in the XML document MUST appear in the order they are declared in the XSD schema.
Choice
Only one of the child elements described in the XSD schema can appear in the XML document.
All
The child elements described in the XSD schema can appear in the XML document in any order.
Notes
The compositors <xs:sequence> and <xs:choice> can be nested inside other


Ïà¹ØÎĵµ£º

DataSet(DataTable)ÓëXML»¥×ª

using System;
using System.Data;
using System.IO;
using System.Xml;
using System.Text;
// ÏàÓ¦C#´úÂ룺
private string ConvertDataTableToXML(DataTable xmlDS)
{
MemoryStream stream = null;
XmlTextWriter writer = null;
try
{
stream = new MemoryStream();
writer = new XmlTextWriter(stream, E ......

¹ØÓÚSQLServer2005µÄѧϰ±Ê¼Ç——XMLµÄ´¦Àí

ÔÚ
SQLServer2005
ÖжÔ
XML
µÄ´¦Àí¹¦ÄÜÏÔÈ»ÔöÇ¿Á˺ܶ࣬ÌṩÁË
query(),value(),exist(),modify(),nodes()
µÈº¯Êý¡£
¹ØÓÚ
xml
£¬ÄÑÒÔÀí½âµÄ²»ÊÇ
SQLServer
ÌṩµÄº¯Êý£¬¶øÊǶÔ
xml
±¾ÉíµÄÀí½â£¬¿´Ëƺܼòµ¥µÄÎļþ¸ñʽ£¬´¦ÀíÆðÀ´È´ÊǷdz£À§Äѵġ£±¾ÎÄÖ»Êdzõ̽һ϶øÒÑ¡£
Ïê¼û
SQLServer
Áª»ú°ïÖú£º
Ö÷Ìâ
˵ ......

XMLµÄËÄÖÖ½âÎöÆ÷Ô­Àí¼°ÐÔÄܱȽÏ

          XMLµÄËÄÖÖ½âÎöÆ÷Ô­Àí¼°ÐÔÄܱȽϠ                                    ......

XmlÖÐSelectSingleNode·½·¨ÖеÄxpathÓ÷¨

×î³£¼ûµÄXMLÊý¾ÝÀàÐÍÓУºElement, Attribute£¬Comment, Text.  
 
   Element, Ö¸ÐÎÈç<Name>Tom<Name>µÄ½Úµã¡£Ëü¿ÉÒÔ°üÀ¨£ºElement, Text, Comment, ProcessingInstruction, CDATA, and EntityReference.  
 
   Attribute, Ö¸ÔÚ<Employee >Ö ......

jaxpÏÂÓÃDOM½øÐÐxmlÎĵµ½âÎö

jaxpÊÇsun¹«Ë¾µÄ½âÎöxmlÎĵµµÄapi,ËûÖ§³ÖÓÃdomºÍsaxÁ½ÖÖ·½·¨½âÎöÒ»¸öxmlÎĵµ.
dom·½·¨ÊǽâÎöÒýÇ潫Õû¸öxmlÎĵµ×°Ôص½ÄÚ´æÖÐ×÷Ϊһ¸ödocument¶ÔÏó,dom·½·¨µÃµ½Ò»¸ö¶ÔÏó¾ÍÖªµÀËùÓеĽڵã
Ôöɾ¸Ä²éºÜ·½±ã,ȱµãÊÇҪװÔØÕû¸öxmlÎĵµ,Èç¹ûxmlÎĵµºÜ´ó,ЧÂʾͱȽϵÍ
sax·½·¨ÊDzÉÓÃʼþ×÷ΪÇý¶¯µÄ,Óöµ½Ò»¸ö±êÇ©ÊÇÒ»¸öʼþ,¶Áµ½±ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ