Before delving into the details of what an XML editor is, let’s first get to know what XML is. XML stands for “Extensible Markup Language” and uses XML tags to identify, store, and organize the data.
Though XML documents can be created using a simple text editor such as Notepad, WordPad, vi, emacs, or SimpleText etc., a more professional way of creating and editing XML is using an XML editor.
An XML editor is a tool to facilitate the editing of XML. An XML editor has added functionality that goes beyond just the syntax highlighting offered by many plain text editors. They verify the source XML based on an XML schema or XML DTD, and a few can do it as the document is being edited in real time! An XML editor ought to have functions that are necessary for editing XML data based on a document type definition (DTD) or an XML tree, such as auto-tag completion (automatic appending of a closing tag whenever an opening tag is entered, thus preventing typographically originating errors in the XML code) and menus and buttons for common tasks. Further, a professional XML editor also validates that the documents created are well formed.
Some XML editors provide the ability to run an XSLT transform, or a series of transforms, over a document. XSLT debugging features and XSL-FO processors for generation of PDF files from documents are also offered by some of the larger XML packages.
Typically, a professional XML editor has powerful editing features such as −
- Automatic closure of the tags that are left open.
- Checking syntax strictly.
- Highlighting of XML syntax ny color for increased readability.
- Assistance for writing valid XML code.
- Verification of XML documents against DTDs and Schemas.
The XML editors can broadly be classified into Textual and Graphical editors based on the style of functionality.
Textual XML editor
Textual XML editors generally provide features dealing with working with element tags. Syntax highlighting, that is, coloring element text differently from regular text is a basic standard of any XML editor. Element and attribute completion based on a DTD or schema is also available from many textual XML editors. Displaying line numbers and providing the ability to reformat a document to conform to a particular style of indenture are some other common and useful features available in textual editors.
The illustration below shows editing in a text editor using syntax coloring.
The advantage of text editors is that they present the information exactly as stored in the XML file. They provide a more granular way of control the formatting of the file (such as indentations) and to do low-level operations (such as a find/replace on element names).
Graphical XML editors
In contrast to textual editors, the code is hidden in the background in the graphical editors and the content is presented to the user in a more user-friendly format. This sort of content rendering is especially useful for those who are not fluent in XML code and who need to enter information in XML-based documents such as time sheets and expenditure reports. In any case, use of graphical editors is often faster and more convenient as they take care of syntax details.
These are often called WYSIWYG (“What You See Is What You Get") editors, but not all of them are WYSIWYG. Graphical XML editors can be WYSIWYG when they try to display the final rendering or WYSIWYM (“What You See Is What You Mean") when they try to display the actual meaning of XML elements. Instead of by bare XML code, graphical (WYSIWYG) editors allow files to be edited directly with the XML tags in the form of graphical viewing. Also, the graphical (WYSIWYG) editors can use tools similar to many word processing applications and thereby the editing is much more intuitive. Some graphical (WYSIWYG) editors have the facility of defining our own user interface for editing when using a DTD or Schema.
When they are not WYSIWYG, they do not display the (or one of the) graphical end result of a document. In contrast to WYSIWYG editors that display the graphical end result of a document, WYSIWYM editors focus on conveying the meaning of the text. DTDs or XML schemas and/or configuration files are used WYSIWYM editors to map XML elements to graphical components.
Graphical editors are typically more useful for XML data rather than for storing documents. Documents tend to defy the generally rigid nature of many graphical editors as they are fairly free-form in structure .
Some XML editors...
There are a lot of both Open Source and Proprietory XML editors available in the market.
Following are some open source XML editors −
- Online XML Editor − is a light weight open source online XML editor.
- Xerlin − is an open source XML editor for the Java 2 platform written to make creating and editing XML files easier.
- Content Assembly Mechanism (CAM) − is another open based XML editor and is a product of the OASIS Content Assembly Technical Committee.
Following are some proprietory XML editors −
- Oxygen XML Editor − is a multi-platform XML editor, XSLT/Query debugger, and profiler with Unicode support. It is a Java application, so it can run in Windows, MAC OS X and Linux.
- Xeditor − is a web-based XML editor with a WYSIWYG interface. The frontend is similar to Microsoft Word where the XML code is hidden in the background and the content is presented in a user-friendly format.
- Liquid XML Studio − is an integrated development environment (IDE) for XML that includes user interface extension to Microsoft Visual Studio through the Visual Studio Industry Partner (VSIP) program.
More resources on XML editors can be found in the web.