setTextContent±à¼XMLÎļþÄÚÈÝû±ä»¯
Java code:
/**
* ÉèÖÃÖ¸¶¨µÄÔªËØÃûºÍ½ÚµãË÷ÒýËù¶ÔÓ¦½ÚµãµÄÄÚÈÝ
* @param ÔªËØÃû
* @param ½ÚµãË÷Òý
* @param ÄÚÈÝ
*/
public void setElementContent(String elementName,int nodeIndex,String newContext){
try{
NodeList nodeList=doc.getElementsByTagName(elementName);
Node node0=nodeList.item(nodeIndex);
node0.setTextContent(newContext);
}catch(DOMException e){
System.out.println(e.toString().replaceAll("\n", ""));
}
public static void setParmeter(String xmlPath,HashMap indexHP, HashMap valueHP){
XmlDocumentManager xml=new XmlDocumentManager(xmlPath);
xml.setElementContent("property", Integer.parseInt(indexHP.get("dialect").toString()), valueHP.get("dialect").toString());
xml.setElementContent("property", Integer.parseInt(indexHP.get("driver").toString()), valueHP.get("driver").toString());
xml.setElementContent("property", Integer.parseInt(indexHP.get("url").toString()), valueHP.get("url").toString());
xml.setElementContent("property", Integer.parseInt(indexHP.get("username").toString()), valueHP.get("username").toString());
xml.setElementContent("property",
Ïà¹ØÎÊ´ð£º
ÎÒÊÇÏëÓÃPHP´ÓÊý¾Ý¿âÖжÁÈ¡Êý¾Ý£¬È»ºóдÈëxml£¬È»ºóFLASHÏÔʾXMLÖеÄÊý¾Ý
µ«ÊDZ¾µØ²âÊÔPHPÄܶÁ³öXML£¬´«µ½¿Õ¼äÀï¾Í¶Á²»³öÀ´ÁË£¬ÇëÎÊÔõô»ØÊÂ?
´íÎó´úÂëÈçÏÂ:
Fatal error: Cannot instantiate non-exis ......
ÎÒµÄXMLÅäÖÃÎļþÀïÃæÓÐÖÐÎÄ×Ö·û,Ò²ÓÐÀàËÆÓÚ=~@!ÕâÖÖ×Ö·û,encodeingÉèÖÃΪgb2312 ºÍ unicode,unicode UTF-8,½á¹û¶¼Ìáʾϵͳ´íÎó,,,Èç¹ûÉèÖÃΪgb2312µÄ»°,È¥µô=!@ÕâÖÖ×Ö·û,Ò»Çж¼Õý³£.
ÓÉÓÚÎ ......
ÈçºÎÓÃc£«£«³ÌÐòÅжÏxmlÖи÷ÔªËصĺϷ¨ÐÔ£¬Õë¶Ô¸ñʽÉϵĺϷ¨ÐÔ£¬·µ»Ø0»òÕß1
ʹÓÃMSXML£¬¼ÓÔØXMLºó£¬Ê¹ÓÃvalidate·½·¨ÑéÖ¤
¾Ý˵ÄãÒªÔÚlinuxÏÂʹÓá£
linuxÏ¿ÉÒÔʹÓÃLibxml2À´²Ù×÷xml£¬Í¬ÑùÌṩÁËvalidateµÄ·½·¨ ......
ÎÒÏëÒªÒ»個ͨÓõÄxml轉DataTable£¬xmlÎļþ來×Ô²»Í¬µÄÎÄ檔£¬
ÀýÈ磺excelÎÄ檔Áí´æ為xmlÎÄ檔Ôõô°Ñ這個xmlÎÄ檔轉換³ÉDataSet¡¢DataTable ......
ºÃ ÎÒÏëѧϰXMLºÃÊ飬ÇëÎÊÓÐʲôÊ飬¿ÉÒÔÉîÈëµÄѧϰÏÂµÄ Ð»Ð»
ÎÞ·Ï»°XML ̨ÍåÁ½Ö»ÀÏ»¢
XMLÈëÞµä
ÓÑÇé °ï¶¥¡£
ÎÞ·Ï»°XML ̨ÍåÁ½Ö»ÀÏ»¢ÖªÊ¶µã±È½ÏÉÙ
XML´ÓÈëÃŵ½¾«Í¨
......