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',
Ïà¹ØÎĵµ£º
ID.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="ID.css"?>
<bookdetail>
<book class="A" id="B1">
<author>²ÜÑ©ÇÛ</author>
<title>ºìÂ¥ÃÎ</title>
<price>60.00</price>
</book>
<book class="A ......
×î½üÏîÄ¿ÖÐÒªÓõ½Ò»Ð©web xmlÊý¾ÝµÄ·ÃÎÊ·ÖÎö£¬²ÉÓÃmsxml
1.msxmlÊÇ΢ÈíÌṩµÄ£¬ÔÚ·Ç¿ª·¢»·¾³ÖУ¬ÐèҪע²á
2.xmlÎļþ£¬Ò»°ãÔÚµÚÒ»¾äÓбàÂ뷽ʽ£¬Ò»°ãĬÈÏÊÇutf-8£¬ÊôÓÚÒ»ÖÖunicode
3.´ÓÍøÂç²É¼¯µÄxmlÊý¾Ý£¬ÐèҪʹÓÃwinnetº¯Êý¿â
4.winnet²É¼¯×ÔÍøÂçµÄÊý¾Ý£¬Ä¬ÈϵͼÊÇCP_ACP¸ñʽµÄ£¬¼òµ¥Ëµ¾ÍÊÇANSI»òUNICODE£¬UTF8µÄ±àÂë ......
xmlpost by HttpWebRequest:
protected string PostXmlToURL(string url,string data)
{
HttpWebRequest hwr = (HttpWebRequest)HttpWebRequest.Create(url);
hwr.Method = "POST";
Stream stream = hwr.GetRequestStream();
StreamWri ......
MSDNÉϵ͍Ò壺
XML ÐòÁл¯½«¶ÔÏóµÄ¹«¹²×ֶκÍÊôÐÔ»òÕß·½·¨µÄ²ÎÊýºÍ·µ»ØÖµ×ª»»£¨ÐòÁл¯£©Îª·ûºÏÌØ¶¨ XML ¼Ü¹¹¶¨ÒåÓïÑÔ (XSD) ÎĵµµÄ XML Á÷¡£XML ÐòÁл¯Éú³ÉÇ¿ÀàÐ͵ÄÀ࣬²¢Îª´æ´¢»ò´«ÊäÄ¿µÄ½«Æä¹«¹²ÊôÐÔºÍ×Ö¶Îת»»ÎªÐòÁиñʽ£¨ÔÚ´ËÇé¿öÏÂΪ XML)¼òµ¥µÄ˵¾ÍÊǽ«Ò»¸ö¶ÔÏóת»»³ÉXMLÁ÷»òÊÇÎļþµÄ¹ý³Ì¡£
×¢ÒâÊÂÏҪÐòÁл¯µÄÀ ......