我想用JAVA编一个读取XML通讯录的程序,比如我知道Email,输入Email就会出现其他信息。 10
这是XML文件:<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEcontactsSYSTEM"C:\Users\Administ...
这是XML文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE contacts SYSTEM "C:\Users\Administrator\Desktop\contacts2.dtd">
<contacts>
<SRC name="张三" sex="男">
<TEL>55</TEL>
</SRC>
<SRC name="EIJI" sex="男">
<QQ>11</QQ>
</SRC>
</contacts>
DTD文件:
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT contacts (SRC*)>
<!ELEMENT SRC (#PCDATA|TEL|QQ|Email)*>
<!ELEMENT TEL ANY>
<!ELEMENT QQ ANY>
<!ELEMENT Email ANY>
<!ATTLIST SRC sex CDATA #REQUIRED>
<!ATTLIST SRC name ID #REQUIRED> 展开
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE contacts SYSTEM "C:\Users\Administrator\Desktop\contacts2.dtd">
<contacts>
<SRC name="张三" sex="男">
<TEL>55</TEL>
</SRC>
<SRC name="EIJI" sex="男">
<QQ>11</QQ>
</SRC>
</contacts>
DTD文件:
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT contacts (SRC*)>
<!ELEMENT SRC (#PCDATA|TEL|QQ|Email)*>
<!ELEMENT TEL ANY>
<!ELEMENT QQ ANY>
<!ELEMENT Email ANY>
<!ATTLIST SRC sex CDATA #REQUIRED>
<!ATTLIST SRC name ID #REQUIRED> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询