G
Guest
i want to remove from an xml its most inner child,under 1 o the xml cilds,
which maybe not the only 1 in the inner depth.
for example :
and i want to delete where CategoryGameID="14".
itreid to do :
and i got an error
what am i doing wrong?
thnaks in advance
peleg
which maybe not the only 1 in the inner depth.
for example :
Code:
<GameType Ref="2">
<Category id="23" isActive="1" Name="ca2111" innerOrder="448">
<Game CategoryGameID="13" GameRef="12" isActive="1" innerOrder="34"
GameName="Game1" GamePath="flash/Games/2_1357.swf"
IconPathName="images/gamezone/temp.jpg" class="blue" title="game1 descr"
FramePathName="images/gamezone/contBoxBlue24.png" />
<Game CategoryGameID="14" GameRef="13" isActive="0" innerOrder="35"
GameName="Game2" GamePath="flash/Games/121212_1357.swf"
IconPathName="images/gamezone/temp.jpg" class="blue" title="dfgd fg dfg"
FramePathName="images/gamezone/contBoxBlue24.png" />
</Category>
<Category id="27" isActive="0" Name="paint12" innerOrder="7" />
</GameType>
itreid to do :
Code:
XmlDocument.Load(filePath)
If Not XmlDocument.SelectNodes("GamesZone/GameType[@Ref='" &
GameTypeRef & "']/Category[@id='" & txtCategoryRef.Value &
"']/Game[@CategoryGameID='" & CategoryGameID & "']") Is Nothing Then
Dim Element2Delete As System.Xml.XmlElement =
XmlDocument.SelectSingleNode("GamesZone/GameType[@Ref='" & GameTypeRef &
"']/Category[@id='" & txtCategoryRef.Value & "']/Game[@CategoryGameID='" &
CategoryGameID & "']")
XmlDocument.RemoveChild(Element2Delete)
XmlDocument.Save(filePath)
End If
and i got an error
what am i doing wrong?
thnaks in advance
peleg