Editing and Parsing XML with the XML Manager
Parsing XML can be a time-consuming task, especially when large amounts of data are involved. As of v15.10, UltraEdit provides you with the XML Manager for the purpose of parsing and editing your XML files. The XML Manager allows you to navigate through the XML tree, but also allows you to search, move nodes up/down, copy/cut nodes, and even duplicate nodes. The following Power Tip guides you through the features available in the XML Manager.
If the XML Manager is not already open, you can open it in the View : Views/Lists submenu.
If the file is a valid XML file, the XML Manager will parse the file and display the various nodes contained within the file.
The XML Manager provides multiple methods of navigating between nodes.
At the most basic level, you can expand and collapse the nodes using the +/- icons.
Search for Nodes
The top of the XML Manager includes a search box. You can type node names in the search box and hit ENTER, this will find the first node that matches the search string. If there are multiple nodes that match the string, you can hit enter again and it will find the next node that matches the search string.
Navigating within the File
Of course, the XML Manager parses the XML file, but it also allows you to navigate throughout the file by double-clicking on the elements in the XML Manager.
The XML Manager is useful for reading/parsing and navigating XML files, but can also be used to edit your XML files.
Select the Node
If you wish to select (highlight) the entire node, hold the Shift key and Double-Click. This will highlight the entire node in the editor.
There are many other "editing" options available in the right-click context menu within the XML Manager. To see the options, simply right-click in the XML Manager, you will see the following options:
Moves selected node down in document tree.
Selects, cuts, copies, and pastes nodes from within the XML Manager.
Replace with clipboard
Replaces the selected node with the contents of the clipboard.
Pastes the node in the clipboard before the active node.
Pastes the node in the clipboard after the active node.
Duplicates the selected node below the active node in the document tree.
Adding Support for Other File Types
XML is parsed based on the XML extensions defined in the wordfile. So, if you want the XML Manager to parse a particular file type, you would need to add the extension to the File Extensions in the wordfile. You can learn how to do this in our "Adding or removing file extensions for syntax highlighting" Power Tip.
If you don't want the file type to permanently parse as XML, you can temporarily View the file as XML in the View : View As (Highlight File Type) submenu.
Note: The XML Manager expects valid XML files; therefore, you may see a parse error if the file is not a valid XML format.