Click here to Skip to main content
16,007,885 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: XML file data extraction Pin
Tom Deketelaere16-Oct-09 2:35
professionalTom Deketelaere16-Oct-09 2:35 
GeneralRe: XML file data extraction Pin
nhsal6916-Oct-09 2:51
nhsal6916-Oct-09 2:51 
GeneralRe: XML file data extraction Pin
Tom Deketelaere16-Oct-09 3:20
professionalTom Deketelaere16-Oct-09 3:20 
GeneralRe: XML file data extraction Pin
nhsal6916-Oct-09 4:28
nhsal6916-Oct-09 4:28 
GeneralRe: XML file data extraction Pin
Tom Deketelaere16-Oct-09 4:34
professionalTom Deketelaere16-Oct-09 4:34 
GeneralRe: XML file data extraction Pin
nhsal6916-Oct-09 5:48
nhsal6916-Oct-09 5:48 
GeneralRe: XML file data extraction Pin
nhsal6919-Oct-09 5:02
nhsal6919-Oct-09 5:02 
GeneralRe: XML file data extraction Pin
nhsal6921-Oct-09 4:40
nhsal6921-Oct-09 4:40 
Well I got stuck on the recursion so got a script to tidy up the XML file so that it is reasonably well formed..

But now I have an issue getting one element out,

<sizedata Size= "VALUE" IGNORE THE REST OF THEM/>

here is a fully formed, but shortened XML file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Root Type="TRoot">
<Date>15/10/2009 12:30:08</Date>
<Folder fullpath="C:\" IsFilesNode="0">
<Name>C:\</Name>
<SizeData Size="74609238013" Allocated="72396726232" Wasted="234062016" CDRom="74727184384" Files="116733" Folders="12272" Compression="3"/>
</Folder>
<Folder fullpath="C:\" IsFilesNode="-1">
<Name>[Files]</Name>
<SizeData Size="18745407271" Allocated="18745561088" Wasted="153817" CDRom="18745475072" Files="69" Folders="0" Compression="1"/>
</Folder>
<Folder fullpath="C:\TEMP_\" IsFilesNode="0">
<Name>TEMP_ALAN</Name>
<SizeData Size="15469174140" Allocated="15489126222" Wasted="19886724" CDRom="15478267904" Files="9570" Folders="1832" Compression="1"/>
</Folder>
<Folder fullpath="C:\TEMP_\mp3\" IsFilesNode="0">
<Name>mp3</Name>
<SizeData Size="11504514137" Allocated="11513361814" Wasted="8829863" CDRom="11508457472" Files="4561" Folders="510" Compression="1"/>
</Folder>
</root>

The code I have is below:

<pre>Try

                  Dim odoc As New System.Xml.XmlDocument
                  odoc.Load("C:\test\test.xml")
                  Dim oXmlLog As System.Xml.XmlElement
                  Dim text As String = ""
                  For Each oXmlLog In odoc.SelectNodes("Root")
                        Dim node As System.Xml.XmlElement
                        For Each node In oXmlLog.SelectNodes("Folder")
                              Dim fullpath As String = node.Attributes.GetNamedItem("fullpath").Value
                              Dim SizeData As String = node.Attributes.GetNamedItem("SizeData").Value
                              Dim subnode = node.SelectSingleNode("Name")
                              Dim name As String = subnode.InnerText


                              Dim Date_ As XmlElement = odoc.DocumentElement
                              Dim Date_time As XmlNodeList = Date_.ChildNodes
                              Dim Date__time = (Date_time(0).InnerText)



                              text &= Date__time & "      " & fullpath & "         " & name & SizeData & Environment.NewLine
                        Next
                  Next

                  Console.Write(text)
                  Console.Read()
            Catch ex As Exception
                  Console.Write(ex.ToString())
                  Console.Read()
            End Try</pre>


But I can't get the SIZE from SIZEDATA out and into a variable, can you help???
QuestionVBA: Microsoft Office Outlook: Find duplicate messages Pin
Jwalant Natvarlal Soneji14-Oct-09 19:54
Jwalant Natvarlal Soneji14-Oct-09 19:54 
AnswerRe: VBA: Microsoft Office Outlook: Find duplicate messages Pin
Dave Kreskowiak15-Oct-09 3:55
mveDave Kreskowiak15-Oct-09 3:55 
QuestionRe: VBA: Microsoft Office Outlook: Find duplicate messages Pin
Jwalant Natvarlal Soneji15-Oct-09 7:36
Jwalant Natvarlal Soneji15-Oct-09 7:36 
AnswerRe: VBA: Microsoft Office Outlook: Find duplicate messages Pin
Dave Kreskowiak15-Oct-09 8:01
mveDave Kreskowiak15-Oct-09 8:01 
GeneralRe: VBA: Microsoft Office Outlook: Find duplicate messages Pin
Jwalant Natvarlal Soneji15-Oct-09 8:40
Jwalant Natvarlal Soneji15-Oct-09 8:40 
QuestionHow to disconnect my account from mysql server? Pin
josinvill@yahoo.com14-Oct-09 19:14
josinvill@yahoo.com14-Oct-09 19:14 
AnswerRe: How to disconnect my account from mysql server? Pin
Dave Kreskowiak15-Oct-09 3:53
mveDave Kreskowiak15-Oct-09 3:53 
QuestionForce the user change the password on first login? Pin
waner michaud14-Oct-09 11:40
waner michaud14-Oct-09 11:40 
AnswerRe: Force the user change the password on first login? Pin
_Damian S_14-Oct-09 15:46
professional_Damian S_14-Oct-09 15:46 
AnswerRe: Force the user change the password on first login? Pin
Dave Kreskowiak14-Oct-09 16:26
mveDave Kreskowiak14-Oct-09 16:26 
GeneralRe: Force the user change the password on first login? Pin
Ashfield15-Oct-09 1:38
Ashfield15-Oct-09 1:38 
GeneralRe: Force the user change the password on first login? Pin
Dave Kreskowiak15-Oct-09 4:19
mveDave Kreskowiak15-Oct-09 4:19 
QuestionWhat's wrong with my event handler? Pin
Sonhospa14-Oct-09 11:01
Sonhospa14-Oct-09 11:01 
AnswerRe: What's wrong with my event handler? Pin
Ian Shlasko14-Oct-09 11:22
Ian Shlasko14-Oct-09 11:22 
GeneralRe: What's wrong with my event handler? Pin
Sonhospa15-Oct-09 0:26
Sonhospa15-Oct-09 0:26 
AnswerRe: What's wrong with my event handler? Pin
Luc Pattyn14-Oct-09 11:28
sitebuilderLuc Pattyn14-Oct-09 11:28 
GeneralRe: What's wrong with my event handler? Pin
Sonhospa15-Oct-09 0:38
Sonhospa15-Oct-09 0:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.