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

Ext.data.Store ¶ÁÈ¡XMLÊôÐÔÖµ


data.xml
<?xml version="1.0" encoding="UTF-8"?>
<Items>
<Item ASIN="0446355453"
Author="Sidney Sheldon"
Manufacturer="Warner Books"
ProductGroup="Book"
Title="Master of the Game"/>

<Item ASIN="0446613657"
Author="Sidney Sheldon"
Manufacturer="Warner Books"
ProductGroup="Book"
Title="Are You Afraid of the Dark?"/>

<Item ASIN="0446357421"
Author="Sidney Sheldon"
Manufacturer="Warner Books"
ProductGroup="Book"
Title="If Tomorrow Comes"/>

<Item ASIN="0446607207"
Author="Sidney Sheldon"
Manufacturer="Warner Books"
ProductGroup="Book"
Title="Tell Me Your Dreams"/>

<Item ASIN="0446357448"
Author="Sidney Sheldon"
Manufacturer="Warner Books"
ProductGroup="Book"
Title="Bloodline"/>
</Items>

/**
* Ext.data.Store ¶ÁÈ¡XMLÊôÐÔÖµ
* @author KJW
* @param {} config
*/
TestGrid = function(config) {
config = config || {};

this.cm = new Ext.grid.ColumnModel([
{header : 'Author', dataIndex: 'Author'},
{header : 'Manufacturer', dataIndex: 'Manufacturer'},
{header : 'ProductGroup', dataIndex: 'ProductGroup'},
{header : 'Title', dataIndex: 'Title'}
]);

this.store = new Ext.data.Store({
url : 'data.xml',
reader : new Ext.data.XmlReader({
record : 'Item',
id : '@ASIN',
totalRecords: '@total'
}, [
{name: 'Author', mapping: '@Author'},
{name: 'Manufacturer', mapping: '@Manufacturer'},
{name: 'ProductGroup',


Ïà¹ØÎĵµ£º

ÔÚasp.netÖжÔXMLÎĵµ½øÐеIJÙ×÷£¨²»È«£¬´ýÐø£©

¶ÁXMLÎļþ
DataSet books = new DataSet();
books.ReadXml(MapPath("booklist.xml"));
booklist.DataSource = books;
booklist.DataBind(); ......

xsdÓëxmlºÍÀà(class)¶ÔÏóÖ®¼äµÄ»¥Ïàת»»

xsdÓëxmlºÍÀà(class)¶ÔÏóÖ®¼äµÄ»¥Ïàת»»
.
µÚÒ»£ºÍ¨¹ýÏÖÓеÄÒѾ­Ð´ºÃµÄxsdÀ´Éú³Éclass£¨.cs£©Îļþ¡£
ÔÚÄúVisual StudioµÄ°²×°Ä¿Â¼ÏµÄSDKv2.0BinÖÐÓиöÓ¦ÓóÌÐòxsd.exe£¨Í¨¹ýÕâ¸öÓ¦ÓóÌÐò¿ÉÒÔʹÓÃxsdÀ´´´½¨ÀàÎļþ£©¡£
¾ßÌå²Ù×÷£ºÍ¨¹ý´ò¿ªVisual Studio ÃüÁîÌáʾ£¬¿ÉÒÔÊäÈëxsdÖ¸ÁîÀ´²é¿´Ò»Ð©¾ßÌåµÄ²Ù×÷Ö¸ÁîµÄÓô¦£¬È»ºó ......

XML¼¼Êõ½²½â


 
 Ê²Ã´ÊÇXML£¿
XML ´ú±íExtensible Markup Language£¨eXtensible Markup LanguageµÄËõд£¬ÒâΪ¿ÉÀ©Õ¹µÄ±ê
¼ÇÓïÑÔ£©¡£XMLÊÇÒ»Ì×¶¨ÒåÓïÒå±ê¼ÇµÄ¹æÔò£¬ÕâЩ±ê¼Ç½«Îĵµ·Ö³ÉÐí¶à²¿¼þ²¢¶ÔÕâЩ²¿¼þ¼ÓÒÔ±êʶ¡£
ËüÒ²ÊÇÔª±ê¼ÇÓïÑÔ£¬¼´¶¨ÒåÁËÓÃÓÚ¶¨ÒåÆäËûÓëÌØ¶¨ÁìÓòÓйصġ¢ÓïÒåµÄ¡¢½á¹¹»¯µÄ±ê¼ÇÓïÑԵľ䷨ÓïÑÔ¡£
&n ......

XmlÎļþ²Ù×÷ºÍÎļþ²Ù×÷(FileInfoÀà)

XmlÎļþ²Ù×÷ºÍÎļþ²Ù×÷(FileInfoÀà)
  1. ÉÏ´«Îļþ
¡¡2. дXmlÎļþ
   3.  Îļþ¿½±´
 
¡¡1.¡¡//ÉÏ´«
        protected void picUp_Click(object sender, EventArgs e)
        {
     ......

XMLÐòÁл¯(Ò»)

MSDNÉϵ͍Ò壺
XML ÐòÁл¯½«¶ÔÏóµÄ¹«¹²×ֶκÍÊôÐÔ»òÕß·½·¨µÄ²ÎÊýºÍ·µ»ØÖµ×ª»»£¨ÐòÁл¯£©Îª·ûºÏÌØ¶¨ XML ¼Ü¹¹¶¨ÒåÓïÑÔ (XSD) ÎĵµµÄ XML Á÷¡£XML ÐòÁл¯Éú³ÉÇ¿ÀàÐ͵ÄÀ࣬²¢Îª´æ´¢»ò´«ÊäÄ¿µÄ½«Æä¹«¹²ÊôÐÔºÍ×Ö¶Îת»»ÎªÐòÁиñʽ£¨ÔÚ´ËÇé¿öÏÂΪ XML)¼òµ¥µÄ˵¾ÍÊǽ«Ò»¸ö¶ÔÏóת»»³ÉXMLÁ÷»òÊÇÎļþµÄ¹ý³Ì¡£
×¢ÒâÊÂÏҪÐòÁл¯µÄÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ