Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim BasicGroups As String() = New String() {"Node1", "Node2"}
- Dim NodesToRemove = From Element In SchemaDoc.Root.<Group> _
- Where Element.@Name not in BasicGroups
- For Each XNode In NodesToRemove
- XNode.Remove()
- Next
- where (not (list.Contains(foo))
- Dim SchemaDoc As New XDocument(<Root><Group Name="Foo"/><Group Name="Node1"/>
- <Group Name="Node2"/><Group name="Bar"/></Root>)
- Dim NodesToRemove = From Element In SchemaDoc.<Root>.<Group> Where _
- Element.@Name Like "NotNode?"
- For Each XNode In NodesToRemove.ToArray()
- XNode.Remove()
- Next
- Dim NodesToRemove As New Collections.ObjectModel.Collection(Of XNode)
- For Each Element In SchemaDoc.<Root>.<Group>
- If Not BasicGroups.Contains(Element.@Name) Then
- NodesToRemove.Add(Element)
- End If
- Next
- Dim NodesToRemove = From Element In SchemaDoc.Root.<Group> _
- Where Not BasicGroups.Contains(Element.@Name)
Add Comment
Please, Sign In to add comment