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

XMLTextReader¶ÔXMLÎļþµÄ¶ÁÈ¡

using System;
using System.Xml;
namespace ReadXMLfromFile
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
static void Main(string[] args)
{
XmlTextReader reader = new XmlTextReader ("books.xml");
while (reader.Read())
{
switch (reader.NodeType)
{
case XmlNodeType.Element: // The node is an element.
Console.Write("<" + reader.Name);
Console.WriteLine(">");
break;
case XmlNodeType.Text: //Display the text in each element.
Console.WriteLine (reader.Value);
break;
case XmlNodeType.EndElement: //Display the end of the element.
Console.Write("</" + reader.Name);
Console.WriteLine(">");
break;
}
}
Console.ReadLine();
}
}
}


Ïà¹ØÎĵµ£º

xml´¦Àí

JAXBContext jc = JAXBContext.newInstance(ICPBuildSummaryXO.class);
   Unmarshaller u = jc.createUnmarshaller();
   ICPBuildSummaryXO xo = (ICPBuildSummaryXO) u.unmarshal(node);
   ICPBuildSummary summary = new ICPBuildSummary();
   Bean ......

ÈçºÎ½«¶ÔÏó¶Áдµ½ XML ÖÐ


´´½¨¿ÉÐòÁл¯µÄÀ࣬»òÕß´´½¨ÓÃÓÚ´¦Àí XML ÐòÁл¯ÀàµÄÀà¡£ Èç¹ûÄúÓµÓÐÃèÊöÒª¼ÓÔØ»ò±£´æµÄ XML Îļþ¸ñʽµÄ XML ¼Ü¹¹¶¨Òå (XSD)£¬ÇëʹÓà Xsd.exe ¹¤¾ß×Ô¶¯´´½¨ÕâЩÀà¡£ »¹¿ÉÒÔÊÖ¶¯´´½¨ÕâЩÀà¡£ ÈôҪʹÓà Xsd.exe ¹¤¾ß´´½¨¿ÉÐòÁл¯µÄÀ࣬Çë°´ÕÕÏÂÁв½Öè²Ù×÷£º
½«ÒÔÏÂÃèÊö¶©µ¥µÄ XSD ¼Ü¹¹±£´æΪ Po.xsd Îļþ£º
<xsd:sche ......

DataSetÓëxmlÎļþµÄ»¥Ïàת»»


http://www.cnblogs.com/long2006sky/articles/1258731.html
DataSetת»»ÎªxmlÎļþ
//½«DataSetת»»ÎªxmlÎļþ
        private static void ConvertDataSetToXMLFile(DataSet xmlDS, string xmlFile)
        {
    &n ......

VSÖÐʹÓÃTinyXml²Ù×÷xmlÎļþ

µ½http://sourceforge.net/projects/tinyxml/ÏÂÔØTinyXmlµÄ¹Ù·½Àý×Ó£¬
ÀïÃæÓкü¸¸öÎļþ£¬ÎÒÃÇ°Ñ
tinyxml.h
tinystr.h
tinystr.cpp
tinyxml.cpp
tinyxmlparser.cpp
tinyxmlerror.cpp
Õ⼸¸öÎļþ°üº¬µ½ÎÒÃǵŤ³ÌÄÚ¡£
Òª°üº¬Í·Îļþ #include "tinyxml.h"
ÕâÓþͿÉÒÔ¿ªÊ¼Ê¹ÓÃtinyxml¿ªÊ¼²Ù×÷xmlÎļþÁË£¬¾ßÌåµÄ²Ù×÷· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ