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

jdom¶ÁÈ¡xmlÎļþ


import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;
£¨1£©Ê¹ÓÃJDOMÊ×ÏÈÒªÖ¸¶¨Ê¹ÓÃʲô½âÎöÆ÷¡£È磺
          SAXBuilder builder=new SAXBuilder(false); Õâ±íʾʹÓõÄÊÇĬÈϵĽâÎöÆ÷
£¨2£©µÃµ½Document£¬ÎÒÃÇÒÔºóÒª½øÐеÄËùÓвÙ×÷¶¼ÊǶÔÕâ¸öDocument²Ù×÷µÄ£º
          Document
doc=builder.build(xmlpath);
£¨3£©µÃµ½¸ùÔªËØ£º
          Element
books=doc.getRootElement();
ÔÚJDOMÖÐËùÓеĽڵ㣨DOMÖеĸÅÄ¶¼ÊÇÒ»¸öorg.jdom.ElementÀ࣬µ±È»ËûµÄ×Ó½ÚµãÒ²ÊÇÒ»¸öorg.jdom.ElementÀà¡£
£¨4£©µÃµ½ÔªËØ£¨½Úµã£©µÄ¼¯ºÏ£º
        List booklist=books.getChildren("book");
Õâ±íʾµÃµ½“books”ÔªËصÄËùÔÚÃû³ÆΪ“book”µÄÔªËØ£¬²¢°ÑÕâЩԪËض¼·Åµ½Ò»¸öList¼¯ºÏÖÐ
£¨5£©ÂÖÑ­List¼¯ºÏ
       for (Iterator iter = booklist.iterator();
iter.hasNext();) {
         Element book = (Element)
iter.next();
      £ý
»¹ÓÐÒ»ÖÖÂÖÑ­·½·¨ÊÇ£º
      for(int i=0;I<booklist.size();I++){
        Element
book=(Element)booklist.get(i);
      }
£¨6£©È¡µÃÔªËصÄÊôÐÔ£º
      String
email=book.getAttributeValue("email");
     È¡µÃÔªËØbookµÄÊôÐÔÃûΪ“email”µÄÊôÐÔÖµ¡£
£¨7£©È¡µÃÔªËصÄ×ÓÔªËØ£¨Îª×îµÍ²ãÔªËØ£©µÄÖµ£º
      String
name=book.getChildTextTrim("name");
      ×¢ÒâµÄÊÇ£¬±ØÐëÈ·¶¨bookÔªËصÄÃûΪ“name”µÄ×ÓÔªËØÖ»ÓÐÒ»¸ö¡£
£¨8£©¸Ä±äÔªËØ£¨Îª×îµÍ²ãÔªËØ£©µÄÖµ£º
     
book.getChild("name").setText("alterrjzjh");
      ÕâÖ»ÊǶÔDocumentµÄÐ޸ģ¬²¢Ã»ÓÐÔÚʵ¼ÊµÄXMLÎĵµÖнøÐÐÐÞ¸Ä
£¨9£©±£´


Ïà¹ØÎĵµ£º

D Busѧϰ£¨Æߣ©£ºÀûÓÃXML¶¨ÒåD BusÖ®ClientµÄÀý×Ó


¡¡¡¡¼ÌÐøѧϰD-Bus¡£Ö®Ç°Ñ§Ï°ÁËʹÓõײãµÄAPIÀ´·¢ËÍ£¬¼àÌýÏûÏ¢µÄ·½Ê½¡£ÔÚ
D-
Busѧϰ£¨ËÄ£©£º»ù´¡Ð¡Àý×Ó£¨Í¬²½ºÍÒì²½£©
Ö®ÖУ¬ÎÒÃǸø³öÁËÀûÓÃproxy½øÐз¢ËÍmethod_call£¬²¢µÈ´ýmethod_reply»òÕßerrorµÄclientÇé¿ö¡£ÔÚD-BusÖУ¬¿ÉÒÔ½«D-Bus½Ó¿Ú¶¨ÒåÓÃXML¸ñʽ±íÊö´¦Àí£¬²¢ÀûÓù¤¾ß£¬×Ô¶¯Éú³ÉÍ·Îļþ£¬¸ø³ö¹¤ÕûµÄµ÷Ó÷½Ê½¡ ......

Perl½âÎöXMLÎļþʱµÄ×Ö·û¼¯±àÂëÎÊÌâ

http://stackoverflow.com/questions/1112828/cannot-decode-string-with-wide-characters-appears-on-a-weird-place
http://man.ddvip.com/web/xmlzhzn/xml_cn/xml_encoding.asp.htm
http://bbs.xml.org.cn/dispbbs.asp?boardID=8&ID=7226
http://topic.csdn.net/t/20030909/13/2240153.html
#
http://www.ezloo. ......

ʹÓà XStream ÔÚ JavaBean Óë XML/JSON Ö®¼äÏ໥ת»»

XML ºÍ JSON Êǵ±½ñ³£ÓõÄÁ½ÖÖÊý¾ÝÃèÊöÓë´«ÊäµÄ¸ñʽ£¬ÌرðÊÇÉæ¼°µ½ JS ʱʹÓà JSON ÆÄΪƵ·±¡£×ÔÈ»£¬ÔÚ Java  µÄÊÀ½çÀïÉÙ²»ÁËÍê³É JavaBean ÓëÕâÁ½ÖÖ¸ñʽÏ໥ת»»µÄ×é¼þ£¬ÄǾÍÊÇ XStream ºÍ JSON-lib¡£ÕâÀïÎÒ¼òµ¥¼ÇÏ XStream  µÄÓ÷¨¡£
ÆäʵÏàÀàËƵŤ¾ßÔçÒÑÓÐÖ®¡£Èç¹ûÓùý DWR µÄͬ־£¬Ò»¶¨ÓÐÓ¡Ïñ£¬DWR ½øÐÐÔ¶ ......

XML×Ö·û´®ºÍXMLÎĵµÖ®¼äµÄ×ÔÓÉת»»

±¾ÎÄϵתÔØ£¬½÷ÏòתÔØ´¦¿Õ¼äÓµÓÐÕß¼°Ô´³ö´¦ÎÄÕÂ×÷Õß±íʾ¸Ðл£¡
תÔØ´¦£ºhttp://henry19890701.javaeye.com/blog/481462
Ô´³ö´¦£ºhttp://www.ziliaonet.com/tech/netprogramme/XML/200605/69398.html
ÔÚ×öÒ»°ãµÄXMLÊý¾Ý½»»»¹ý³ÌÖУ¬ÎÒ¸üÀÖÒâ´«µÝXML×Ö·û´®£¬¶ø²»ÊǸñʽ»¯µÄXML Document¡£Õâ¾ÍÉæ¼°µ½XML×Ö·û´®ºÍXml Docume ......

XML DTD XSD XSL XDR¶¼ÓÐʲôÇø±ð?

XML=¿ÉÀ©Õ¹±ê¼ÇÓïÑÔ(eXtensible Markup Language).
¿ÉÀ©Õ¹±ê¼ÇÓïÑÔXMLÊÇÒ»ÖÖ¼òµ¥µÄÊý¾Ý´æ´¢ÓïÑÔ£¬Ê¹ÓÃһϵÁмòµ¥µÄ±ê¼ÇÃèÊöÊý¾Ý£¬¶øÕâЩ±ê¼Ç¿ÉÒÔÓ÷½±ãµÄ·½Ê½½¨Á¢£¬ËäÈ»XMLÕ¼ÓõĿռä±È¶þ½øÖÆÊý¾ÝÒªÕ¼Óøü¶àµÄ¿Õ¼ä£¬µ«XML¼«Æä¼òµ¥Ò×ÓÚÕÆÎÕºÍʹÓá£
XMLµÄ¼òµ¥Ê¹ÆäÒ×ÓÚÔÚÈκÎÓ¦ÓóÌÐòÖжÁдÊý¾Ý£¬ÕâʹXMLºÜ¿ì³ÉΪÊý¾Ý½»»»µÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ