Duplicated ID elements from Author mode element split

Having trouble installing Oxygen? Got a bug to report? Post it all here.
jelovirt
Posts: 84
Joined: Tue Oct 11, 2005 9:17 am
Location: Helsinki, Finland
Contact:

Duplicated ID elements from Author mode element split

Post by jelovirt »

Oxygen version: 10.0

Steps to reproduce:
  1. Create new Docbook article
  2. In Text mode, add id attribute to para element.
  3. Switch to Author mode.
  4. Split para element by pressing Enter key.
  5. Switch back to Text mode.
  6. Both para elements have the same id attribute.
While it's expected behaviour that e.g. lang attributes are copied when splitting the element, attributes that are type ID should not be. In Docbook the id attribute is type ID, but in DITA id attribute in p element is NMTOKEN. Still it would be convenient if in DITA the id attribute wasn't copied either.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Duplicated ID elements from Author mode element split

Post by george »

Hi Jarno,

I understand the issue and I just encountered a few days ago. There are two scenarios:

1 - you want an ID on the new element
2 - you do not want an ID on the new element

In the first case it helps to have the ID duplicated as in general the new value will be similar with the old value and it is easier to change an existing value than to enter it from scratch.

In the second case the fact that the ID is copied will require the user to edit the attributes to remove the ID attribute. The problem is signaled by the automatic validation that will indicate the invalid ID value. In the case when the ID attribute is not defined to be of type ID then this can be indeed a problem because the error is not signaled by the validation.

Analyzing the above I would say that the current behavior is not that bad.

Now, taking into account the DITA case, where you have IDs specified as NMTOKEN I would say that the main problem is not with the ID values defined as ID - as these are signaled by the automatic validation - but with other type of values.
Therefore as a solution I propose enhancing the framework (document type) support with the possibility to specify a SplitHandler that will receive each attribute name and value and can return null to remove it or the same or modified name/value. This allows also implementing for example a SplitHandler that will create automatically a new ID similar with the one from the element to be split. So, what do you think about this possible solution?

Regards,
George
George Cristian Bina
jelovirt
Posts: 84
Joined: Tue Oct 11, 2005 9:17 am
Location: Helsinki, Finland
Contact:

Re: Duplicated ID elements from Author mode element split

Post by jelovirt »

Sounds like a solution that might work. I tested this with DITA paragraphs with conref attribute and that's another case where the attribute probably not be copied on split.
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Duplicated ID elements from Author mode element split

Post by Radu »

Hi Jarno,

We added some handlers for the split and for frameworks like DITA, Docbook 4 and 5, TEI P4 and P5, XHTML id's are no longer copied on split.
In addition for DITA the "conref" will be no longer copied on split.

The changes will probably be available in Oxygen 10.3. If you want a beta kit to test for this and for http://www.oxygenxml.com/forum/viewtopi ... 053#p12053 you can contact us and we'll provide a beta.
See http://www.oxygenxml.com/techSupport.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply