Thanks, Hussein.

It looks like DocumentUtil.pendingChanges(doc) will tell XXE that a file
is dirty (even if it is not). Is that right? But I'm still hoping for a
way to tell XXE that a file is not dirty (even if it is). 

In addition to my need for it regarding an unset/reset conref, this type
of command is handy for enforcing standards "silently" on new files; for
example, entering the user's name as author when a new file is opened.
In this case, the dirtying of the file can confuse the writer if they
decide they don't want to keep it. (They wonder why they're being
prompted to save their changes when they haven't made any.)



-----Original Message-----
From: Hussein Shafie [mailto:[email protected]] 
Sent: Friday, August 11, 2006 3:59 AM
To: Mark Fletcher
Cc: xmleditor-support at xmlmind.com
Subject: Re: [XXE] Unsetting conref dirties file unnecessarily(?)

Mark Fletcher wrote:
> When you use dita.setConref [unset], the source file is marked as 
> changed. However, if you save as a new file and compare to the 
> original, they're identical. Is there a good reason why XXE dirties 
> the file when a conref is unset?

No. Once again, this is lack of polishing. We didn't think
"dita.setConref [unset]" was truly useful.



> If not, can this be fixed?

I'm affraid this one is hard to fix.



> Actually, this won't entirely solve my problem, because when I reset 
> the conref (using my unsetOrResetConref command, which calls 
> dita.setConref [clipboard]), this will also dirty the file. Perhaps 
> there's a way to make the transclude/untransclude process smarter in 
> general, as far as knowing whether the conref attribute has actually
changed?
>  
> On a related topic, I haven't found a command that would let me 
> instruct XXE whether a file is dirty or not. Is there one?

No.



> If not, it would be very handy to have one.

Why? XXE is supposed to always properly detect when the document being
edited has been modified. It even does so when this is not the case ;-)



---
PS: The command you want is very simple to write. Simply invoke:
---
DocumentUtil.pendingChanges(doc);
---
See
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/ed
it/DocumentUtil.html#pendingChanges(com.xmlmind.xmledit.doc.Document)




Reply via email to