eXtensible Markup Language (XML) is a markup language used to structure data to make it easy to exchange data over the Internet. The compatibility of XML with various other languages, such as Java and C++, has given rise to various tools and utilities such as XML editors, parsers, and browsers that help structure data in an XML document. Most of these XML tools conform to the World Wide Web Consortium’s XML 1.0 standards and specifications and can be downloaded free of charge.
The XML tools and utilities enable you to structure, validate, debug, read, and view an XML document and create XML schemas.
This ReferencePoint describes the various XML editors, parsers, and browsers that you can use to work with XML documents. It also explains the features and interfaces of these XML tools.
XML editors create Document Type Definition (DTD) files for XML documents. Compared to text editors, XML editors simplify the process to create an XML document, DTD, and perform additional functions such as modify, read, and validate XML documents. These XML editors provide an integrated development environment that helps automate XML development tasks.
Some commonly used XML editors include XMLSPY 4, Microsoft XML Notepad, and XMetaL 4.0.
XMLSPY 5 is an Integrated Development Environment (IDE) that enables you to design and create XML documents, XML schema, and XLS style sheets. It also enables you to debug Web applications using XML, XML schema, Simple Object Access Protocol (SOAP), and Web Services technologies. The user interface provided by XMLSPY 5 consists of several panes, which are shown in Figure 1-3-1:
Figure 1-3-1: XMLSPY User Interface
You can use the features of XMLSPY to:
Edit an XML document by inserting and appending elements and attributes to it. To do this, select XML -> Insert or XML -> Append, as shown in Figure 1-3-2:
Figure 1-3-2: XML Menu on the XMLSPY Interface
Add a child node to an element and an attribute. To do this, select XML -> Add child, as shown in Figure 1-3-2.
Check for the well-formedness of an XML document in accordance with the XML 1.0 specifications. To do this, select XML -> Check well-formedness, as shown in Figure 1-3-2. If the check for well-formedness succeeds, a message appears at the end of the file, as shown in Figure 1-3-3. If the check does not succeed, the error is highlighted in the XML document and an error message is displayed.
Figure 1-3-3: Checking for Well-Formedness
Create, assign, and edit a DTD and XML schema by selecting the appropriate option from the DTD/Schema menu, as shown in Figure 1-3-4. In addition, you can validate your XML document against the created DTD or schema.
Figure 1-3-4: DTD/Schema Menu
Create, edit, and debug Extensible Stylesheet Language Transformation (XSLT) style sheets. XSLT is a programming language used to transform XML documents into other formats, such as HTML pages and PDF files.
Debug XML and XSL files with the help of the Watch window. You can view and change variables while executing an application in the Watch window.
Convert XML documents into HTML documents through the stylesheet designer without using XSLT programming. The stylesheet designer automatically reates the XSLT style sheet.
Create, edit, and view Web Service Description Language (WSDL) documents using the WSDL editor.
SoftQuad’s XMetaL 3.0 is a customizable graphics tool used to create and edit XML documents. It provides a variety of authoring features, such as multiple document view and context-sensitive Property Inspectors.
The XMetaL customizable interface, shown in Figure 1-3-5, consists of various components including menus, toolbars, the main document pane, and Property Inspector:
Figure 1-3-5: XMetaL User Interface
The XMetaL editing tool enables you to:
Open and edit an XML document and create an XML project workspace.
Create, insert, split, join, and remove elements and their attributes.
Customize the elements in an XML document graphically. To do this, select Tools -> Customization to open the Customizations dialog box, shown in Figure 1-3-6:
Figure 1-3-6: Customizations for GuestBook.rlx Dialog Box
Create a DTD and schema to validate XML documents.
Use the external identifier provided in a DOCTYPE or an external entity declaration to identify the name and location of a DTD or rules file.
List of all the elements in your XML document using the Element List window. Select View -> Element List to view the Element List window shown in Figure 1-3-7:
Figure 1-3-7: Element List Window
Use three different modes to view and edit XML documents in the interface:
Normal: Shows the XML document as it will appear in a word processor or a Web browser.
Tags On: Shows the start and end tags for the elements in the XML document.
Plain text: Provides the actual XML markup in a color-coded format with indented blocks of elements.
Use Attribute Inspector to edit the attributes of an element. Attribute Inspector depicts the attributes of the current selected element. To view the attributes of an element in Attribute Inspector, click the element in the XML document and select View -> Attribute Inspector.
Keep a track of errors with the validation log, which maintains a record of the errors that have occurred in an XML document.
Note You can download an evaluation copy of the XMetaL 3.0 XML editing tool from http://www.corel.com/support/ftpsite/pub/softquad/xmetal.htm.
XMLEditPro 1.2 is a simple XML editor that enables you to create and edit an XML document. Figure 1-3-8 shows the XMLEditPro user interface:
Figure 1-3-8: XMLEditPro User Interface
You can use the features of XMLEditPro to:
Create and edit XML documents with three different views:
Node: Shows the tree structure of an XML document. Each element in the XML document represents a node in the tree structure.
Browser: Shows how the XML document will appear in a Web browser.
Source: Shows the code of the XML document.
Create and edit a node in the tree structure of an XML document. To do this, use the Edit Node dialog box that appears when you double-click a node in the tree structure. Figure 1-3-9 shows the Edit Node dialog box:
Figure 1-3-9: Edit Node Dialog Box
Note You can download XMLEditPro free of charge from http://www.daveswebsite.com.
Microsoft XML Notepad
Microsoft XML Notepad enables you to build XML applications. It provides a graphical interface that shows the XML document in a tree structure. This enables you to create reproducible data structures.
To use XML Notepad, you need to have Internet Explorer 4.0 SP1 or a later version installed because Internet Explorer includes the Microsoft XML parser that XML Notepad uses to parse XML documents.
Figure 1-3-10 shows the XML Notepad user interface with the elements of an XML document in a tree structure:
Figure 1-3-10: XML Notepad Interface
The features of XML Notepad enables you to:
Create, edit, and convert the elements in an XML document and view them as nodes in a tree structure.
Create multiple copies of either an element or the complete tree structure of an XML document using the Replicate feature. To replicate an element, select Tools -> Replicate. This opens the Replicate dialog box, shown in Figure 1-3-11. The dialog box prompts you to specify the number of copies to replicate.
Figure 1-3-11: Replicate Dialog Box
Reposition the nodes or elements in the tree structure with the Drag and Drop feature.
Convert one node type into another in a tree structure. For example, you can convert a child element into an attribute or a parent element and vice-versa.
Note You can download XML Notepad free of charge from http://www.microsoft.com/download.
XMLwriter 2.0 is an Integrated Development Environment (IDE) used to create, edit, and debug an XML document. Figure 1-3-12 shows the XMLwriter user interface with the XML document workspace:
Figure 1-3-12: XMLwriter User Interface
XMLwriter enables you to:
Validate and format XML documents with a DTD and schema. To use this feature, select XML from the menu bar, as shown in Figure 1-3-13:
Figure 1-3-13: XML Menu Options
Generate and edit a DTD and schema. To use this feature, select DTD/Schema from the menu bar, as shown in Figure 1-3-14:
Figure 1-3-14: DTD/Schema Menu
Create and edit the XSLT document. To use these features, select Style from the menu bar, as shown in Figure 1-3-15:
Figure 1-3-15: Style Menu
Note You can download the XMLwriter 2.0 software from http://www.xmlwriter.net.
Cooktop 2.5 is an environment used to develop XML and XSL documents. Figure 1-3-16 shows how the Cooktop user interface can be used to create and edit XML and XSL documents:
This interface contains five tabs:
source (xml): Shows an XML document.
xpath console: Enables you to write xpath expressions that correspond to the open XML document.
stylesheet (xsl): Helps create a style sheet for the XML document.
result: Shows the result of the XML document.
result (html): Shows the XML document as it will appear in a Web browser.
Cooktop enables you to: Create DTD and XML schema to validate XML documents with the DTD editor provided.Use formatting, encoding of the character set, and named pair tags for the current XML document. To use these features, select the XML option on the menu bar , Retrieve XML documents using the HTTP GET protocol. Add code bits, which are reusable chunks of code, to an XML document. You can create your own templates or use the existing templates to add code bits. To do this, select Code Bits -> Add Code Bit to open the Add Template dialog box. Use multiple XSLT processors, such as MSXML, XT (Java), and Oracle, supported by Cooktop. These processors can be used for XML transformations. To access multiple XSLT processors, select Options -> XSLT Engine, as shown in Figure 1-3-19: