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

¸Ä½øµÄJava XMLÎļþºÏ²¢¹¤¾ßÀà

¹¤×÷ÖÐÓöµ½ÐèÒªºÏ²¢XMLµÄÎÊÌ⣬Ëì´ÓÍøÉϲéÕÒÏà¹Ø×ÊÁÏ£¬
1¡¢ ¡¶ XML merging made easy  

¡·
2 ¡¢¡¶javaÖкϲ¢xmlÎĵµµÄÉè¼ÆÓëʵÏÖ 
¡·
²âÊÔºó·¢ÏÖ¾ù²»·ûºÏʵ¼ÊÐèÇó£¬Êµ¼ÊÐèÇóÈçÏ£º
file1.xml: 
<root>
<a>
<b name="1"/>
</a>
<d />
<e id='1' />
</root>
file2.xml:
<root>
<a>
<b name="22"/>
</a>
<d name="qq"/>
<e id='1' />
</root>
ºÏ²¢ºóÐèÒªµÃµ½£º
<root>
<a>
<b name="22" />
<b name="1" />
</a>
<d name="qq" />
<e id="1" />
<d />
</root>
»ùÓÚ¡¶javaÖкϲ¢xmlÎĵµµÄÉè¼ÆÓëʵÏÖ 
¡·µÄ½éÉܶԴúÂë½øÐиĽø£¬Íê³ÉÁ˴˹¦ÄÜ£¬´úÂëÈçÏ£º
package davyxie;
import java.io.File;
import java.util.Properties;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
 * XMLÎļþºÏ²¢¹¤¾ßÀà
 * @author davyxie
 */
public class XMLMergeUtil {
   
    /**
     * XMLÎļþµÄºÏ²¢´¦Àí
     * @param mainFileName ´ýºÏ²¢´¦ÀíµÄxmlÎļþ£¬ºÏ²¢ºó½«¸üдËÎļþ
     * @param subFilename ±»ºÏ²¢µÄxmlÎļþ
     * @return ºÏ²¢³É¹¦·µ»Øtrue£¬·ñÔò·µ»Øfalse
     * @throws Exception
&


Ïà¹ØÎĵµ£º

javaÏîÄ¿ java webÏîÄ¿Êý¾Ý¿âÂÒÂëÎÊÌâµÄ½â¾ö°ì·¨

×÷Ϊjava²ËÄñ£¬ÔÚѧϰµ½Êý¾Ý¿â²Ù×÷µÄʱºòÍùÍù»áÓöµ½Ò»¸öºÜÍ·Í´µÄÎÊÌ⣬Êý¾Ý¿âÖÐÎÄÂÒÂë¡£ÕâËƺõÊÇÿ¸öjava³ÌÐòÔ±Ôڳɳ¤¹ý³ÌÖж¼»áÓöµ½µÄÎÊÌ⣬ÏÂÃæÎҾͰÑÎÒ×Ô¼ºµÄ¼¸ÖÖ·½·¨ºÍ´ó¼Ò·ÖÏíһϡ££¨Ò»°ãÊÇÔÚMyEclipseÏ¿ª·¢£©
javaÏîÄ¿£º
Ê×ÏÈ£¬È·±£ÏîÄ¿µÄ±àÂëÊÇgbk»òutf-8(),ÔÚWindows->Preferences->General->Workplac ......

Java »ù±¾½éÉÜ


Java
Java£¬ÊÇÓÉSun Microsystems¹«Ë¾ÓÚ1995Äê5ÔÂÍƳöµÄJava³ÌÐòÉè¼ÆÓïÑÔºÍJavaƽ̨µÄ×ܳơ£ÓÃJavaʵÏÖµÄHotJavaä¯ÀÀÆ÷£¨Ö§³ÖJava applet£©ÏÔʾÁËJavaµÄ÷ÈÁ¦£º¿çƽ̨¡¢¶¯Ì¬µÄWeb¡¢Internet¼ÆËã¡£´Ó´Ë£¬Java±»¹ã·º½ÓÊܲ¢Íƶ¯ÁËWebµÄѸËÙ·¢Õ¹£¬³£ÓõÄä¯ÀÀÆ÷ÏÖÔÚ¾ùÖ§³ÖJava applet¡£
¡¡¡¡Javaƽ̨ÓÉJavaÐéÄâ»ú£¨Java Virt ......

java±ÊÊÔ

    Ô­ÌâÈçÏ£ºÓÃ1¡¢2¡¢2¡¢3¡¢4¡¢5ÕâÁù¸öÊý×Ö£¬ÓÃjavaдһ¸ö³ÌÐò£¬´òÓ¡³öËùÓв»Í¬µÄÅÅÁУ¬È磺512234¡¢412345µÈ£¬ÒªÇó£º"4"²»ÄÜÔÚµÚÈý룬"3"Óë"5"²»ÄÜÏàÁ¬¡£
 ½âÌâ˼·£º
    ºÜÃ÷ÏÔ£¬ÕâÊÇÒ»¸öµÝ¹éËã·¨¡£ÎÒÃÇ¿ÉÒÔÅÅÁн«Õâ6¸öÊý°´´ÓСµ½´óµÄ˳ÐòÅÅһϣ¬Èç¹ûÊÇ1,2,3,4,5,6£¬ÄÇô»áÓÐ1 ......

Java°´ÐжÁÈ¡Îı¾Îļþ

import java.io.*;
public class IoTest
{
public static void main(String[] args)
{
String s;
s=calculate();
System.out.println(s);
}
static String calculate()
{
StringBuffer sb=new StringBuffer("");
try{
FileReader re ......

Android·¬Íâƪ——XML layoutÓëCSS תÔØ

   ¿ª·¢¹ýAndroidÓ¦ÓõÄͬѧÃǶ¼ÖªµÀ£¬Android¹¤³Ì-res-layout×ÊÔ´Îļþ¼ÐÏ´æ·Å×Å¿ØÖÆview²¼¾ÖµÄxmlÎļþ£¬ÎÒÃÇ¿ÉÒÔͬ¹ýgetViewById(int i)·½·¨£¬´ÓXMLÖй¹Ôìview¼°Æä×ÓÀ࣬ÔÚÕâ¸ö¹ý³Ìµ±ÖУ¬XMLÎļþÖеÄÒ»ÇÐlayoutÊôÐÔÒ²½«±»¸³ÓèÕâ¸öview¡£µ±È»£¬ÎÒÃÇÒ²Äܹ»Í¨¹ý´úÂëÀ´ÎªÄ³Ò»¸öviewÀ´ÉèÖÃlayout£¬ÄÇÊǺ󻰡£Í¨¹ý¶Ô¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ