SunQuest
           XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old November 5th, 2003, 03:10 PM
FragMaster B's Avatar
FragMaster B FragMaster B is offline
NINJA! ...on fire no less
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Rockies
Posts: 188 FragMaster B User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 13 m 12 sec
Reputation Power: 5
Question Compare 2 XML docs

I'm building an HTA app that uses XML.

On open of a "project" from my HTA, the program reads in an XML doc to a JavaScript DOM object. I then allow the user to change settings within said DOM. The user can then save thier work via a standard File-Save command that instatiates a xmlDoc.save("{filepath}") call.

What I'd like to do is disable the the Save command when no settings have changed. One way I've thought I might be able to do this is to make a clone of the DOM and then compare DOM 1 to DOM 2 to see if they are different. If they are different, the user will be allowed to save. If they are not different, save is disabled.

So, is there a way to compare 2 XML DOM objects? Or another way to accomplish what I'm trying to do?

{Hope all that jiberish made sense...}

Reply With Quote
  #2  
Old November 5th, 2003, 04:30 PM
FragMaster B's Avatar
FragMaster B FragMaster B is offline
NINJA! ...on fire no less
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Rockies
Posts: 188 FragMaster B User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 13 m 12 sec
Reputation Power: 5
Too simple...

Code:
xmlDoc.load(ProjectDir + "\\sim.xml")
xmlDoc2.load(ProjectDir + "\\sim.xml")

...later...

if (xmlDoc.xml==xmlDoc2.xml){
  //No changes to xmlDoc have been made.
}
else{
  //Changes to xmlDoc HAVE been made.
}


Please share if you have a better way to accomplish this. For now tho, this is working.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Compare 2 XML docs


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway