Com\’è dura la professione!

8 maggio 2017

SCXML support in QXmlEdit

Filed under: Open Source,qxmledit,SCXML,xml — lbell @ 16:19
Tags: ,

SCXML is a W3C standard to describe a state machine and its behavior upon events reception; it is expressed in XML format with bindings with data and scripting code.

QXmlEdit offers support to SCXML with specialized editing dialog and validations.

A special edit mode can be enabled automatically when loading a SCXML file, or manually using a menu item. When loading an XML file, if the format can be guessed as SCXML, QXmlEdit automatically asks if the edit mode can be enabled. Using the preferences panel, the option can be automatically enabled (or disabled) for all the SCXML files.

SCXML Activation

SCXML edit mode activation

The special edit mode sports a context sensible editing, specialized forms and a state navigator that shows the data in hierarchical or flat form.

Each edit form has specific validations for states and identifiers.

There is also a validation of the whole file done using Qt API with a limitation: the only scripting languages supported by Qt are accepted by the validator, currently ECMAScript (aka JavaScript) and C++.

In the normal edit mode it is always possible to invoke an ‘Insert Specialized Element’ for SCXLM, using the keyboard or the menu, enabling the same validations of the extended edit mode.

SCXML Navigator

Navigation of states in SCXML

Some links to resources:

SCXML specifications:

More info on QXmlEdit and in depth tutorial of using SCXML edit mode in QXmlEdit can be found at


4 marzo 2016

Siblings, Parents and Other Relationships in XML with QXmlEdit

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

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.


Starting data


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.


Hiding siblings


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.



In the End…

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

Get QXmlEdit at, or go to the download folder at

6 dicembre 2015

Replicating XML Elements

Filed under: Open Source,QT,qxmledit,xml — lbell @ 18:06

It is possible cloning or assigning unique indexes to elements in QXmlEdit 0.9.2 using two new menu items:
Tools > Fill Serie and Tools > Clone.

Applying an index is possible using Fill Serie. An attribute will be used on the siblings of the selected element. The value of the index can be a padded or unpadded number or alpha sequence giving birth to series like “AA”, “AB”, … or “A”, “B”, … and so on.
There are options to skip or replace existing values in the elements as well to merge the values. A non existing attribute can also be created.
The index can be applied recursively to the children of the selected element.

fill options

Cloning elements is a matter to select a sample element and apply the clone command. Only elements can be cloned unless they are the root of the XML. The cloning can be deep, that is applied recursively to the children too or only to the selected element.
An index can be applied in the process. QXmlEdit suggest you to use it if the option has not been selected.

clone options

The final result is shown in the next image.


cloning results

5 gennaio 2015

Anonymizing data with QXmlEdit

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

QXmlEdit 0.8.13 sports a feature to anonymize data inside a XML file.
The menu Tools > Anonymize recalls a dialog to anonymize the data contained in attributes and text of the XML.
This feature can be useful if the XML file should be sent to technical staff for debugging purposes avoiding the disclosure of personal information.
Using this feature the text and the attributes can be altered using a fixed character or using a different letter for each input character by preserving the case of the original letters.
The original data structure is preserved replacing only letters and digits with altered text, preserving the case of the letters and the reserved XML attributes. The tags and attribute names are not changed.
Data and business rules
Often not all the input files contain personal information, but also data for business rules. Modifying all the contained text or attributes will end in a useless file transporting no information at all.
To avoid that result, manipulating the parameters that belong to the business rules, two features can be used:

  • A filter to avoid the anonymization of values consisting of less than 4 characters (the length of many codes).
  • The use of exceptions.

The exceptions can be bound to any element, attribute or text node and force the subject to be anonymized or not; if anonymized, a user defined value can be used to replace the original one.
The exceptions can be hierarchical and extended to the children of the subject. It is possible to isolate data from business rules from personal data. When applying more expressions, the more specific wins; for example if an element has been forced to be anonymized with children, and one of its children has another exception of reverse meaning, the child exception is applied.
Note: at the moment namespaces are not processed in the exception path
Each time an exception is modified, the anonymization operation results are shown in a preview pane. The original values can be seen in the tooltips of the elements of the preview.


Since creating rules and exceptions is a time expensive process, it is possible to save them using a profile and recall them later in other anonymization processes.


The options are:

  • All text: all the text will be changed.
  • Text with more than 3 letters or digit: only the text that is composed by more than 3 letters or digits will be changed. This to skip codes that usually have a limited length.

The check box “fixed pattern” determines how the text is transformed.

  • If checked: letters are replaced by ‘x’ and numbers by ‘1’.
  • If unchecked: the letters and the numbers are replaced by a succession of letters or numbers in alphabetical order.

The exceptions can be entered selecting the element and using the contextual menu.


Information in the panel:

  • Profile Name: name of the profile (read only
  • Options: options to anonymize data:
    • anonymize all the text
    • anonymize only the text with more than 3 letters or numbers
  • Preview: it shows the final result of the operation on the current data.
  • Add Exception: exceptions can be added when an element is selected in the preview.
  • Exceptions: the list of the exceptions.
  • Save Profile: saves the current profile data. If the profile has not been created, a creation panel will appear.
  • Edit Profile: edits the profile data.
  • Profiles: manages the profiles.

To insert an exception:

  1. Select an element in the preview pane
  2. Use one of the buttons in the “Add exception” row

To remove an exception:

  1. Select an exception in the exception list.
  2. Press “Delete” in the exception group.

To save the exception list in a profile:

  • Press “Save profile”

If the profile has not be created, a profile creation panel will appear.
To mange profiles:

  • Press “Profiles…”

A list of profiles, grouped by tags will appear. Selecting a profile and exiting with “Ok” will load the profile in the caller dialog. It is possible also creating and deleting profiles.


5 aprile 2013

Springs and forces in QXmlEdit 0.8.5

Filed under: Open Source,QT,qxmledit,xml — lbell @ 20:45
Tags: , ,

A force directed layout graph ( is is well suited for hierarchical structures or directed graph, perfect to visualize the relationships existent between the elements of a XML structure.

QXmlEdit 0.8.5 lets you view the content of the current data or another file of your choice creating a graphic scene of the current screen dimensions, inserts the graphical representation of the elements in random positions inside it. The nodes migrate into an equilibrium configuration automatically under the application of a force similar to the binding of the electric particles, to reach an optimal distribution in the general case. A damping factor is applied to avoid a long stabilization time of the configuration.

The panel can be reached with one of these methods depending on the data to show:

  • The current file open in the editor

Edit a file and select the menu item “Relations” from the “View” menu.

  • A file on the file system

Choose the “Relations…” item from the”Tools” menu and use the browse button to load a file or drop in a file.

  • The map panel

From the Tools menu, choose the View Map item, before loading any file, check the the “Analyze relations” option; after loading the file, operate the “View Relations…” button.

When the panel is open it is possible to

  • View the structure

The panel shows the relations between elements. Each circle represent an XML element. The lines show a relationship between element types. To evenly distribute the elements on the view area, each element is repelling the others, the nodes are connected by simulated springs.


  • Move the items

The elements can be dragged with the mouse causing the movement of the other elements until reaching a new equilibrium point. Zoom controls can modify the view.

Each time the “Reset” button is pressed, a new initial casual combination is generated and the elements move themselves to reach a new equilibrium point.


  • Isolate a single element

Checking the “Center Selected” option, hides all the elements that are not diretcly connected with the selected one. By clicking on one node, you can filter the display of nodes showing only the data related to the selected element.


The data can be shown also in tabluar format

Each element on the rows show its absolute and relative count and the references made to any other element.


The settings can be tuned.

 The intensity of the replusive force can be changed using the “Force” slider. The effective distance that the force can act can be set using the “Radius” slider. The lenght of the lines connecting elements can be regulated using the “Spring” slider.

31 agosto 2012

Visual comparison between XML Schema files in QXmlEdit

Filed under: Open Source,QT,qxmledit,xml,xsd — lbell @ 21:31
Tags: , , ,

Visualizing a comparison between files is first of all a semantic operation. The comparison of source code of programs usually is done at level of source lines, and the level of concepts, classes and methods in this case, is entirely left to the user. There is no doubt that any line of source code is important, but while in the programming world the abstraction level is always raising, using protocols, interfaces and as last resource, languages better suited for the job, the comparison of variations of different versions is always done at character level.

The comparison of XML files is similar to a source code comparison, given that the information carried by a file are not related to the XML syntax, but to the meaning associated with the particular XML structure.

XML Schema files can be compared at XML elements level, the analogue of the source code comparison, but understanding the difference of the information carried by of the different XSD files is not easy.

The future 8.3 QXmlEdit, now on development trunk, follows another approach, transforming the data into concepts, element, types, and so on, then comparing the concepts. Given that the XML Schema follows a strictly hierarchical model, the reference and the target schema are scanned in parallel for inner contents. Where an element in the reference schema has an equivalent on the target schema, is compared for equality on the basis of the element type and name. If the two values are equals, the element are posed in correlation and any other difference ends in modified items. The comparison continue recursively.

The schema is then presented, using colors that show at a glance only the reference schema, highlighting the changes, showing the information in their context. The key is shift the focus from the comparison as operation, to the variation of the information in the schema context.


19 marzo 2012

Visualizing XML trees with QXmlEdit

Filed under: qxmledit,xml — lbell @ 22:36

Why to view XML using letters only?

Exploring big XML files trying to understand how the data are distributed in the file is difficult when the size of the files is relevant respect to the available memory.

Basically there are three points that are interesting in dimensions and distribution:

  • Data size.
  • Number of children.
  • Tree deep.

Given that the XML structure is a hierarchical one, in principle there is no difference between visualization and exploration of a XML structure and exploration of datasets used in other fields from the physics to the biology; there are already a lot of well known methods to handle this type of data, from data handling to image processing.

What is missing in a typical XML editor are visualization modes to give an idea of how the data are distributed at a bird’s eye view. The textual or tree map representation are often or too detailed, or not detailed enough.
QXmlEdit under development will show the data graphically giving the possibility to the user to use its eyes to evaluate the data, losing the details in a zoom out or delving deeper to investigate data structure.

To form the map the following data transformations are done:

The tree is converted in a grid, de-normalizing it.

Let’s suppose to have these start data, the following transformation is applied.

After that, the rows with the same logical data can be regrouped as in a tree map. The color of each cell can be the value of the observed quantity.

The map can be zoomed and navigated, selecting an area or descending in hierarchical mode.

23 ottobre 2011

QXmlEdit 0.5.3 released

Filed under: Open Source,QT,qxmledit,xml — lbell @ 15:14

QXmlEdit, a simple XML editor, is born to explore Qt libraries and then gradually added features becoming a sort of swiss army knife.

In its latest release, 0.5.3, there is a tool to split XML files of any size in smaller fragments. It is also possible to examine a fragment at time in the user interface, without loading it completely in memory.

You can download QXmlEdit at the following link:

This little tutorial, extracted from the manual, shows how to use the file splitter in details:

When starting, the program will open a welcome dialog leading to the most common operations. Choose “Split a file”. If you choose to hide the dialog next time the program restart and change your mind, you can reactivate it in the configuration panel. You can access this feature also from the menu Tools.


4 settembre 2011

QXmlEdit gains a brand new navigator

Filed under: Open Source,QT,qxmledit,Uncategorized,xml — lbell @ 19:52

The 0.5.1 release of QXmlEdit brings a XSD types navigator. An index panel with the recap of types and root elements and attributes and navigation items is a great helper when browsing complex schema.

The navigation is possible in two ways:

  • Double clicking an item on the types list centers the relative item in the graphics view.

  • Selecting an item with a reference to a type in the graphics view and using the context menu.

While jumping from a type to another one, the previous item is remembered and it possible to return to it as is usual with Internet browsers.

A bonus of the navigator is the possibility to export the graphical view in SVG or PDF format.

The types and elements can be searched and the navigation panel can be hidden to leave all the available space to the schema representation.

The navigator is now accessible directly from the main window if the content declares itself as a XML Schema type file.

XSD viewer screenshot

25 luglio 2011

QXmlEdit 0.5.0: YAXV (Yet Another XSD Viewer)

Filed under: Open Source,QT,qxmledit,xml — lbell @ 20:24

If it is true that a complex idea can be examined under different prospectives, then a XML Schema viewer can be useful. XML Schema concepts can be modeled with a plain text editor, but QXmlEdit in the 0.5 version can help with a new graphical plugin.

What’s really difficult in such a program is to establish a mapping between the images that the program provides and the concepts that the user has in mind when interacting with them. This mapping is even more difficult if the viewer will be transformed in an editor in some future.

The program needs a cut, it is important to determine which are the main concepts to show and what needs to be removed from the scene. If all the objects defined by the language have the same importance, the scene will be filled with a lot of informations, hiding the basic concepts that the user is trying to model, making the visual editor almost useless compared to a text-based editor.

To achieve this goal, some information, especially those relating to the elements and the types must be automatically and silently changed as the user decides to change the relationship graphically.

A small change in terms of visual representation, such as adding an attribute to an element, has great implications in terms of XSD syntax. When the user decides that an element can have an attribute, the semantic change is very small, but for the scheme it may involve the transformation of a simple type in a complex one.

To access the XSD Viewer in QXmlEdit, load a XSD Schema file in the editor, then use the Tools > Plugins > XSD Viewer menu.

Pagina successiva »

Crea un sito o un blog gratuitamente presso