我想在Java中使用SAX解析器在我的XML文件中僅讀取對象標記的註釋。如何使用SAX Java解析器閱讀評論文本
這是我的文件的摘要:
<!-- Object Seed term: day, WikiTitle: day-->
<object id="15155220" name="solar day, twenty-four hour period, 24-hour interval, mean solar day, twenty-four hours, si day, día, days, si days, day duration, day, civil day">
<!-- class: "calendar day" -->
<class id="15157041" name="calendar day, civil day"></class>
<!-- class: "unit of time" -->
<class id="15154774" name="time units, unit of time, time unit, units of time"></class>
<!-- class: "" -->
<class id="15113229" name="period of time, time period, period"></class>
<!-- class: "" -->
<class id="00000000" name="time"></class>
<genericPhysicalDescription>
<!-- hasPart: "" -->
<hasPart id="15228378" name="hour, time of day"></hasPart>
<!-- hasPart: "" -->
<hasPart id="15157225" name="day"></hasPart>
<!-- partOf: "calendar" -->
<partOf id="15173479" name="calendrics, calendar, dating style, calendarist, calendars, birthday calendar, calendar strip, secular calendar, calandar, agriculture calendar, calendar system, criminal calendar"></partOf>
<!-- partOf: "" -->
<partOf id="15206296" name="month"></partOf>
<!-- partOf: "" -->
<partOf id="15157225" name="day"></partOf>
</genericPhysicalDescription>
</object>
是的,我的應用程序是基於SAX解析器 – Fast
僅供參考,薩克斯有些解析XML .. –