Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Comparing a XML file to see if it has any nodes???

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,55928
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Comparing a XML file to see if it has any nodes???
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Comparing a XML file to see if it has any nodes??? - 1/24/2008 2:54:32 AM   
  dslider

 

Posts: 49
Score: 0
Joined: 1/23/2008
Status: offline
I am trying to set up a check to see if an XML file (which is a config file for a application) is set up yet or not and if not I want to set it up with the default structure and add values to it. The XML file is always there but it may not be setup (but its not completely empty either).

When its not set up the only two lines in the XML file are:

      


When its configured the structure is:

      

Can someone hrlp me get started?  I already wrote the code to add values to the keys I just need to know how to check the XML file to see if it was set up yet or not.. and how to create the structure.
 
 
Post #: 1
 
 RE: Comparing a XML file to see if it has any nodes??? - 1/24/2008 3:03:54 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi dslider,

I'd try to get away with this quick & dirty strategy:

(1) Save your 'configured .xml' as config.default

(2) nEmptySize = size of empty config.xml

(3) If <config.xml>.Size <= nEmptySize Then
        copy config.default => config.xml
        configure config.xml

Good luck!

ehvbs

(in reply to dslider)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Comparing a XML file to see if it has any nodes??? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts