xmlTreeNav aims at providing easy navigation in XML files.
- tree navigation
- diff XML files
- customization of the display with XSLT files (you can customize what appears on a tree line : add a label, convert ids...)
- XSLT HTML visualization (you can automatically apply a XSLT and view the result in xmlTreeNav ; if you copy/paste XML, it will be transformed)
- support for large XML files
- run both on Windows and Linux
Common use of this software is to :
- Open XML files to navigate easily through the XML tree (useful for large and hierarchical XML trees)
- Diff two XML files and graphically see the result.
- Search XML files with powerful XPath search
It has also powerful display functionnalities as XSL or HTML display that allows to do XSLT transformation on the XML file and display the resulting XML or HTML file, this is very useful to
- Convert the XML file to something readable (HTML) and apply XSLT transformation with a simple drag'n drop ; you could do the exact same thing in a browser but it will need you to modify the XML file beforehand to include the XSLT command
- Convert the XML file to another tree structure which could be more accurate to navigate, with the use of XSLT transformation and the display in xmlTreeNav of the resulting XML file ; you can set up default XSLT visualisations in the setup file
Diff two XML files
Run the application, and select File / Open and Compare menu ; you will see the diff window :
- Before : clic the "..." button to browse and select the file to diff that will be treated as 'before' file
- After : clic the "..." button to browse and select the file to diff that will be treated as 'after' file
- Identifiers : tells the diff algorithm what should be used as identifiers ; it can be attributes (prefixed with @), or nodes values. If no identifier is provided, the order of elements will be used.
- Ignore tags : tells the diff algorithm which nodes or attributes should not be taken in account.
- Add before values : adds in resulting XML file the values that were in the file 'before' with the separator below
- Separator : use this as separator to construct the field : [before value][separator][after value].
- Tag Childs : if set, all the children of an added or removed node will also be marked as added or removed.
Note that the settings are those of libxmldiff, the diff library used underlying ; you may find more detailled instructions in libxmldiff documentation.
Several displays are preconfigured, you can choose the best to fit to your file :
- Standard : will display on the same line the attributes and the value of the node
- Text : will display on the same line the attributes of the node ; but the value of the node will be displayed as a child text element
- All Nodes : will display everything as child nodes (attributes, text,...)
The 'Diff' menu adds two options for xml files resulting of a diff operation :
- Show differences : will interpret the attributes diff:status returned by the diff algorithm as icons ; the legend of icons can be found in 'Help / Diff icon's significations' menu
- Show only differences : will mask nodes that are not modified
You may use advanced display capabilites :
- Open Local XSLT Display... : will perform a XLST transformation on each node before display and display the result. The tranformation must lead to a single root node named 'node', with special attributes are treated to customize the display, as 'icon' attribute to set icon, 'children' attribute for the node selection to be displayed as child nodes ; the value of the node will be used as the label of the tree item. Please have a look at the sample file 'filter-added-removed-or-equal.xsl', and please note that the xml tree passed to the XSL is a subdocument containing only the current node to be displayed and its children.
- Open HTML XSLT Display... : will perform a XLST transformation on the whole document and display the result in an embedded HTML browser.
- You may add custom displays with the help of the config.xml file ; see the config.xml file section.
You can search through the file with XPath langage (only XPath expression returning nodes) ; some basic XPath samples are given in the search box and 'Help / Quick XPath reference" menu. The number of found nodes will be displayed in the status bar.
The 'Next' button will navigate through the results. The item number will be displayed in the status bar.
Then, press the "Apply" button, or use the shortcut Ctrl-Return; your text should now be displayed in black, and is now memorized to be saved with the file.
All nodes could be expanded or collapsed with the menu items in Edit, or their shortcuts
You can copy the underlying XML part of the selected node with 'Edit / Copy' and paste it in a text editor
This screen allows you to modify every single settings :
- XML / Clean Text : tells the XML parser to not create blank text nodes ; this is useful for XML files with indentation to not have dummy text nodes with only the spaces used for indentation.
- XML / Enforce Cleaning : will clean also both CR LF, useful for XML files edited in DOS mode carriage returns, and will also clean texts from leading or trailing spaces and carriage returns.
- XML / Pretty Print on Save : when saving, the XML will be saved with indentation
- Engine / Optimize Memory usage : tells the XML Diff Engine to optimize the memory and not keep items that have been treated ; this item is useful in complex xmldiff scripts, but I see no reason to not tick this item in xmlTreeNav ; will probably be removed in the future.
- Engine / Use EXSLT : enable use of EXSLT langage extensions ; you must tick this if you use EXSLT extensions in the XSLT files used for display.
- Config / Configuration File : the name of the configuration file to use.
- Config / Search Size : the size of the search bar in the toolbar (in pixels).
The config.xml file is a basic XML file with a main node 'xmltreenav' to add more options.
You can preconfigure custom displays with 'display' nodes with the following attributes :
- name : the name that will appear in the Display menu
- type : the type of custom display : 'local' (local XSLT) or 'html' (HTML XSLT Display)
- file : the filename of the XSLT file
<display name="Display only added, removed or equal" type="local" file="filter-added-removed-or-equal.xsl" />
You can preconfigure custom searches with 'search' nodes with the following attributes :
- name : not used, only useful when editing the config.xml file
- expr : the XPath expressin that will be adding in the search combo box
<search name="All Nodes with content text toto" expr="//*[text()='toto']" />
A few options are available on the command line :
xmlTreeNav [/x localdisplay.xsl] [/h htmldisplay.xsl] [/c config.xml] xmlfile.xml
xmlfile : XML file to open
/x or --xslt : XSLT Local Display File to use
/h or --html< : XSLT HTML Display File to use
/c or --config : Config File to use
License, Updates, Support
This software is distributed under GPL license ; it basically means that its use is free and its source code is available in order to allow you to improve it (see GPL license for conditions).
Home location of this software is : http://www.lprp.fr/soft/xml/xmltreenav/xmltreenav_en.php3. . You will find there documentation, updates and contact information.