Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27501

If Else to remove comments and add node id

$
0
0
The below code works and is used to display the Node address of a xml file to a treeview, but it will also pick up all comments within the xml because they also begin with <!-- and end with --> and also the xml header is seen <?xml version="1.0" encoding="utf8"?> is there any way i can avoid this ?

Also i would like to add the nodes "id" if it contains one to the treeview, is this posible

<Section6 Name="Not Used" id ="0,0006" Label="Full Description">
Code:

    Private Function FormatName(ByVal node As XmlNode) As String
        Dim fullName As String = "<" & node.Name

        If node.InnerText < "" Then
            fullName += ">" & node.InnerText & "</" & node.Name & ">"
        Else
            fullName += ">"
        End If

        Return fullName
    End Function


Viewing all articles
Browse latest Browse all 27501

Trending Articles



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