废话不多说,直接上代码!!!!我觉得没有什么比代码更能说明问题了。
<?xml version="1.0" encoding="UTF-8"?>
<水果 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="TestNameSpace.xsd">
<苹果>苹果</苹果>
<香蕉>香蕉</香蕉>
<李子>中文</李子>
</水果>
JAVA解析:
package hr.csdn.com;
import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.sun.xml.internal.bind.v2.runtime.NameList;
public class DomeTest {
/