易截截图软件、单文件、免安装、纯绿色、仅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',


相关文档:

XML与CSS类选择符的使用

Class.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="class.css"?>
<bookdetail>
<book class="A">
<author>曹雪芹</author>
<title>红楼梦</title>
<price>60.00</price>
</book>
<book class="A"& ......

xml post(C#)

xmlpost by HttpWebRequest:
protected string PostXmlToURL(string url,string data)
{
    HttpWebRequest hwr = (HttpWebRequest)HttpWebRequest.Create(url);
    hwr.Method = "POST";
    Stream stream = hwr.GetRequestStream();
    StreamWri ......

xsd与xml和类(class)对象之间的互相转换

xsd与xml和类(class)对象之间的互相转换
.
第一:通过现有的已经写好的xsd来生成class(.cs)文件。
在您Visual Studio的安装目录下的SDKv2.0Bin中有个应用程序xsd.exe(通过这个应用程序可以使用xsd来创建类文件)。
具体操作:通过打开Visual Studio 命令提示,可以输入xsd指令来查看一些具体的操作指令的用处,然后 ......

Xml文件操作和文件操作(FileInfo类)

Xml文件操作和文件操作(FileInfo类)
  1. 上传文件
 2. 写Xml文件
   3.  文件拷贝
 
 1. //上传
        protected void picUp_Click(object sender, EventArgs e)
        {
     ......

XML创建新结点

private void CreateNewXmlNode()
{
String strFileName = string.Empty;
strFileName = this.strCurrentPath + "System.xml";
XmlDocument xmlDoc = new XmlDocument();
try
{
xmlDoc.Load(strFileName);
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号