XML有一些描述性字段,我想用它们来选择特定的字段。有没有办法让数据导入处理程序只使用“code = 34089-3”作为键选择“文本块A”和“文本块B”?代码字段没有数据,但它对我想要选择的信息类型是唯一的。当我使用xpath =“/ document / component / section / text / paragraph”时,我最终得到了文本块A,B,C和D.理想情况下,我希望能够只选择文本块A.这是否可能?
<component>
<section>
<id root="f915965e-fe3b-44eb-a2ed-c11f807e7f23"/>
<code code="34089-3"/>
<title>Title A</title>
<text>
<paragraph>Text Block A</paragraph>
<paragraph>Text Block B</paragraph>
</text>
</section>
</component>
<component>
<section>
<id root="80b7e2f1-f49f-4309-a340-210536705d4a"/>
<code code="34090-1"/>
<title>Title B</title>
<text>
<paragraph>Text Block C</paragraph>
<paragraph>Text Block D</paragraph>
</text>
</section>
</component>
<entity
name="IUPAC"
processor="XPathEntityProcessor"
forEach="/document"
url="${f.fileAbsolutePath}">
<field column="chemical_name" xpath="/document/component/section/code[@code='34089-3']/access below values???" />
</entity>
答案 0 :(得分:0)
尝试类似的东西:
/document/component/section[code/@code='34089-3']/text/paragraph