| | |
How to Read XML file and to add some information into it
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2008
Posts: 12
Reputation:
Solved Threads: 0
Hi,
I have a problem.
I need to read some data from a text file and need to put it into XML file using VB6.
I have the follwoing input from the text file:
Suite id="ADD"
description="Add Validation Suite"
TestCase id="ATC_V_Add001"
and so on..........
and I want the following format in XML file. I have to update the XML file with the following info:
<?xml-stylesheet type="text/xsl" href="TestSuite.xsl"?>
<LLD>
<Cycle>
<Suite id="ADD" description="Add Validation Suite">
<TestCase id="ATC_V_Add001" description="Verify the Rulecode ADD001 with Address Overlap in the same Zone or City exception">
<LinkPVID>54221487</LinkPVID>
<Results>Exception ADD001 is generated see details in Exception info section</Results>
<StepTable id="StartUpApplication" description="To launch the application" />
</TestCase>
</Suite>
</Cycle>
</LLD>
I have a problem.
I need to read some data from a text file and need to put it into XML file using VB6.
I have the follwoing input from the text file:
Suite id="ADD"
description="Add Validation Suite"
TestCase id="ATC_V_Add001"
and so on..........
and I want the following format in XML file. I have to update the XML file with the following info:
<?xml-stylesheet type="text/xsl" href="TestSuite.xsl"?>
<LLD>
<Cycle>
<Suite id="ADD" description="Add Validation Suite">
<TestCase id="ATC_V_Add001" description="Verify the Rulecode ADD001 with Address Overlap in the same Zone or City exception">
<LinkPVID>54221487</LinkPVID>
<Results>Exception ADD001 is generated see details in Exception info section</Results>
<StepTable id="StartUpApplication" description="To launch the application" />
</TestCase>
</Suite>
</Cycle>
</LLD>
Hi,
You can use Microsoft XML, Version 2.0 or any to parse XML FIles.
Include Microsoft XML, Version 2.0 or any Type Library in to your project
> Project > Reference > Microsoft XML, Version 2.0 or any version
This below link will help u
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
You can use Microsoft XML, Version 2.0 or any to parse XML FIles.
Include Microsoft XML, Version 2.0 or any Type Library in to your project
> Project > Reference > Microsoft XML, Version 2.0 or any version
This below link will help u
http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx
KSG
This Code select the ID Node. Save your xml in C:\Test.xml or Change the Name in Load () function.
I am not correct exactly. but it will do.
I am not correct exactly. but it will do.
vb Syntax (Toggle Plain Text)
Dim xDOM As DOMDocument Set xDOM = New DOMDocument Dim xRoot As IXMLDOMElement Dim xNodeList As IXMLDOMNodeList Dim xNM As IXMLDOMNamedNodeMap Dim xID As IXMLDOMNode xDOM.Load "c:\test.xml" ' Or your File Name Set xRoot = xDOM.documentElement Set xNodeList = xRoot.getElementsByTagName("Suite") If (Not xNodeList Is Nothing) Then Set xNM = xNodeList(0).Attributes Set xID = xNM.getNamedItem("id") MsgBox iM.Text End If
Last edited by selvaganapathy; Jul 7th, 2008 at 11:47 pm.
KSG
![]() |
Similar Threads
- Updated : Simple ASP.Net Login Page (ASP.NET)
- explorer.exe uses 99% CPU (Viruses, Spyware and other Nasties)
- Password Storage System. (Python)
- Storing Views and File information (ASP.NET)
- Programming FAQ - Updated 1/March/2005 (Computer Science)
- PHP and XML/XSL (PHP)
- How to re-organized XML file and call XML file from my software (RSS, Web Services and SOAP)
- Computer keeps restarting! (Viruses, Spyware and other Nasties)
- How to make Java and C++ sockets play nice (Java)
- Linux Audio Streaming (live!) using Ices and Icecast (*nix Software)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Encoding and decoding with Magnetic Card Writer / Reader
- Next Thread: code for search engine ASP.NET
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





