Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

XML²Ù×÷´óÈ«

ÐèÒªÌí¼ÓµÄÃüÃû¿Õ¼ä£º
using System.Xml;
¶¨Ò弸¸ö¹«¹²¶ÔÏó£º
XmlDocument xmldoc ;
XmlNode xmlnode ;
XmlElement xmlelem ;
1£¬´´½¨µ½·þÎñÆ÷ͬÃûĿ¼ÏµÄxmlÎļþ£º
·½·¨Ò»£º
xmldoc = new XmlDocument ( ) ;
//¼ÓÈëXMLµÄÉùÃ÷¶ÎÂä,<?xml version="1.0" encoding="gb2312"?>
XmlDeclaration xmldecl;
xmldecl = xmldoc.CreateXmlDeclaration("1.0","gb2312",null);
xmldoc.AppendChild ( xmldecl);
//¼ÓÈëÒ»¸ö¸ùÔªËØ
xmlelem = xmldoc.CreateElement ( "" , "Employees" , "" ) ;
xmldoc.AppendChild ( xmlelem ) ;
//¼ÓÈëÁíÍâÒ»¸öÔªËØ
for(int i=1;i<3;i++)
{
XmlNode root=xmldoc.SelectSingleNode("Employees");//²éÕÒ<Employees>
XmlElement xe1=xmldoc.CreateElement("Node");//´´½¨Ò»¸ö<Node>½Úµã
xe1.SetAttribute("genre","ÀîÔÞºì");//ÉèÖøýڵãgenreÊôÐÔ
xe1.SetAttribute("ISBN","2-3631-4");//ÉèÖøýڵãISBNÊôÐÔ
XmlElement xesub1=xmldoc.CreateElement("title");
xesub1.InnerText="CS´ÓÈëÃŵ½¾«Í¨";//ÉèÖÃÎı¾½Úµã
xe1.AppendChild(xesub1);//Ìí¼Óµ½<Node>½ÚµãÖÐ
XmlElement xesub2=xmldoc.CreateElement("author");
xesub2.InnerText="ºò½Ý";
xe1.AppendChild(xesub2);
XmlElement xesub3=xmldoc.CreateElement("price");
xesub3.InnerText="58.3";
xe1.AppendChild(xesub3);
root.AppendChild(xe1);//Ìí¼Óµ½<Employees>½ÚµãÖÐ
}
//±£´æ´´½¨ºÃµÄXMLÎĵµ
xmldoc.Save ( Server.MapPath("data.xml") ) ;
/**///////////////////////////////////////////////////////////////////////////////////////
½á¹û£ºÔÚͬÃûĿ¼ÏÂÉú³ÉÁËÃûΪdata.xmlµÄÎļþ£¬ÄÚÈÝÈçÏ£¬
<?xml version="1.0" encoding="gb2312"?>
<Employees>
  <Node genre="ÀîÔÞºì" ISBN="2-3631-4">
    <title>CS´ÓÈëÃŵ½¾«Í¨</title>
    <author>ºò½Ý</author>
    <price>58.3</price>
  </Node>
  <Node genre="ÀîÔÞºì" ISBN="2-3631-4">
    <title>CS´ÓÈëÃŵ½¾«Í¨</title>
    <author>ºò½Ý</author>
    


Ïà¹ØÎĵµ£º

¶ÔÓÚ´øÓбí¿Õ¼äxmlnsµÄxmlÎļþµÄ½âÎö

¶ÔÓÚ´øÓбí¿Õ¼äxmlnsµÄxmlÎļþµÄ½âÎö£¬ÓÃÕý³£½âÎöÎļþµÄ·½·¨×ÜÊÇʧЧ£¬²»Æð×÷Óã¬ÎÞ·¨»ñµÃÔªËØ¡£
ÏÂÃæ¸ø³öÁ½ÖÖ·½·¨½âÎö´ËÀàÎļþ£º
1.°´Õý³£½âÎöxmlÎļþµÄ·½·¨£¬ÐèҪעÒ⼸µã£º
»ñÈ¡ÔªËØElement£¬²»¿ÉʹÓú¯Êý£ºdocument.selectNodes("//region");
Ö»¿ÉÒÔÏÈÈ¡µ½¸ùÔªËØ£¬Ò»¼¶Ò»¼¶ÍùÏÂÈ¡£¬eg£º
Element root = document.g ......

FusionChartsµÄXML±êÇ©ÊôÐÔ

FusionCharts µÄ XML±êÇ©ÊôÐÔÓÐÒ»ÏÂËÄÖÖÊý¾ÝÀàÐÍ
* Boolean - ²¼¶ûÀàÐÍ£¬Ö»ÄÜΪ1»òÕß0¡£ÀýÈ磺<graph showNames=’1′ >
* Number - Êý×ÖÀàÐÍ£¬Ö»ÄÜΪÊý×Ö¡£ÀýÈ磺<graph yAxisMaxValue=’200′ >
* String - ×Ö·û´®ÀàÐÍ£¬Ö»ÄÜΪ×Ö·û´®¡£ÀýÈ磺 <graph caption=’My Chart&r ......

ÔÚSQL ServerÖÐÓÃXQuery·Ö½âXMLÊý¾Ý

¡¡¡¡±¾ÎÄÌÖÂÛSQL Server 2005µÄй¦ÄÜ£¬ËüÔÊÐíÄ㽫XMLÊý¾Ý·Ö½âµ½¹Øϵ¸ñʽÖУ¬¶ø²»±ØºÄÓÃÌ«¶àÄÚ´æ¡£
¡¡¡¡±¾ÎÄÌÖÂÛSQL Server 2005µÄй¦ÄÜ£¬ËüÔÊÐíÄ㽫XMLÊý¾Ý·Ö½âµ½¹Øϵ¸ñʽÖУ¬¶ø²»±ØºÄÓÃÌ«¶àÄÚ´æ¡£
¡¡¡¡ÔÚ¾ÙÀý˵Ã÷ÈçºÎ·Ö½âÉÏһƪÎÄÕÂÖеÄÊý¾Ýʱ£¬ÎÒÃÇÊ×ÏÈÁ˽âÒ»ÏÂXQueryºÍËüÔÚSQL Server 2005ÖÐΪ¿ª·¢ÕßÌṩµÄ¹¦ÄÜ¡£
¡ ......

Android·¬Íâƪ——XML layoutÓëCSS תÔØ

   ¿ª·¢¹ýAndroidÓ¦ÓõÄͬѧÃǶ¼ÖªµÀ£¬Android¹¤³Ì-res-layout×ÊÔ´Îļþ¼ÐÏ´æ·Å×Å¿ØÖÆview²¼¾ÖµÄxmlÎļþ£¬ÎÒÃÇ¿ÉÒÔͬ¹ýgetViewById(int i)·½·¨£¬´ÓXMLÖй¹Ôìview¼°Æä×ÓÀ࣬ÔÚÕâ¸ö¹ý³Ìµ±ÖУ¬XMLÎļþÖеÄÒ»ÇÐlayoutÊôÐÔÒ²½«±»¸³ÓèÕâ¸öview¡£µ±È»£¬ÎÒÃÇÒ²Äܹ»Í¨¹ý´úÂëÀ´ÎªÄ³Ò»¸öviewÀ´ÉèÖÃlayout£¬ÄÇÊǺ󻰡£Í¨¹ý¶Ô¼ ......

½âÎöxml org.w3c.dom


1.Òª½âÎöµÄXMLÎļþÈçÏ£º
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet href="student.xsl" type="text/xsl"?>
<StudentInfo>
 <student>
  <name>´ïÄÚ</name>
  <sex>ÄÐ</sex>
  <lesson>
   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ