【发布时间】:2017-01-24 13:19:08
【问题描述】:
我需要将新元素添加到 xml 树的特定部分,但我无法使其工作。
这是我的 xml 输入
<structMap LABEL="Logical Structure" TYPE="LOGICAL">
<div ID="DIVL1" TYPE="CONTENT">
<div ID="DIVL2" TYPE="" DMDID="MODSMD_ARTICLE1" LABEL="">
<div ID="DIVL3">
<div ID="DIVL31" TYPE="TITLE" />
</div>
</div>
</div>
</structMap>
这是我想要的输出
<structMap LABEL="Logical Structure" TYPE="LOGICAL">
<div ID="DIVL1" TYPE="CONTENT">
<div ID="DIVL2" TYPE="" DMDID="MODSMD_ARTICLE1" LABEL="">
<div ID="DIVL3">
<div ID="DIVL31" TYPE="TITLE">
<fptr>
<area BETYPE="IDREF" FILEID="ALTO0011" BEGIN="P11_TB3"/>
</fptr>
</div>
</div>
</div>
</div>
</structMap>
这是我的代码
var b = dc.Descendants().Attributes("TYPE").Where(ee => ee.Value == "TITLE").First();
我没有 b.AddFist。我怎样才能让它工作?
【问题讨论】: