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

xml procedure

DECLARE @XMLdoc XML
SET @XMLdoc =
'<Book name="SQL Server 2000 Fast Answers">
<Chapters>
<Chapter id="1" name="Installation, Upgrades">
 <CreateDate>2009-12-30</CreateDate>
</Chapter>
<Chapter id="2" name="Configuring SQL Server"/>
<Chapter id="3" name="Creating and Configuring Databases">
 <CreateDate>2009-12-30</CreateDate>
</Chapter>
<Chapter id="4" name="SQL Server Agent and SQL Logs"/>
</Chapters>
</Book>'
DECLARE @docpointer int
EXEC sp_XML_preparedocument @docpointer OUTPUT, @XMLdoc
SELECT *
from OPENXML (@docpointer, '/Book/Chapters/Chapter',1)
WITH (Chapter int '@id',
ChapterNM varchar(50) '@name',
CreateDate VARCHAR(50) './CreateDate/text()')
GO
½á¹ûÈçÏ£º
Chapter    ChapterNM                                              CreateDate
1               Installation, Upgrades                            2009-12-30
2               Configuring SQL Server                           NULL
3               Creating and Configuring Databases      2009-12-30
4               SQL Server Agent and SQL Logs        


Ïà¹ØÎĵµ£º

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 ......

XML Schema ²Î¿¼ÊÖ²á1

XML Schema ²Î¿¼ÊÖ²á
XSD ÔªËØ
ÔªËØ
½âÊÍ
all
¹æ¶¨×ÓÔªËØÄܹ»ÒÔÈÎÒâ˳Ðò³öÏÖ£¬Ã¿¸ö×ÓÔªËؿɳöÏÖÁã´Î»òÒ»´Î¡£
annotation
annotation ÔªËØÊÇÒ»¸ö¶¥²ãÔªËØ£¬¹æ¶¨ schema µÄ×¢ÊÍ¡£
any
ʹ´´×÷Õß¿ÉÒÔͨ¹ýδ±» schema ¹æ¶¨µÄÔªËØÀ´À©Õ¹ XML Îĵµ¡£
anyAttribute
Ê ......

XML Schema°ïÖúÎĵµ3

XML Schema attributeGroup ÔªËØ
¶¨ÒåºÍÓ÷¨
attributeGroup ÔªËØÓÃÓÚ¶ÔÊôÐÔÉùÃ÷½øÐÐ×éºÏ£¬ÕâÑùÕâЩÉùÃ÷¾ÍÄܹ»ÒÔ×éºÏµÄÐÎʽºÏ²¢µ½¸´ÔÓÀàÐÍÖС£
ÔªËØÐÅÏ¢
³öÏÖ´ÎÊý
ÎÞÏÞÖÆ
¸¸ÔªËØ
attributeGroup¡¢complexType¡¢schema¡¢restriction (simpleContent)¡¢extension (simpleContent)¡¢rest ......

XML Schema °ïÖúÎĵµ4

XML Schema import ÔªËØ
¶¨ÒåºÍÓ÷¨
import ÔªËØÓÃÓÚÏòÒ»¸öÎĵµÌí¼Ó´øÓв»Í¬Ä¿±êÃüÃû¿Õ¼äµÄ¶à¸ö schema¡£
ÔªËØÐÅÏ¢
³öÏÖ´ÎÊý
ÎÞÏÞÖÆ
¸¸ÔªËØ
schema
ÄÚÈÝ
annotation
Óï·¨
<import
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>
(annotation?)
< ......

c# Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary

/// <summary>
/// Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
[XmlRoot("SerializableDictionary")]
public class SerializableDictionary<TKey, TValue& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ