Authoring Documents

Although many applications involve XML that is generated automatically (for example, the body of a SOAP message), there are at least as many instances in which the document is authored and maintained by a human being.

Text Editors

With the proliferation of massive Integrated Development Environments (such as Microsoft Visual Interdev and Borland's JBuilder 4.0), it is amazing how much can be accomplished with a lowly text editor. Unlike a sophisticated programming language with a large runtime library, an XML document has relatively few syntax structures to memorize. Without the need for online help and syntax completion, a simple text editor can provide a perfectly viable tool for writing XML documents. These are a few text editors you might consider:

  • Notepad (shipped with Windows)—Really a terrible editor, but it is ubiquitous.

  • WordPad (shipped with Windows)—Better than Notepad, but still not great for structured text editing.

  • SlickEdit (www.slickedit.com)— A commercial programmer's editor. Has many features for integrating with software development processes (compilers, linkers, make programs, and so on). Good but expensive.

  • UltraEdit (www.ultraedit.com)— A really good shareware editor with plenty of features for indentation, tab and space handling, and syntax highlighting.

For the record, all the XML sample documents in this book were written using UltraEdit. It has tons of features, is very inexpensive, and loads quickly (in under three seconds on my system).

WYSIWYG XML Editors

The idea of a what-you-see-is-what-you-get XML editor might seem to be an oxymoron. XML is not intended to be a presentation format, so what exactly does a WYSIWYG editor show you? In most cases, the high-end commercial editors are capable of displaying an XML document as a free-form prose view with embedded tags. The lower-end and freeware products usually provide only a tree view, showing nested tag relationships. These are some advanced features to look for:

  • Integrated stylesheet editing (CSS and/or XSL)

  • DTD and schema editing

  • Good import/export facilities to non-XML data sources

A few dedicated XML editors available today are listed here:

  • XMLNotepad (msdn.microsoft.com/XML)— A freely available tree-based XML editor. Awkward interface, but it is free.

  • XMetal Pro (www.xmetal.com)— From the same company that produced HotMetal (a WYSIWYG HTML editor). Very full featured, has a nice free-form prose editing window that shows the XML tags as special icons embedded in the text (a la WordPerfect).

  • XMLSpy (www.xmlspy.com)— Another GUI editor for XML document development. The latest version includes a graphical XML schema design view.

Opinions vary widely on the utility of visual XML editors. On one side, visual-editor fans like the fact that it is impossible to create a document that isn't well-formed and valid (if validation is being used). Text-editor aficionados, on the other hand, say that XML syntax is so simple that it is more efficient to edit it directly (despite the occasional syntax or structural error). In the end it comes down to a matter of personal preference, comfort level with XML syntax, and budgetary constraints.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.165.171