我正在寻找解析这样的 XML 文件
<class>
<subject>
<knowledgeLevel> 1 </knowledgeLevel>
<subjectName> Try1 </subjectName>
<theory>
<tutorial> Quickly Explain Try1 </tutorial>
<full> Largely Explain Try1 </full>
</theory>
<example>
<id> 1 </id>
<code> some code </code>
<level> easy </level>
</example>
<example>
<id> 2 </id>
<code> some code </code>
<level> hard </level>
</example>
</subject>
</class>
考虑到文件中最终会出现多个主题,我如何让理论和示例的 subChilds 用 Javascript 编写 HTML 表格?