|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
||||
|
||||
|
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...} |
|
#2
|
||||
|
||||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Compare 2 XML docs |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|