Andy Black wrote:
> A user of the custom configuration I've developed asked if there was a 
> way to automatically change broken links.  In his case, he had about 20 
> elements with an IDREF attribute referring to one element containing an 
> ID.  When he changed the ID of that one element, the IDREF links were 
> broken (of course).  While it is definitely nice that the Validity Tool 
> showed him all 20 places, he still had to go and fix them one-by-one by 
> hand.
> 
> So, we're wondering if there is a way now to have XXE fix such broken 
> links automatically.  If not, would it be possible to make XXE do 
> something like the following?
> 
> Any time an ID attribute gets changed, remember the value before the 
> change.  Based on the DTD/schema, find all elements containing an 
> IDREF/IDREFS attribute whose value was/contains the value before the 
> change.  Then change the value of the IDREF/IDREFS attribute in those 
> elements to the new value.
> 
> Such a capability would make the user's experience with XXE even better 
> than it is now.
> 

Mike Maxwell wrote:
> One complication in this would be multi-part documents, e.g. books
> containing multiple chapters, where the chapters are contained in separate
> files (some of which might be open by other users, and therefore locked to
> edits).  Even finding all the other chapters might be hard, unless the
> system knew where the book-level file was (which would presumably xinclude
> the chapters), so it could find where all the chapters are supposed to be.
> 

Implementing this feature poses no technical problem, but...

[1] The user who is changing the value of an ID attribute would be
prompted for a "fix broken links"[*] at the time she/he changes the
value of the ID attribute. (I fail to see a way to implement the "fix
broken links" command at any other time.)

This is a bit inconsistent with XXE which attempts to be as
non-intrusive as possible.

[2] As Mike Maxwell explains it, such feature does not help in the case
of modular documents.

[3] Changing the value of an ID attribute is not *that* common.

All in all, we are not sure that it's worth implementing what cannot be
a fully satisfactory solution to a very easy to understand problem.



---
[*] A dialog box asking the user "Do you want to fix IDREF/IDREFS
referencing ID 'foo' now?".

---
PS: Programmers IDEs like Eclipse, Netbeans, Visual Studio call this
feature "Refactoring". This feature is not that difficult to implement
in the case of IDEs, because all IDEs support the concept of *projects*.
A project is useful to tie together all the resources needed to create a
deliverable. With the concept of project, XXE would have no difficulty
implementing [2].

However, for the sake of simplicity, we have chosen not to go the IDE
way, and therefore not to support projects.




 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to