Quantcast
Channel: Product Communities
Viewing all articles
Browse latest Browse all 105279

Forum Post: Re: [V8i VB.NET] Changing TextNode fails silently

$
0
0

It's really peculiar: It turned out, that the finally "oTextNode.Rewrite() " prevents the sub text elements from being changed. If this line is left off, the sample works for me!

If (oEle.IsTextNodeElement) Then
    
    Dim oTextNode  As TextNodeElement = oEle.AsTextNodeElement
    
    Dim oText   As TextElement
    Dim EleEnum As ElementEnumerator = oTextNode.GetSubElements()
    If (EleEnum IsNot Nothing) Then
        Do While (EleEnum.MoveNext)
            oText = EleEnum.Current
            oText.Text = "New Text"
            oText.Rewrite()
        Loop
    End If
    ' oTextNode.Rewrite() ' **** This prevents the sub text elements from being changed !?
End If


Viewing all articles
Browse latest Browse all 105279

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>