Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

how to change a node during runtime?

$
0
0

 Hi, i am a XML beginner and would like to change the node <Tabelle1> during runtime

if a variable has a specific value, then it should be <Tabelle1>

if a variable has a another specific value, then it should be <Tabelle2>

thanks for helping out.

Code like this:

        Dim filename = "C:\CG_Sports\Fussball\tabellen.xml"
        Dim welchetabelle As String
           Try
            Dim Contactlist As XDocument = XDocument.Load(filename)
            For Each contact As XElement In Contactlist...<Tabelle1>
                titel_text.Text = contact.Element("titel")
                template_text.Text = contact.Element("templatename")

                For i = 1 To 30
                    Controls.Item("r" & i).Text = contact.Element("col" + Trim(i) + "1")
                    Controls.Item("nr" & i).Text = contact.Element("col" + Trim(i) + "2")
                    Controls.Item("name" & i).Text = contact.Element("col" + Trim(i) + "3")
                    Controls.Item("vorname" & i).Text = contact.Element("col" + Trim(i) + "4")
                    Controls.Item("pos" & i).Text = contact.Element("col" + Trim(i) + "5")
                    Controls.Item("d" & i).Text = contact.Element("col" + Trim(i) + "6")
                    Controls.Item("dd" & i).Text = contact.Element("col" + Trim(i) + "7")
                    Controls.Item("ddd" & i).Text = contact.Element("col" + Trim(i) + "8")
                Next
                For i = 1 To 8
                    Controls.Item("feld" & i).Text = contact.Element("feld" + Trim(i))
                Next
            Next
        Catch ex As System.IO.IOException
            MessageBox.Show("File nicht vorhanden")
        Catch ex As NullReferenceException
            MessageBox.Show("NullReferenceException: " & ex.Message)
            MessageBox.Show("Stack Trace: " & vbCrLf & ex.StackTrace)
        Catch ex As Exception
        End Try


Viewing all articles
Browse latest Browse all 935

Trending Articles



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