C# ¸ñʽ»¯Êä³öXML
ºÜ¶àʱºòÓÐÒ»¸öxml×Ö·û´®£¬Ã»Óл»ÐУ¬Ã»ÓÐËõ½ø£¬ÒªÉú³ÉxmlÎļþ²»Ò×ÔĶÁ¡£ÏÂÃæµÄ´úÂë¾ÍÊÇÔõô½«Ò»¸öÁ¬ÐøµÄxml×Ö·û´®¸ñʽ»¯Êä³ö
// a demo string
string xml = "<Root><Eles><Ele>abc</Ele><Ele>123</Ele></Eles></Root>";
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.LoadXml(xml);
System.IO.StringWriter sw = new System.IO.StringWriter();
using (System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(sw))
{
writer.Indentation = 2; // the Indentation
writer.Formatting = System.Xml.Formatting.Indented;
doc.WriteContentTo(writer);
writer.Close();
}
// out put the formated xml
Console.WriteLine(sw.ToString());
Ïà¹ØÎĵµ£º
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using MySql ......
SqLite.netµÄdllΪSystem.Data.SQLite.dll£¬ÕâÖÖdll·ÖΪ32λ¡¢64λºÍÊÊÓÃÓÚcompactframeworkÈýÖÖ£¬ÔÚÒýÓÃʱҪעÒ⣬ѡÔñÕýÈ·µÄdll¡£
½«Òª±£´æÍ¼Æ¬µÄ×Ö¶ÎÀàÐÍÉèΪblob¡£´úÂëÈçÏ£º
private void savePicture£¨£©
{
using (SQLiteConnection cnn = new SQLiteConnection(dbPath))
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XMLÎĵµ²Ù×÷¹ÜÀíÆ÷
&nb ......
ͨ¹ýxslת»»´óxmlÎļþ
Õ⼸ÌìÔÚ×öÕâ¸ö£¬ÍøÉϵö·½·¨ÎÒ¶¼ÊÔ¹ýÁË£¬»ã×ÜÈçÏÂ
·½·¨Ò»£º
XPathDocument myXPathDoc = new XPathDocument(tbXMLFile.Text);
XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load(tbXSLFile.Text);
XmlTextWriter myWriter = new XmlTextWrit ......
XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......