LINQ to XMLº¯Êý¹¹Ôì·½·¨
±êÇ©£ºÊý¾Ý·ÃÎÊ LINQ to XML
LINQ to XML²¢²»´òËãÌæ´ú±ê×¼µÄXML API£¬Ö»ÊDz¹³äÁËÕâЩ±ê×¼XMLÀà LINQ to XMLº¯Êý¹¹Ôì·½·¨ º¯Êý¹¹½¨·½Ê½(functional construction):
ÔÚÕâÖÖ·½Ê½ÖУ¬¹¹Ô캯ÊýµÄµ÷ÓÿÉÒÔÓ÷´Ó³XMLÎĵµ½á¹¹µÄ·½Ê½Ç¶Ìס£
Àý£º
.....
XDocument xdoc = new XDocument( //XCocument ±íʾÍêÕûµÄXMLÎĵµ new XELement("customers", new XElement("customer", new XAtrribute("ID","A"), new XAtrribute("City","New York"), new XAtrribute("Region","North
Ïà¹ØÎĵµ£º
/// <summary>
/// DataTable-------------------->XML --String
/// </summary>
public static String ToXmlString(DataTable dt)
{
StringWriter tr = new StringWriter();
try
{
dt.WriteXml(tr); ......
public int createXMLFile(String filename) {
int returnValue = 0;
Document document = DocumentHelper.createDocument(); //Éú³ÉDocument£¬ÓÃÓÚ¹ÜÀíXMLÎĵµ
Element booksElement = document.addElement("books"); //Ìí¼Ó ......
XMLÎļþʵÀý£º
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Resource auth="Container" maxActive="20" name="sss" password="123"
type="javax.sql.DataSource" />
<Resource auth="Container" ......
ʹÓÃjavascript´´½¨Microsoft XML DOM,¾Í¿ÉÒÔÍê³ÉÕâÒ»¹¤×÷.
// ×°ÈëÊý¾Ý.
var source = new ActiveXObject("Microsoft.XMLDOM");
source.async = false
source.load("history.xml");
// ×°ÈëÑùʽ±í.
var stylesheet = new ActiveXObject("Microsoft.XMLDOM");
stylesheet.async = false
stylesheet.load( ......
from:
http://zhidao.baidu.com/question/67891842.html?si=1
ÏÂÃæµÄÒ»ÐоÍÊÇÔÚµÚ¶þ±¾ÊéµÄ¶¨Òå֮ǰµÄ£º
<?page render multiple authors ?>
ËäÈ»Ëü¿´ÉÏÈ¥ºÜÏñXMLÐòÑÔ£¬µ«Êµ¼ÊÉÏÊÇÒ»ÖÖ³ÆΪ´¦ÀíÖ¸Áprocessing instruction£©µÄ²»Í¬ÀàÐ͵ÄÓï·¨¡£´¦ÀíÖ¸ÁÒÔϼò³ÆPI£©µÄÄ¿µÄÊÇΪÁ˸ø´¦ÀíÒ³ÃæµÄ³ÌÐò£¨ÀýÈçXML½âÎöÆ ......