delphi Éú³Éxml ·½·¨ Óë delphi txtÎļþ²Ù×÷
Procedure TForm1.Button1Click(Sender: TObject);
Var
xmlstr,FileName: String;
f: Textfile;
Begin
xmlStr := '<?xml version="1.0" encoding="gb2312"?>';
xmlstr := xmlstr + '<user><name>ÕÅÈý</name><sex>ÄÐ</sex></user>';
showmessage(xmlstr);
FileName:='a.xml';
If fileExists(FileName) Then DeleteFile(FileName); {¿´ÎļþÊÇ·ñ´æÔÚ,ÔÚ¾Í刪³ý}
AssignFile(F, FileName); {½«ÎļþÃûÓë±äÁ¿ F ¹ØÁª}
ReWrite(F); {´´½¨Ò»¸öеÄÎļþ²¢ÃüÃûΪ ek.txt}
Writeln(F, xmlstr);
Closefile(F); {¹Ø±ÕÎļþ F}
End;
Procedure NewTxt(FileName:String);
Var
F : Textfile;
Begin
if fileExists(FileName) then DeleteFile(FileName); {¿´ÎļþÊÇ·ñ´æÔÚ,ÔÚ¾Í刪³ý}
AssignFile(F, FileName); {½«ÎļþÃûÓë±äÁ¿ F ¹ØÁª}
ReWrite(F); {´´½¨Ò»¸öеÄÎļþ²¢ÃüÃûΪ ek.txt}
Writeln(F, '½«ÄúҪдÈëµÄÎı¾Ð´Èëµ½Ò»¸ö .txt Îļþ');
Closefile(F); {¹Ø±ÕÎļþ F}
End;
Procedure OpenTxt(FileName:String);
Var
F : Textfile;
Begin
AssignFile(F,FileName); {½«ÎļþÃûÓë±äÁ¿ F ¹ØÁª}
Append(F); {ÒԱ༷½Ê½´ò¿ªÎļþ F }
Writeln(F, '½«ÄúҪдÈëµÄÎı¾Ð´Èëµ½Ò»¸ö .txt Îļþ');
Closefile(F); {¹Ø±ÕÎļþ F}
End;
Procedure ReadTxt(FileName:String);
Var
F : Textfile;
str : String;
Begin
AssignFile(F, FileName); {½«ÎļþÃûÓë±äÁ¿ F ¹ØÁª}
Reset(F); {´ò¿ª²¢¶ÁÈ¡Îļþ F }
Readln(F, str);
ShowMessage('ÎļþÓÐ:' +str + 'ÐС£');
Closefile(F); {¹Ø±ÕÎļþ F}
End;
Procedure AppendTxt(Str:String;FileName:String);
Var
F:Textfile;
Begin
AssignFile(F, FileName);
Append(F);
Writeln(F, Str);
Closefile(F);
End;
Ïà¹ØÎĵµ£º
TreeViewÓɽڵ㹹³É,½¨Ê÷ͨ¹ý¶ÔTreeView.itemsÊôÐÔ½øÐвÙ×÷¡£ItemsÊÇÒ»¸öTTreeNodes¶ÔÏó,ÕâÊÇÒ»¸öTTreeNode¼¯¡£
Ò»¡¢Õë¶ÔTTreeNodes,Ò²¾ÍÊÇ TreeView.Items,ÓÐÕâЩÊôÐÔ:
1¡¢count,½Úµã¸öÊý¡£
2¡¢item[index] ,ͨ¹ýindexµÃµ½½Úµã¡£
¶þ¡¢Õë¶ÔTTreeNodes,Ò²¾ÍÊÇ TreeView.Items,³£ÓõÄÌí¼Ó½ÚµãµÄ²Ù×÷ ......
public string ConvertDataTableToXML(DataTable xmlDS)
{
MemoryStream stream = null;
XmlTextWriter writer = null;
try
{
stream = new MemoryStream();
writer = new XmlTextWriter(stream, Encoding.Default);
......
½â¶ÁPHP DOMDocumentÔÚ½âÎöXMLÎļþÖеÄ×÷ÓÃ
http://developer.51cto.com 2009-12-02 10:39 ØýÃû Áø³Ç²©¿Í ÎÒÒªÆÀÂÛ(0)
PHP DOMDocumentµÄ¹¦Äܷdz£Ç¿´ó£¬ÎÒÃÇÔÚÕâÆªÎÄÕÂÖн«½éÉÜÈçºÎÕýÈ·µÄÔËÓÃPHP DOMDocumentÀ´½øÐÐXMLÎļþµÄ½âÎö¡£Ï£Íû¶ÔÓÖÐèÒªµÄÅóÓÑÓÐËù°ïÖú¡£
ÔÚʹÓÃPHP¶ÔXMLÎļþ½øÐнâÎöµÄʱ ......
½øÈëMyEclipse6.XÏÂ
Ð޸ģºeclipse.ini Îļþ
-Duser.language=en
¸Ä³É
-Duser.language=zh
µ¯³öÌáʾ£ºCtrl+"/"
dtd ÃüÃû¿Õ¼äµÄÌáʾÐÅÏ¢
window-->Preference-->xml-->XML Catalog-->add
Location :sql-map-2.dtd
key type :pubic ID
key:-//ibatis.apache.org//DTD SQL Map 2.0//EN (XMLÎļþÃüÃû¿Õ¼ ......
ºÅ³ÆxmlhelperµÄÒ»¸öÀà
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XMLÎĵµ²Ù×÷¹ÜÀíÆ÷
/// </summary>
public class XMLHelper
{
public X ......