Java parsing XML file

xiaoxiao2021-03-06  42

If the XML file contains Chinese, you need to add Import Javax. xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom *;. public class xml2oth {DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance (); DocumentBuilder builder = factory.newDocumentBuilder (); Element root = doc .getdocumentelement (); nodelist allNode = root.getChildNodes (); for (int i = 1; i

转载请注明原文地址:https://www.9cbs.com/read-77436.html

New Post(0)