Sorting of elements in the 'Element' view

Are you missing a feature? Request its implementation here.
csalsa
Posts: 97
Joined: Tue Apr 22, 2008 9:31 am

Sorting of elements in the 'Element' view

Post by csalsa »

I am working with XML files that have an assigned XML Schema. The current version of Oxygen 10.3 uses the XML Schema information and the position of the cursor in the XML file to sort and group the elements in the 'Elements' view. Elements that cannot be placed at the cursor are placed in a second group and greyed-out.

A feature that I would like to see is a two-axis sort driven by two buttons on a new toolbar (similar as in the 'Outline' view) for elements in the 'Element' view.

One button changes between 'natural' order (or the order specified by the sequence in the XML schema) and the 'alphabetical' order (that we currently have).

The second button toggles between one group containing both the valid and invalid (greyed-out) elements and two groups with only the valid in the first group and invalid elements in the second group (which we have now).
Whether in one group or two groups, the elements are sorted as 'natural' or 'alphabetical'.

If I have selected an element, then toggling between the groups and sorts keeps the selected element in within the visible part of the view. The selected element is not deselected for sorting/grouping.

I would find this very useful for building XML samples from XML schemas where the XML schema(s) have large numbers (hundred or more) of elements in different sequences. With this feature, I can sort 'alphabetical' to find an element that I know exists, and then quickly toggle the sort order back to 'natural' order to see where it located in the XML schema sequence.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Sorting of elements in the 'Element' view

Post by sorin_ristache »

Hello,

The elements are displayed in the Elements view in two groups:

- first the element names that can be inserted at the cursor location (enabled in the list, presented with normal font) and keep the XML document valid,

- and second the element names that are included in the content model of the parent element but cannot be inserted at the exact current location (disabled in the list, presented with greyed out font), that is the element names that can be inserted in the parent element of the current cursor location but not at the current location, for example because such an element name was already inserted and only one such element is allowed by the content model or because the order of the xs:sequence of the parent element does not allow it at the current cursor location.

The element names are sorted alphabetically in both the first group and the second one. So both the 'natural' order and the 'alphabetical' one that you requested are already implemented but are not modifiable. I think that is for good reason: if a toolbar button would allow merging the two groups and present all element names as enabled (normal font) then double clicking on one of the element names from the old 'disabled' (greyed out) group creates an invalid XML document which we want to disallow by greying out such elements.


Regards,
Sorin
Post Reply