我正在将 XML 文件读入这样的数据表:
DataTable dt = XMLParser.XMLRead.ReadeFormXMLFile(filePath, "my:myFields");
但是它没有捕获所有字段。
有多个从业者姓氏、从业者名字和从业者 NPI:
<my:group1>
<my:group2>
<my:PractitionerFirstName>Joe</my:PractitionerFirstName>
<my:PractitionerLastName>Limits</my:PractitionerLastName>
<my:PractitionerNPI>0987654321</my:PractitionerNPI>
<my:PractitionerDegree>MD</my:PractitionerDegree>
</my:group2>
<my:group2 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2012-02-06T05:56:10">
<my:PractitionerFirstName>Him</my:PractitionerFirstName>
<my:PractitionerLastName>Haw</my:PractitionerLastName>
<my:PractitionerNPI>1234567890</my:PractitionerNPI>
<my:PractitionerDegree>PA</my:PractitionerDegree>
</my:group2>
<my:group2 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2012-02-06T05:56:10">
<my:PractitionerFirstName>Mike</my:PractitionerFirstName>
<my:PractitionerLastName>Kim</my:PractitionerLastName>
<my:PractitionerNPI>1234567890</my:PractitionerNPI>
<my:PractitionerDegree>DO</my:PractitionerDegree>
</my:group2>
<my:group2 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2012-02-06T05:56:10">
<my:PractitionerFirstName>Vanilla </my:PractitionerFirstName>
<my:PractitionerLastName>Ice</my:PractitionerLastName>
<my:PractitionerNPI>1231231231</my:PractitionerNPI>
<my:PractitionerDegree>MD</my:PractitionerDegree>
</my:group2>
<my:group2 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2012-02-06T05:56:10">
<my:PractitionerFirstName>Kim</my:PractitionerFirstName>
<my:PractitionerLastName>John</my:PractitionerLastName>
<my:PractitionerNPI>1234567890</my:PractitionerNPI>
<my:PractitionerDegree>DO</my:PractitionerDegree>
</my:group2>
</my:group1>
但是它们没有被包括在内。它目前正在做的是将 LAST 记录纳入group2
并忽略此记录之前的所有记录:
<my:PractitionerFirstName>Kim</my:PractitionerFirstName>
<my:PractitionerLastName>John</my:PractitionerLastName>
<my:PractitionerNPI>1234567890</my:PractitionerNPI>
<my:PractitionerDegree>DO</my:PractitionerDegree>
问题:什么会导致 XML 解析器只抓取最后一条记录group2
而忽略其他所有内容?