XML´´½¨¡¢¶Á¡¢Ð´²Ù×÷
Create:
int nFQ;
XmlDocument doc = new XmlDocument();
XmlAttribute
newAtt;
//¶¨ÒåXMLÎĵµÍ·Îļþ
XmlDeclaration dec =
doc.CreateXmlDeclaration("1.0",null,null);
doc.AppendChild(dec);
XmlElement
docRoot = doc.CreateElement("Orders");
doc.AppendChild(docRoot);
for(int i=0;i<12;i++)
{
XmlNode Order =
doc.CreateElement("Order");
newAtt =
doc.CreateAttribute("Quantity");
nFQ = 10*i +i;
newAtt.Value
= nFQ.ToString();
Order.Attributes.Append(newAtt);
docRoot.AppendChild(Order);
}
//
±£´æXMLÎĵµ
string strPath = Server.MapPath("OutDocument.XML");
doc.Save(strPath);
Read:
Ò»£º
// ´´½¨XmlDocumentÀàµÄʵÀý
XmlDocument doc = new XmlDocument();
ArrayList
NodeValues = new ArrayList();
// °Ñpeople.xmlÎļþ¶ÁÈëÄڴ棬ÐγÉÒ»¸öDOM½á¹¹
doc.Load(
Server.MapPath("people.xml") );
XmlNode root =
doc.DocumentElement;
foreach( XmlNode personElement in
root.ChildNodes )
//°É½Úµã¼ÓÈëÊý×é
NodeValues.Add(personElement.FirstChild.Value);
//ÔÚListBoxÖÐÏÔʾ
XMLNodeListBox.DataSource = NodeValues;
XMLNodeListBox.DataBind();
¶þ£º
//¶ÁÈ¡XMLµ½DataSet
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(".\\db\\dbGuest.xml"));
GridView1.Dat
Ïà¹ØÎĵµ£º
¿ª·¢¹ýAndroidÓ¦ÓõÄͬѧÃǶ¼ÖªµÀ£¬Android¹¤³Ì-res-layout×ÊÔ´Îļþ¼ÐÏ´æ·Å×Å¿ØÖÆview²¼¾ÖµÄxmlÎļþ£¬ÎÒÃÇ¿ÉÒÔͬ¹ýgetViewById(int i)·½·¨£¬´ÓXMLÖй¹Ôìview¼°Æä×ÓÀ࣬ÔÚÕâ¸ö¹ý³Ìµ±ÖУ¬XMLÎļþÖеÄÒ»ÇÐlayoutÊôÐÔÒ²½«±»¸³ÓèÕâ¸öview¡£µ±È»£¬ÎÒÃÇÒ²Äܹ»Í¨¹ý´úÂëÀ´ÎªÄ³Ò»¸öviewÀ´ÉèÖÃlayout£¬ÄÇÊǺ󻰡£Í¨¹ý¶Ô¼ ......
1.Òª½âÎöµÄXMLÎļþÈçÏ£º
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet href="student.xsl" type="text/xsl"?>
<StudentInfo>
<student>
<name>´ïÄÚ</name>
<sex>ÄÐ</sex>
<lesson>
  ......
¹¤×÷ÖÐÓöµ½ÐèÒªºÏ²¢XMLµÄÎÊÌ⣬Ëì´ÓÍøÉϲéÕÒÏà¹Ø×ÊÁÏ£¬
1¡¢ ¡¶ XML merging made easy
¡·
2 ¡¢¡¶javaÖкϲ¢xmlÎĵµµÄÉè¼ÆÓëʵÏÖ
¡·
²âÊÔºó·¢ÏÖ¾ù²»·ûºÏʵ¼ÊÐèÇó£¬Êµ¼ÊÐèÇóÈçÏ£º
file1.xml:
<root>
<a>
<b name="1"/>
</a>
<d /& ......
ÎÄÕµ¼º½ SQL Server 2005 ѧϰ±Ê¼ÇϵÁÐÎÄÕµ¼º½
ÔÚSQl 2005 For XMl ¼òµ¥²éѯ(Raw£¬Auto£¬Pathģʽ)(1) ÀïÎÒÃÇ˵Á˹ØÓÚPath£¬RawºÍAutoģʽµÄÓ÷¨£¬ÆäʵÀïÃæ²»½ö½ö ÊÇÕâЩ¼òµ¥µÄ²Ù×÷£¬»¹ÓÐһЩÆäËüµÄÌØÐÔ£¬±ÈÈç˵Type»òOpenXml·½·¨£¬sp_xml_preparedocument´æ´¢¹ý³Ì µÈÕâЩÔö¼ÓµÄ¶«¶«£¬ÎÒÃÇÀ´Ò» ......