0

こんにちは、XML ドキュメントからノードを削除できません。

例えば:

<XML>
<Node1>xxx</Node1>
<Node2>
    <Node3>zzz</Node3>
    <Node4>RemoveThis</Node4>
</Node2>
<Node2>
    <Node3>zzz</Node3>
    <Node4>RemoveThis</Node4>
</Node2>
</XML>

次のようなコードを使用しています:

If oXml.ChilkatPath("Node1|*") = "xxx" Then
        oXml.RemoveChildWithContent("Node2|Node4|*")
        outFile.WriteLine(oXml.GetXml())
End If

私が使用する場合

oXml.ChilkatPath("Node2|Node4|*") 

「RemoveThis」の値を取得するのに問題はありません

私は何を間違っていますか?

4

1 に答える 1

0

これが私がドキュメントで見つけたものです。私はchilkatを持っていないのでうまくいかないかもしれません.

Set xBeginAfter = xml.GetSelf()
' xFound is a Chilkat_9_5_0.Xml
if xml.ChilkatPath("Node1|*") = "xxx" then
   Set xFound = xml.SearchAllForContent(xBeginAfter,"Remove This")
   Do While Not (xFound Is Nothing )
    xFound.RemoveFromTree
    Set xFound = xml.SearchAllForContent(xBeginAfter,"Remove This")
   Loop
end if
于 2016-01-19T07:10:04.160 に答える