Jdom ¶ÁÈ¡ xmlÎļþÀý×Ó
Jdom
¶ÁÈ¡
xml
ÎļþÀý×Ó
1.
ÓÃ
JDOM
¶ÁÈ¡
XML
ÎļþÐèÏÈÓÃ
org.jdom.input.SAXBuilder
¶ÔÏóµÄ
build()
·½·¨´´½¨
Document
¶ÔÏó
,
È»ºóÓÃ
Document
Àà¡¢
Element
ÀàµÈµÄ·½·¨¶ÁÈ¡
1.
Sample1.java
import
java.util.*;
import
org.jdom.*;
import
org.jdom.input.SAXBuilder;
public
class
Sample1 {
public
static
void
main(String[] args)
throws
Exception{
SAXBuilder sb=
new
SAXBuilder();
Document doc
=sb.build(Sample1.class.getClassLoader().getResource("test.xml")); //¹¹ÔìÎĵµ¶ÔÏó
Ïó
Element root=doc
.getRootElement();
//
»ñÈ¡¸ùÔªËØ
List list=root.getChildren(
"disk"
);
//
È¡Ãû×ÖΪ
disk
µÄËùÓÐÔªËØ
for
(
int
i=0;i<list.size();i++){
Element element=(Element)list.get(i);
String name=element.getAttributeValue(
"name"
);
String capacity=element.getChildText(
"capacity"
);
//
È¡
disk
×ÓÔªËØ
capacity
µÄÄÚÈÝ
String
directories=element.getChildText(
"directories"
);
String
files
=element.getChildText(
"files"
);
System.
out
.println(
"
´ÅÅÌÐÅÏ¢
:"
);
System.
out
.println(
"
·ÖÇøÅÌ·û
:"
+name);
System.
out
.println(
"
·ÖÇøÈÝÁ¿
:"
+capacity);
System.
out
.println(
"
Ŀ¼Êý
:"
+directories);
System.
out
.println(
"
ÎļþÊý
:"
+files);
System.
out
.println(
&
Ïà¹ØÎĵµ£º
¶ÔÓÚ.NETµ½µ×ÊÇʲôÕâ¸öÎÊÌ⣬ÓÐן÷ÖÖ¸÷ÑùµÄ˵·¨¡£µ«µ±Ê±×÷ΪÊ×ϯִÐйٵı«¶ûĬӦ¸Ã×îÄÜ´ú±í΢Èí¹«Ë¾µÄ¹Û
µã£¬Ëû˵£º“Microsoft.NET ´ú±íÁËÒ»¸ö¼¯ºÏ¡¢Ò»¸ö»·¾³¡¢Ò»¸ö¿ÉÒÔ×÷Ϊƽ̨֧³ÖÏÂÒ»´úInternetµÄ¿É±à³Ì½á¹¹¡£”È·
ʵ£¬Õâ¾ä»°»ù±¾Éϼòµ¥¶óÒªµØ±íÊöÁË.NETµÄÍâÌØÐÔ¡£
.NETÊ×ÏÈÊÇÒ»¸ö»·¾³¡ ......
Internet µÄÓ¦ÓÃÕýÔÚ²»¶ÏµØÀ©´ó£¬µ«ÎÒÃÇµÄ Internet ±à³Ì·½Ê½»¹´¦ÓÚʯÆ÷ʱ´ú¡£Internet Óû§¾ÍÏñÀÏʽÖ÷»úµÄ·ÖʱÖÕ¶ËÉϵÄÓû§Ò»Ñù£¬ËûÃÇ´ÓÒ»¸öÊܱ£»¤µÄ×ÊÔ´ÇëÇóÐÅÏ¢£¬È»ºóµÈ´ý»ØÓ¦¡£Äã´ÓÕýÔÚä¯ÀÀµÄ Internet Õ¾µãÉϽÓÊÕµÄÐÅÏ¢ÓÉËüÏ£ÍûÌṩ¸øÄãµÄ¡¢»ùÓÚ HTML µÄÐÅÏ¢×é³ÉµÄ¡£
¡¡¡¡µ«ÊÇ£¬Í¬Ô¶³Ì Web Õ¾µã½øÐн»»¥Ê½²Ù×÷ÊDz»ÊÇ ......
Èç¹û¶Ô½çÃæÃÀ¹Û³ÌÐò±È½Ï¸ß£¬ÊÖд´úÂëÊDz»¿É±ÜÃâµÄ¡£
µ«Èç¹û×öµÄÊÇһЩÏñÖ»ÊÇΪÁËÏÔʾ¡¢¿ØÖÆÖ®ÀàµÄ³ÌÐò£¬¿ÉÄܸü¿ìµÄ°Ñ³ÌÐòµ·¹Ä³öÀ´¾ÍºÃÁË¡£
wxwidgets
ÓÐÕâÑùµÄÒ»¸ö¹¦ÄÜ£¬¾ÍÊÇÄÜÓÃxmlд³É½çÃæ¾ÍÄÜÏÔʾ
±à¼xrcµÄ¹¤¾ßÊÇwxformbuilder,¿ªÔ´Ãâ·ÑµÄ£¬Ò²×ã¹»ÓÃÁË£¬ÎÒÒ»¿ªÊ¼Ã»ÕÒµ½Ôõô
Éú³Éxrc,ºóÀ´Ä³´ÎżȻ¿´µ½ÁËÏÂÃæ....ÔÀ ......
·½·¨Ò»£º
²ÉȡͨÓõÄbase64±àÂ뷽ʽ£¬È¡Ê±½âÂë´æÊ±¼ÓÂë¡£
ëÀÏʦÌṩÁËÍêÕûµÄ±àÂë´úÂ룬ÇÒЧÂʺܸߡ£
unit Base64;
interface
uses SysUtils, Classes;
type
{$IFDEF UNICODE}
Base64String = AnsiString;
{$ELSE}
Base64String = strin ......