【发布时间】:2011-03-13 00:02:24
【问题描述】:
我无法解析一段纯文本;即使使用打印语句遍历所有节点,它们都不包含我在 XML 文件中编写的文本。
这是来自 DTD 的元素规范:
<!ELEMENT question (#PCDATA | choice)*>
这是我正在使用的数据:
<question id="porridge" name="porridge" type="multiple">
What is 1 + 2?
<choice id="twelve" value="twelve">12</choice>
<choice id="three" value="three" correct="true">3</choice>
<choice id="banana" value="banana">Banana!</choice>
</question>
【问题讨论】: