XMLSPY2004 and MAPFORCE2004
by Altova, Inc.
If you are an enterprise or XML developer and wish you had a tool that could make your life easier, check out this review as it discusses two of the most useful tools in the industry. XMLSPY is more than an editor; it's a toolbox for XML. MAPFORCE is another XML application that provides different facilities to a developer or a designer.
This is an XML workbench that includes a lot of features. I'll describe some of these features here; for more information check out Altova's Web site.
I like document creation because you don't have to create a project to create a document or a schema, though you can add the created document or schema to a project later. Note that in the New menu item of XMLSPY there are many types of documents that you can create with it.
After a document type is created the tool gives the user different views of it, which is helpful and easy to use. In the case of an XSD, it's viewable in the form of a block diagram and the user can navigate the blocks to see the properties of each block in different property windows. Parent and child relationships can be collapsed or expanded; blocks can be easily made reusable without typing in the Text view.
This is one of the few good things in life! After you create a schema, click the Generate Documentation menu item and the tool will create the documentation for your schema. You have two choices for the document format: Word or HTML. They both worked well for me.
The documentation generated is pretty good with diagrams and links to navigate to the various components. After you edit the schema, you have to regenerate the documentation every time as it doesn't occur automatically. If the schema is reasonably large, as they often tend to be, this feature may turn out to be time-consuming.
XSD to the Database and Back
This is one of the useful features in XMLSPY and can turn out to be very productive in the design phase as well as the maintenance phase of a project. If you design an XSD, it can be converted to a database schema. Of course, the database types are limited, but it covers most of the popular databases like Oracle, MS SQL Server, etc. You may choose to design a database using this tool by creating an XSD and then creating the database schema.
An XSD can also be created from an existing database; as noted earlier, it is limited on the databases but it still covers most of the popular ones.
This is a good mapping tool for XML. MAPFORCE2004 can be considered an additional tool that reinforces XMLSPY. It's easy to use and installs fairly simply.
Mapping at Its Best
You can easily map XML to XML or the database to XML. The mapping is very pictorial; the XSD or the XML is shown as a block with all its elements and attributes.
The process of mapping is made very visual and is just connecting lines from the source to the target blocks. As soon as you connect or map elements or attributes, an XML text is being written for you. There is a Text tab that shows the generated XML.
This tool also gives the user many functions for mapping. These functions are
categorized as Logical, Math, Strings, etc. For instance, the user can use the concat String Function, so that while mapping an element or attribute an additional string can be concatenated to the mapped tag. Apart from the functions, there are also filters that can be used while mapping.
It supports database mapping too. The following databases are currently
This mapping also follows a similar mapping approach, as described above.
- Microsoft Access 2000
- Microsoft SQL Server
Transformation and Code Generation
This tool provides options to generate XSLT from the resulting XML file. This is very helpful and makes it easy to reuse the generated XML in other components of a project. You can also use XMLSPY with the XSLT to do other things with it.
There is also an option to generate Java code, which can be compiled and used along with your project. It makes a JBuilder project file and an Ant build script, which makes building the generated code easy. However, you may still have to do some work to include this build in your project's overall build script.
Overall I found both these tools to be very useful, and they can save you a lot of development effort. If applications involve a considerable amount of XML and transformations, then I certainly suggest using them.
The conversion of XSD/XML to the database and vice versa can be done using both of these applications, but XMLSPY does this at development time or statically, while MAPFORCE does it dynamically or at runtime, of course, after the mapping has been done once!
900 Cummings Center
Beverly, MA 01915-6181
Phone: 978 816-1600
Platforms: Windows XP/2000/NT/98/ME
Win XP Pro, 2GHz CPU, 512MB RAM
Target Audience: Software developers and architects
Level: Beginner to advanced
Pros: Powerful editor
Easy to use
Powerful code generation
Con: Needs more integration between the two tools
About The Author
Vijay Phagura, a professional Java/J2EE consultant, has over 12 years of experience in software architecture and development. He specializes in designing and developing software using J2EE and other Java technologies.