XML的使用
写XML:
protected void btnSave_Click(object sender, EventArgs e)
{
//权限判断
XmlTextWriter xmlw = new XmlTextWriter(Server.MapPath("~\\") + "FriendLink.xml", Encoding.GetEncoding("gb2312"));
xmlw.Formatting = Formatting.Indented;
xmlw.WriteStartDocument();
xmlw.WriteStartElement("Pictures");
string[] pic = Request.Form["picsrc"].Split(',');
string[] url = Request.Form["urlsrc"].Split(',');
string[] nam = Request.Form["name"].Split(',');
int[] wh = null;
for (int i = 0; i < 4; i++)
{
xmlw.WriteStartElement("picsrc");
xmlw.WriteString(pic[i]);
xmlw.WriteEndElement();
xmlw.WriteStartElement("name");
if (string.IsNullOrEmpty(nam[i]))
xmlw.WriteString("...");
else
xmlw.WriteString(nam[i]);
xmlw.WriteEndElement();
xmlw.WriteStartElement("
相关文档:
<
<
小于
>
>
大于
&
&
和号
'
'
单引号
"
"
引号
注释:在 XML 中,只有字符 "<" 和 "&" 确实是非法的。大于号是合法的,但是用实体引用来代替它是一个好习惯。 ......
一、WDDX的产生
WDDX,英文全称为Web Distributed Data
Exchange,是一种基于XML的Web分布式数据交换技术。WDDX最早是美国Allaire公司的程序技术设计师Simeon
Simeonov为了解决ColdFusion中涉及到的分布计算问题而建立的。随着工作的开展,WDDX逐渐演变成为一种可用于不同的应用环境中交换复杂的结构 ......
测试用的xml文件
<?xml version="1.0" encoding="UTF-8"?>
<schools>
<school id='111'>测试学校</school>
<school id='222'>测试学校22
<class id='2.1'>测试班级222</class>
</school>
</schools>
测试用的JavaScript代码
$().ready(function ......
XML 作为数据源的实例(TESTED)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" preinitialize="preInit()" fontSize="12" height="500">
<mx:Script>
  ......