XML Spy 4.1 Suite
Creating, Editing, and Validating XML Documents
By Mike Riley
XML has come a long way since its inception, when it was created in response to the lack of contextual structure created by HTML's explosion. Since then, XML has spawned a large family of descendants and a new industry around distributed-application development. Yet, for all XML's popularity, very few tools have made it possible to create and edit the vast range of XML languages available. Either these editors focus on simple XML constructs (such as Microsoft's XML Notepad) or attempt to encapsulate and hide the guts of XML entirely (such as Microsoft's BizTalk and Visual Studio .NET products). Only a product like Altova's XML Spy 4.1 Suite provides the ability to generate myriad XML Document Type Definitions (DTDs) and schemas and match these with XML data and Extensible Stylesheet Language Transformation (XSLT) documents in a single, comprehensive, integrated-development environment (IDE).
The XML Spy IDE is as flexible as any advanced language- or application-builder IDE. All facets of the IDE (menus, toolbars, font attributes, icons, keyboard accelerators, views, and macros) are customizable. The menus and toolbars sport the new Microsoft Office XP look and feel, which gives them a cutting-edge style. You can rearrange, tear off, resize, or minimize all the single-document-interface windows to meet your liking.
Besides its good looks, the IDE is chock-full of good ideas. For example, the Info Window is essentially an expanded status bar that provides details about the attribute or element that is currently being edited. A quick glance at this window during a text edit reminds users what the current attributes are. I found this to be a great timesaver, especially when working with complex XML documents with numerous elements. Right-clicking on almost any visible item will bring up a context-sensitive pop-up menu for the most appropriate actions.
Designing Schemas and DTDs
All these slick presentation widgets would be meaningless if the product failed to perform its primary objective: creating, editing, and validating XML documents. Any text editor can help to create well-formed XML documents, but only developers thoroughly educated in the XML DTD and schema recommendations can proficiently generate the syntax necessary for the variants of schemas available. For the rest of us, XML Spy gives developers a head start by providing DTD and XML schema templates for a variety of XML specifications, including BizTalk, Chemical Markup Language, Formatting Objects, Resource Definition Framework, MathML, Synchronized Multimedia Language, Scalable Vector Graphics, VoiceXML, and Wireless Markup Language (see FIGURE 1). Additionally, users can create their own DTD and XML schemas and can add them to the template list. This is essential for vertical markets that have defined their own schemas, and it helps to maintain a consistent implementation for each new XML data file requiring such a template.
FIGURE 1: The XML Spy IDE showing the Schema view.
XML Spy provides all the tools necessary to author XML DTDs and schemas accurately, but you will need some time to get used to the interface. In part, this is because of the different views and iconic symbols developers can use while designing their schemas. For example, XML Spy's Schema Design view uses pseudo-UML symbolic representations to characterize element relationships. The Enhanced Grid view presents another helpful way XML Spy represents schemas and XML by using a tabular, tree-like, drill-down method. This view is helpful when visualizing the depth and relationship of elements and nodes with respect to the location of others in the document. The Enhanced Grid view also enables users to edit the values within an XML document quickly while protecting the tags from accidental changes (because this view abstracts these tags in the form of table cells). If an attribute has been defined, double-clicking on it in this view will populate a smart drop-down with other appropriate attributes that can be used. Because it was so easy, I preferred to use this view much of the time I was reviewing the program. For those weaned on Notepad, the program provides a Text view with which users can edit the entire contents of a file manually (see FIGURE 2). But, rather than building in a simple text editor, Altova has beefed up the Text view with smart drop-downs, syntax color-coding, and auto completion. About the only thing these views lack is the ability to view them in a full-screen mode. This makes working with XML Spy a challenge in anything less than 1024-by-768 resolution.
FIGURE 2: The XML Spy IDE showing the XML Text view.
Drag and Drop XSLT
Another timesaving application bundled with XML Spy 4.1 Suite is the XSLT Designer. This program assists developers with the creation of XSLT documents. Like DTDs and schemas, writing XSLT documents by hand is a chore. Thankfully, the XSLT Designer's drag and drop element interface is so easy to use that you can use it to create a valid XSLT stylesheet without knowing how to write one by hand. Once a stylesheet has been created, you can test it within either the XSLT Designer or the XML Spy IDE by transforming it with a specified XML document. The result can be displayed either in XML Spy's embedded Internet Explorer view or sent out to the stand-alone browser view. XML Spy 4.1 Suite also features support for XML Formatting Objects (XML:FO), which allows properly defined XSLT stylesheets to transform into multiple file-output types such as pdf and rtf. However, to enable this capability, you need to download a 6.8 MB file and have the Java 2 run time installed. I'm hoping Altova or one of its third-party partners will provide a native XML:FO library in the future. And, speaking of third-party add-ons, Altova's Web site offers several others, such as external XML and XSLT parsers beyond MSXML.
The XSLT Designer application is quite good, but it really is intended only for rudimentary HTML page layout and design. Other third-party page designers, such as Macromedia's Dreamweaver, will be required for more aesthetically pleasing designs. It's obvious the XSLT Designer is a nascent application intended to help developers with stylesheets today, but that it has the potential to blossom into a rich visual editor.
XML Spy's Document Editor also provides a similar XML content-editing ability, and, combined with the XSLT Designer, forms the XML Spy 4.1 Document Framework. This framework permits registered users to participate in an enterprise-wide XML standards-based content management solution. However, because the editor requires Microsoft Internet Explorer 5.5 or higher and is delivered as an IE plug-in, it is obviously restricted to Win32-based clients.
Lots of Extras
XML Spy 4.1 Suite contains a number of noteworthy features. You can make printer-pretty reports in either HTML or Microsoft Word format for excellent project documentation. You also can maintain project files under source control (using Microsoft SourceSafe) directly within the IDE. XML data can be imported to and exported from Microsoft Excel and Word as formatted text. Probably the most interesting feature is the suite's ability to generate schemas automatically and create XML data documents by importing database schemas and query results directly from any ADO or ODBC data source. Data also can be exported to an ADO or ODBC data source or plain text file. This incredibly powerful feature alone is worth the price of the package. Similar capabilities are only available in Enterprise packages of application language IDEs that cost thousands of dollars. Finally, the documentation is comprehensive and well-written. The initial suite download contains the HTML Help version of the documentation, and the pdf versions are available as free downloads separately. Unfortunately for developers who prefer hard-copy manuals, Altova has elected to sell XML Spy as an electronic-only distribution. Printing the entire documentation suite will require a ream of paper.
I first began reviewing the product when it was the 4.0 version. As is often the case with dot-zero releases, bugs were inevitable. Thankfully, with the 4.1 release, the annoying hiccups I encountered were fixed. And now, Altova has released version 4.2. Altova recommends the suite be used on a Windows 2000 or higher environment. The Windows 2000 platform features full Unicode support and better stability using Windows 2000's improved RichEdit 3.0 control.
Overall, I was thoroughly impressed with XML Spy 4.1 Suite. Its flexible IDE and wealth of options make creating and editing XML a joy. If you're looking for a powerful XML tool suite, XML Spy is one of the best available on the market today.
Mike Riley is a chief scientist with RR Donnelley, one of North America's largest printers. He participates in the company's emerging technology strategies using a wide variety of distributed network technologies, including Delphi 6. Readers may reach him at mailto:[email protected].
Its good features include:
- Multiple XML views that provide an optimal design palette for any user.
- A customizable IDE that is also fully scriptable using the XMLSpyFormEditor.
- Support for the latest Web standards, including WebDAV.
- Schema reports that can be formatted to HTML or Microsoft Word output for high-quality documentation purposes.
- Built-in Microsoft SourceSafe support for document source control.
- Ability to import database schemas and data for automatic XML design representation.
- Exposed COM objects to allow manipulation of XML Spy's functions from other programs.
- XML Spy Document Framework (standards-based, XML-centric document-management system).
900 Cummings Center
Beverly, MA 01915-6181
Phone: (978) 927-9400
Web Site: http://www.xmlspy.com
Price: US$399 for a single-user license.