XML×Ö·û´®ºÍXMLÎĵµÖ®¼äµÄ×ÔÓÉת»»
±¾ÎÄϵתÔØ£¬½÷ÏòתÔØ´¦¿Õ¼äÓµÓÐÕß¼°Ô´³ö´¦ÎÄÕÂ×÷Õß±íʾ¸Ðл£¡
תÔØ´¦£ºhttp://henry19890701.javaeye.com/blog/481462
Ô´³ö´¦£ºhttp://www.ziliaonet.com/tech/netprogramme/XML/200605/69398.html
ÔÚ×öÒ»°ãµÄXMLÊý¾Ý½»»»¹ý³ÌÖУ¬ÎÒ¸üÀÖÒâ´«µÝXML×Ö·û´®£¬¶ø²»ÊǸñʽ»¯µÄXML Document¡£Õâ¾ÍÉæ¼°µ½XML×Ö·û´®ºÍXml DocumentµÄת»»ÎÊÌ⣬˵°×ÁËÕâÊǸöºÜ¼òµ¥µÄÎÊÌ⣬±¾Îľ͸÷ÖÖXML½âÎöÆ÷·Ö±ðÁоÙÈçÏ£¬ÒÔ·½±ã×Ô¼º½ñºó²éÔÄ¡£
Ò»¡¢Ê¹ÓÃ×îÔʼµÄjavax.xml.parsers£¬±ê×¼µÄjdk api
// ×Ö·û´®×ªXML
String xmlStr = "......";
StringReader sr = new StringReader(xmlStr);
InputSource is = new InputSource(sr);
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder=factory.newDocumentBuilder();
Document doc = builder.parse(is);
//XMLת×Ö·û´®
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer();
t.setOutputProperty("encoding","GB23121");//½â¾öÖÐÎÄÎÊÌ⣬ÊÔ¹ýÓÃGBK²»ÐÐ
ByteArrayOutputStream bos = new ByteArrayOutputStream();
t.transform(new DOMSource(doc), new StreamResult(bos));
String xmlStr = bos.toString();
ÕâÀïµÄXML DOCUMENTΪorg.w3c.dom.Document
¡¡¡¡¶þ¡¢Ê¹ÓÃdom4jºó³ÌÐò±äµÃ¸ü¼òµ¥
// ×Ö·û´®×ªXML
String xmlStr = "......";
Document document = DocumentHelper.parseText(xmlStr);
// XMLת×Ö·û´®
Document document = ...;
String text = document.asXML();
ÕâÀïµÄXML DOCUMENTΪorg.dom4j.Document
¡¡¡¡Èý¡¢Ê¹ÓÃJDOM
JDOMµÄ´¦Àí·½Ê½ºÍµÚÒ»ÖÖ·½·¨´¦Àí·Ç³£ÀàËÆ
//×Ö·û´®×ªXML
String xmlStr = ".....";
StringReader sr = new StringReader(xmlStr);
InputSource is = new InputSource(sr);
Document doc = (new SAXBuilder()).build(is);
//XMLת×Ö·û´®
Format format = Format.getPrettyFormat();
format.setEncoding("gb2312");//ÉèÖÃxmlÎļþµÄ×Ö·ûΪgb2312£¬½â¾öÖÐÎÄÎÊÌâ
XMLOutputter xmlout = new XMLOutputter(format);
ByteArrayOutputStream bo = new ByteArrayOutputStream();
xmlout.output(doc,bo);
String xmlStr = bo.toString();
ÕâÀïµÄXML DOCUMENTΪorg.jdom.Document
¡¡¡¡ËÄ¡¢JAVASCRIPTÖеĴ¦Àí
//×Ö·û´®×ªXML
Ïà¹ØÎĵµ£º
¶ÔÓÚ½«TXTÎĵµÖÐÊý¾Ýµ¼ÈëXMLÖеijÌÐòÍøÉϲ»¶à£¬µ«ÊÇÓкܶàÊÇÏȽ«TXTµ¼Èëµ½DataSetÖУ¬ÔÚÓÃXML½øÐд«Êä¡£ËùÒÔ±¾È˾ÍÔÚÕâÀïÓë´ó¼Ò·ÖÏíÒ»ÏÂÖ±½Óµ¼ÈëµÄÕâÖÖ·½Ê½¡£
±¾³ÌÐòÒ²¿ÉÒÔÓ¦ÓÃÓÚASP.NETÖУ¬ÄÇôÏÂÃæµÄÃüÃû¿Õ¼ä¼°Ò»Ð©µØ·½¾ÍµÃ¸Ä¸ÄÁË£¬»¹ÓÐÒª½«³ÌÐò¶¼·ÅÓÚPage_LoadÖС£
using System;
using System.Collections.Generic;
......
--±¾ÎÄÕª×Ôhttp://www.moandroid.com/?p=508
By: º£ÊÐò×Â¥ | In: Android¿ª·¢
3 ¾Å 2009
XML ¾³£ÓÃ×÷ Internet ÉϵÄÒ»ÖÖÊý¾Ý¸ñʽ£¬ÆäÎļþ¸ñʽÏë±Ø´ó¼Ò¶¼±È½ÏÇå³þ£¬ÔÚÕâÀïÎÒ½áºÏAndroidƽ̨£¬À´ËµÃ÷Android SDKÌṩµÄ¶ÁдXMLµÄpackage¡£
Ê×ÏȽéÉÜÏÂAndroid SDKÓëJava SDKÔÚ¶ÁдXMLÎļþ·½Ã棬Êý¾Ý°üÖ®¼äµÄ¹Øϵ¡£Android ......
¡¡¡¡¼ÌÐøѧϰD-Bus¡£Ö®Ç°Ñ§Ï°ÁËʹÓõײãµÄAPIÀ´·¢ËÍ£¬¼àÌýÏûÏ¢µÄ·½Ê½¡£ÔÚ
D-
Busѧϰ£¨ËÄ£©£º»ù´¡Ð¡Àý×Ó£¨Í¬²½ºÍÒì²½£©
Ö®ÖУ¬ÎÒÃǸø³öÁËÀûÓÃproxy½øÐз¢ËÍmethod_call£¬²¢µÈ´ýmethod_reply»òÕßerrorµÄclientÇé¿ö¡£ÔÚD-BusÖУ¬¿ÉÒÔ½«D-Bus½Ó¿Ú¶¨ÒåÓÃXML¸ñʽ±íÊö´¦Àí£¬²¢ÀûÓù¤¾ß£¬×Ô¶¯Éú³ÉÍ·Îļþ£¬¸ø³ö¹¤ÕûµÄµ÷Ó÷½Ê½¡ ......
XMLÔÚÎÒÃǵijÌÐòÖÐÓõ½µÄÔ½À´Ô½¶à£¬ÒòΪËü´æ´¢¡¢¶ÁÈ¡¡¢Ð޸Ķ¼±È½Ï·½±ã¡£
ÏÂÃæÎÒÀ´·ÖÏíÒ»ÏÂXMLµÄ³£ÓòÙ×÷(Ôöɾ¸Ä²é)£¬ÏÂÃæÊdzÌÐòÔËÐÐЧ¹û£º
Ôö(Ôö¼Ó½Úµã°üÀ¨´´½¨XML):
/// <summary>
/// ´´½¨XMLÎĵµ
/// </summary>
/// <param name="path"></param>
......
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. ......