谁能想象我为这道题纠结了4个小时了,实在解决不了了,求助,急急急!
<?xml version="1.0" encoding="utf-8"?>
<!-- 文档类型(DTD) -->
<!DOCTYPE ShowList[
<!ELEMENT ShowList (Movie+)>
<!ELEMENT Movie (Name,Poster,Director,Actor,Type,Price,Schedule)>
<!ATTLIST Movie id CDATA #REQUIRED>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Poster (#PCDATA)>
<!ELEMENT Director (#PCDATA)>
<!ELEMENT Actor (#PCDATA)>
<!ELEMENT Type (#PCDATA)>
<!ELEMENT Price (#PCDATA)>
<!ELEMENT Schedule (Item+)>
<!ELEMENT Item (#PCDATA)>
]>
<ShowList>
<Movie id="001">
<Name>非常完美</Name>
<Poster>非常完美.jpg</Poster>
<Director>阴萌</Director>
<Actor>章子怡、范冰冰、何振东</Actor>
<Type>Romance</Type>
<Price>60</Price>
<Schedule>
<Item>9:00</Item>
<Item>13:00</Item>
</Schedule>
</Movie>
<Movie id="002">
<Name>风声</Name>
<Poster>风声.jpg</Poster>
<Director>陈国富</Director>
<Actor>周迅、李冰冰、张涵予</Actor>
<Type>Adventure</Type>
<Price>60</Price>
<Schedule>
<Item>11:20</Item>
<Item>15:45</Item>
<Item>19:25</Item>
</Schedule>
</Movie>
<Movie id="003">
<Name>窃听风云</Name>
<Poster>窃听风云.jpg</Poster>
<Director>麦兆辉/庄文强</Director>
<Actor>刘青云、吴彦族、古天乐</Actor>
<Type>Action</Type>
<Price>70</Price>
<Schedule>
<Item>21:00</Item>
<Item>23:10</Item>
</Schedule>
</Movie>
<Movie id="004">
<Name>非诚勿扰</Name>
<Poster>非诚勿扰.jpg</Poster>
<Director>冯小刚</Director>
<Actor>舒淇、葛优</Actor>
<Type>Romance</Type>
<Price>70</Price>
<Schedule>
<Item>17:30</Item>
</Schedule>
</Movie>
</ShowList>
问题1.针对电影ShowList.xml编写dtd
问题2.用java遍历ShowList.xml文件并输出
问题1上面已经写了,问题就出现在问题2上,把时间显示在item上这里卡住了,高手们,请解决吧,我就纠结了四个小时,其实题目难倒是不难,就是卡在这里了。写出代码吧,高手们,急急急啊!