Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
Option Explicit Import org#w3c#dom Import javax#xml#parsers Dim myXMLFileName As String = "C:\MyXMLFile.xml" Dim myXMLDocument As org#w3c#dom#Document Public Sub Form_Load() Text1.MultiLine = True Text1.HScrollBar = sbShowAsNeeded Text1.VScrollBar = sbShowAsNeeded End Sub Public Sub Command1_Click() If myXMLDocument = Nothing Then myXMLDocument = GetXmlFile(myXMLFileName) End If Dim aNode As org#w3c#dom#Node aNode = myXMLDocument.getFirstChild Text1.Text = aNode.getTextContent End Sub Function GetXmlFile(FileName As String) As org#w3c#dom#Document GetXmlFile = javax#xml#parsers#DocumentBuilderFactory. _ newInstance.newDocumentBuilder.parse(New java#io#File(FileName)) End Function |
This post has been edited 3 times, last edit by "OlimilO" (Feb 7th 2010, 5:20pm)