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("
相关文档:
flex和spring+hibernate整合完成后web.XML出现如下错误
The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,reso ......
<?xml version="1.0" encoding="UTF-8"?>
<projects>
<node Country="暗暗啊" Gold="10" Silver="20" Bronze="30"/>
<node Country="白斑病" Gold="30" Silver="20" Bronze="10"/>
<node Country="常常厂" Gold="20" Silver="40" Bronze="60"/>
<node Country="赌东道" Gold="5 ......
基于dom4j的XML格式转化类
package com.lixi.util;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import org.dom4j.Document;
import org.do ......