Com\’è dura la professione!

4 marzo 2016

Siblings, Parents and Other Relationships in XML with QXmlEdit

Filed under: Open Source,qxmledit,xml — lbell @ 21:06
Tags:

Navigate in a sea of siblings in an XML hierarchy can be problematic like the navigation in a true sea when the cardinality of the data is high. And yet, the XML can contain hand craft made test data to be validated or coming from an external source outside of our control.

Examine an element not conforming to a given XML Schema to understand the source of problems requires a lot of patience with complex data. QXmlEdit provides some tools to ease the task, customizing the data view and provides some facilities for the editing.

uno

Starting data

Visualization

Concentrating on some elements in a sequence, bookmarks are the first help to move quickly between different parts of data.

Each child element can show its index with respect to the parent using the menu “View>Show Child Index”.

The tree representation of the selection and all its siblings can be closed using the menu “View>Siblings>Close This and All Siblings”; the item “Close Siblings” of the same “View” menu can close all the siblings of the selection.

To reduce the visual clutter the siblings of the selection can be hidden.

The attributes can be sorted in alphabetical in the view order without modifying the position in the real data.

tre

Hiding siblings

Editing

The operations triggered in visualization can be made permanent with the commands of the menu XML.

In the “Siblings” menu there are commands to delete the siblings of an element, all the following, the previous ones, or simply all.

An element can be cloned, optionally adding an index using an attribute, to create quickly a feature that can differentiate a set of siblings.

With the hierarchy operations, the children of the selection can be moved or grouped, moving all the existing children to a new child.

Parents can be created or removed, isolating an element or promoting it to the previous level.

The sorting of attributes, available in the presentation layer, can be made permanent.

quattro

Siblings

In the End…

QXmlEdit can ease the task of manipulating complex XML files, while retaining the hierarchical structure of the data.

Get QXmlEdit at http://qxmledit.org, or go to the download folder at sourceforge.net.

Crea un sito o un blog gratuito su WordPress.com.