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

³õѧXML£¨Ò»£©

XML¶¨Ò壺Óɱê¼Ç¼°ÆäËù±ê¼ÇµÄÄÚÈݹ¹³ÉµÄÎı¾Îļþ¡£
XML×÷ÓãºÓÃÀ´ÃèÊöÊý¾ÝµÄ½á¹¹£¬ÓÐЧ·ÖÀëÊý¾ÝµÄ½á¹¹ºÍ±íʾ£¬¿ÉÒÔ×÷ΪÊý¾Ý½»»»µÄ±ê×¼¸ñʽ¡£
XMLÌص㣺1¡¢¿ÉÒÔ×Ô¶¨Òå±ê¼Ç£¬±ê¼ÇÃû³ÆÊǶÔËù±ê¼ÇµÄÊý¾ÝÄÚÈݺ¬ÒåµÄ³éÏ󣬶ø²»ÊÇÊý¾ÝµÄÏÔʾ¸ñʽ¡£
               2¡¢XMLÖ»¹ØÐÄÊý¾ÝµÄ×éÖ¯»ú¹¹£¬ÒÔ±ãXML½âÎöÆ÷°´ÕÕÆä½á¹¹·Ö½â³öÊý¾Ý¡£XML±¾Éí²»ÌṩÊý¾ÝµÄÏÔʾ¸ñʽ¡£
ÈçºÎÀ´ÏÔʾXMLÎļþµÄ±ê¼ÇÄÚÈÝÄØ£¿
1¡¢¼ÈÈ»ä¯ÀÀÆ÷²»ÄÜÖ±½ÓÏÔʾXMLÎļþµÄ±ê¼ÇÄÚÈÝ£¬ÄÇôÎÒÃǾÍÐèÒªÒÔijÖÖ·½Ê½¸æËßä¯ÀÀÆ÷ÈçºÎÏÔʾ¡£
2¡¢ÓÐÁ½ÖÖ·½Ê½¡£Ò»£ºÊ¹ÓÃCSS£¨²ãµþÑùʽ±í£©,¶þ£ºÊ¹ÓÃXSL½»»»£¨ÒÔºóÔÙÏêÊö£©¡£
ÏÂÃæ¾Ù¸öÀý×Ó¡£½«XMLÎļþºÍCSS¹ØÁªÆðÀ´¡£
ÔÚCSSÖУ¬×îÖØÒªµÄ×é³É²¿·Ö¾ÍÊÇÑùʽ±í£¬Æä×÷ÓãºËµÃ÷XMLÎļþÖеıê¼ÇÄÚÈÝÓúÎÖÖ·½Ê½ÏÔʾ¡£±ÈÈ磺
ÏëÓúÚÌåÀ´ÏÔʾXMLÎļþÖеıê¼Ç”<name>...</name>“Ëù±ê¼ÇµÄÄÚÈÝ£¬ÈçÏ£º
name
{
 display:block;font-size:16pt;font-weight:bold;
}
¸ÃÑùʽ±íµÄ×÷ÓÃÊǸæÖªä¯ÀÀÆ÷½«±ê¼Ç”<name>...</name>“Ëù±ê¼ÇµÄÄÚÈÝÏÔʾÔÚÒ»¸ö”¿éÇøÓò“ÖС£
ÒÔÏÂΪһ¸ö¼òµ¥µÄCSS¡£show.css.
name
{
display:block;font-size:16pt;color: #FF6600;font-weight:bold;
}
sex
{
display:line;font_size:18pt;color: #FF6600;font-weight:bold
}
birthday
{
display:line;font-size:9pt;color: #FF6600;font-weight;bold
}

ÔÙдһ¸öXMLÎļþ£ºa.xml
<?xml version="1.0" ?>
<?xml-stylesheet href="show.css" type="text/css" ?>
<man>
<name>
ÕÅÈý
<sex> ÄÐ </sex>
<birthday> 1984Äê8ÔÂ1ÈÕ</birthday>
</name>

<name>
ÀîËÄ
<sex> Å® </sex>
<birthday> 1985Äê8ÔÂ10ÈÕ</birthday>
</name>
</man>
ÐèҪעÒ⣺1¡¢ÔÚXMLÖУ¬Ã¿¸ö±ê¼Ç¶¼±ØÐë°üÀ¨¿ªÊ¼±ê¼ÇºÍ½áÊø±ê¼Ç¡£ËüÃÇÖ®¼äµÄÄÚÈÝΪ±ê¼ÇÄÚÈÝ¡£
               2¡¢Ò»¸ö±ê¼ÇµÄÄÚÈÝ¿ÉÒÔ°üº¬Îı¾ºÍÆäËûµÄ±ê¼Ç¡£
               3¡¢±


Ïà¹ØÎĵµ£º

¸ñʽ»¯XMLÊä³ö

ËäÈ»XMLÉè¼ÆµÄ³õÖÔÊÇΪÁË·½±ã»úÆ÷Ö®¼äµÄ½»»¥£¨interoperability£©£¬¶øÐèÒªÂú×ã»úÆ÷¿ÉÔĶÁ£¨machine readable£©µÄÌØÐÔ¡£È»¶ø£¬ÓÉÓÚ³ÌÐòԱΪÁË·½±ã¿ª·¢£¬¼ÈÈ»XMLÊÇͨ¹ýÎı¾±íʾµÄ£¬²»ÈçÔÙÇ¿»¯Ò»Ð©£¬×öµ½ÈËÀà¿ÉÔĶÁ£¨human readable£©°É¡£XML¾¿¾¹ÊÇÄÄÖÖ¿ÉÔĶÁµÄÌÖÂÛÒѾ­ÊÇÀÏÉú³£Ì¸ÁË£¬ÕâÀï²»»áÉîÈë̽ÌÖ£¬Ö»ÊǽèÖúÕâ¸ö»ú»á½éÉÜÒ ......

ÓÃSAXReader½âÎöxmlÎĵµ

     ʹÓÃSAXReaderÐèÒªµ¼Èëdom4j-full.jar°ü¡£
     dom4jÊÇÒ»¸öJavaµÄXML API£¬ÀàËÆÓÚjdom£¬ÓÃÀ´¶ÁдXMLÎļþµÄ¡£dom4jÊÇÒ»¸ö·Ç³£·Ç³£ÓÅÐãµÄJava XML API£¬¾ßÓÐÐÔÄÜÓÅÒì¡¢¹¦ÄÜÇ¿´óºÍ¼«¶ËÒ×ÓÃʹÓõÄÌص㣬ͬʱËüÒ²ÊÇÒ»¸ö¿ª·ÅÔ´´úÂëµÄÈí¼þ£¬¿ÉÒÔÔÚSourceForgeÉÏÕÒµ½Ëü¡£
 &n ......

Java²Ù×÷XMLÎļþ dom4j ƪ¡¾×ª¡¿

ÔÚÏîÄ¿ÖУ¬ÎÒÃǺܶ඼Óõ½ÁËxmlÎļþ£¬ÎÞÂÛÊDzÎÊýÅäÖû¹ÊÇÓëÆäËüϵͳµÄÊý¾Ý½»»¥¡£
½ñÌì¾ÍÀ´½²Ò»ÏÂJava ÖÐʹÓÃdom4jÀ´²Ù×÷XMLÎļþ¡£
ÎÒÃÇÐèÒªÒýÈëµÄ°ü£º
//Îļþ°ü
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileWriter;
//¹¤¾ß°ü
import java.util.Itera ......

java ¶ÔxmlµÄÔöɾ¸Ä²é

<?xml version="1.0" encoding="UTF-8"?>
<root>
 <person id="1">
  <username >xiaoma</username>
  <password>xiaoma</password>
 </person>
 <person id="2">
  <username>manager</username> ......

ÿÌìѧһµãflash£¨63£© ¶ÁÈ¡xmlºóµÄ¼òµ¥·ÖÒ³´¦Àí

 Õâ¸ö¶«Î÷¹¦Äܼܺòµ¥£¬Ã»ÓÐʲô¼¼Êõº¬Á¿¡£Ö»ÊǼǼһÏ¡£
 xml µÄÊý¾Ý»ñÈ¡ºó£¬¿ÉÒÔͨ¹ýÒ»¸ö¼òµ¥·ÖÒ³´¦ÀíÀ´Íê³É¼òµ¥·ÖҳЧ¹û¡£
 
1.ÀûÓÃÇóÓàºÍ³ý·¨µÄ·½·¨ÅжÏÒ³Êý
  Õâ¸öÊÇÒ»¸ö±È½Ï³£¼ûµÄ×ö·¨£¬Ò²ÊÇÒ»ÖÖ°ì·¨¡£ÔÚÕâÀ²»¶ÔÕâÖÖ·ÖÒ³´¦ÀíÒª´ïµ½Ê²Ã´×îÓÅ»¯µÄЧ¹û½øÐÐÌÖÂÛ£¬ÕâÀïÖ»ÊÇ̽ÌÖÒ»ÖÖ°ì·¨¡£¶ÔһР......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ