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

xmlÓëDataSetµÄ»¥×ª»»Àà

ÒÔǰÔÚ²©¿ÍÉÏ·¢¹ý£¬¾­ÈËÌáÐÑDataSetÒÑ×Ô´ø¶ÁдXMLµÄ¹¦ÄÜ£¬ÓÚÊDZãɾÁË£¬
²»¹ýÔÚʵ¼ùÖиоõ·â×°Ò»²ãºó£¬Ê¹ÓÃÆðÀ´»¹ÊÇÂù·½±ãµÄ¡£¹ÊÔÙ´ÎÖØ·¢¡£
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.IO;
using System.Xml;
namespace XmlDesign
{
class XmlDatasetConvert
{
//½«xml¶ÔÏóÄÚÈÝ×Ö·û´®×ª»»ÎªDataSet
public static DataSet ConvertXMLToDataSet(string xmlData)
{
StringReader stream = null;
XmlTextReader reader = null;
try
{
DataSet xmlDS = new DataSet();
stream = new StringReader(xmlData);
//´Óstream×°ÔØµ½XmlTextReader
reader = new XmlTextReader(stream);
xmlDS.ReadXml(reader);
return xmlDS;
}
catch (System.Exception ex)
{
throw ex;
}
finally
{
if (reader != null) reader.Close();
}
}
//½«xmlÎļþת»»ÎªDataSet
public static DataSet ConvertXMLFileToDataSet(string xmlFile)
{
StringReader stream = null;
XmlTextReader reader = null;
try
{
XmlDocument xmld = new XmlDocument();
xmld.Load(xmlFile);
DataSet xmlDS = new DataSet();
stream = new StringReader(xmld.InnerXml);
//´Óstream×°ÔØµ½XmlTextReader
reader = new XmlTextReader(stream);
xmlDS.ReadXml(reader);
//xmlDS.ReadXml(xmlFile);
return xmlDS;
}
catch (System.Exception ex)
{
throw ex;
}
finally
{
if (reader != null) reader.Close();
}
}
//½«DataSetת»»Îªxml¶ÔÏó×Ö·û´®
public static string ConvertDataSetToXML(DataSet xmlDS)
{
MemoryStream stream = null;
XmlTextWriter writer = null;
try
{
stream = new MemoryStream();
//´Óstream×°ÔØµ½XmlTextReader
writer = new XmlTextWriter(stream, Encoding.Unicode);
//ÓÃWriteXml·½·¨Ð´ÈëÎļþ.
xmlDS.WriteXml(writer);
int count = (int)stream.Length;
byte[] arr = new byte[count];
stream.Seek(0, SeekOrigin.Begin);
stream.Read(arr, 0, count);
UnicodeEncoding utf = new UnicodeEncoding();
return utf.GetString(arr).Trim();
}
catch (System.Exception ex)
{
throw ex;
}
finally
{
if (writer != null) writer.Close();
}
}
//½«DataSetת»»ÎªxmlÎļþ
public static void ConvertDataSetToXMLFile(Dat


Ïà¹ØÎĵµ£º

XML over TCP

Èç¹ûÒªÍêÕûµÄÖ§³ÖXML over TCP£¬Ö»ÓÐÁ½ÖÖ°ì·¨£º
1£¬¼ÓÒ»¸öheaderÈ¥±êÃ÷Êý¾ÝµÄ³¤¶È
2£¬¼ÓÒ»¸ödelimiterÈ¥±êÃ÷Êý¾ÝµÄ½áÊø
ÕâÁ½ÖÖ·½·¨¶¼²»¹»ÓÅÑÅ¡£ÎÒÃDz»ÐèÒªÒ»¸öͨÓõķ½·¨£¬ÎÒÃÇÖ»ÒªÒ»¸ö×îÊʺÏÎÒÃǵķ½·¨¡£
ͨ³££¬ÎÒÃÇÄܹ»×Ô¶¨ÒåÊý¾ÝµÄ¸ñʽ£¬¶øÇÒÎÒÃÇͨ³£Ò»ÌõÏûÏ¢Ö»ÓÐÒ»¸öroot node£¬ÄÇôÎÒÃÇ¿ÉÒÔÊÔÊÔÏÂÃæµÄº¯Êý£º
//re ......

XML תÒå×Ö·û

ref : http://blog.csdn.net/High_Mount/archive/2008/09/19/2953335.aspx
תÒå×Ö·û
²»ºÏ·¨µÄXML×Ö·û±ØÐë±»Ìæ»»ÎªÏàÓ¦µÄʵÌå¡£
Èç¹ûÔÚXMLÎĵµÖÐʹÓÃÀàËÆ"<" µÄ×Ö·û, ÄÇô½âÎöÆ÷½«»á³öÏÖ´íÎó£¬ÒòΪ½âÎöÆ÷»áÈÏΪÕâÊÇÒ»¸öÐÂÔªËØµÄ¿ªÊ¼¡£ËùÒÔ²»Ó¦¸ÃÏóÏÂÃæÄÇÑùÊéд´úÂë:
<message>if salary < 1000 then</me ......

TXMLDocument¶ÔXMLÎļþ½øÐжÁÈ¡ºÍдÈë (bcb)

¶¯Ì¬´´½¨TXMLDocument¶ÔXMLÎļþ½øÐжÁÈ¡ºÍдÈë - [Delphi¸ß¼¶Ó¦ÓÃ]
2008-01-16
Tag£ºDelphi XML XMLDocument
°æÈ¨ÉùÃ÷£º×ªÔØÊ±ÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂԭʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
http://overblue.blogbus.com/logs/13954596.html
uses
  XMLDoc, XMLIntf;
{ дÈëXMLÄÚÈÝ }
var
  XMLDoc : TXMLDocumen ......

PHP¶ÔXMLµÄÖ§³Ö

PHP´ÓPHP5¿ªÊ¼£¬³¹µ×ÖØÐ±àдµÄºÍÐÂÔöÁ˶ÔXMLµÄÀ©Õ¹£¬Èç SAX ½âÎöÆ÷¡¢DOM¡¢SimpleXML¡¢XMLReader¡¢XMLWriter ºÍ XSLT ´¦Àí³ÌÐò¡£ËùÓÐÕâЩÀ©Õ¹¶¼ÒÔ libxml2 Ϊ»ù´¡¡£
=============================
1¡¢DOMDocument¶ÔÏó³£Ó÷½·¨£º
=============================
a£©createElement(elementName)
    ¸Ã· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ