One common question is: What is the difference between using Thunder Suite and an XML parser? Thunder Suite and XML parsers can both provide the ability to parse an input XML document, but they differ a lot in functions and features, especially when it comes to COBOL application development.
Here are some highlights of the key differences:
- Parsers require developers to have some XML knowledge
- Parsers usually support API such as DOM and SAX
- Common programming languages for interfacing to parsers are object oriented languages like Java or C++ or C#
- Parsers are used for handling input XML documents only
Sample DOM API Calls
XML parsers still require custom programming logic to navigate a given XML document and extract data values for processing. A parser simply makes an XML document available in memory, and its API — such as Document Object Model (DOM) or Simple API for XML (SAX) — can be used by custom application programming logic to obtain the XML data values. The picture above is a sample of DOM API calls. The parser simply raises programming events that need to be handled by programming logic. The larger and more complex the XML document is, the more complex the application logic will be. Logic branching for XML Choice, Namespaces, and optional vs. required XML nodes are just some of the challenges a developer will face. Complex decision trees and nested repeating structures (i.e. XML branches) also have to be accommodated.
- Thunder Suite is a visual GUI designer that developers can use to generate XML Handler code without requiring XML knowledge
- The ability to generate COBOL or C code for both reading and creating XML documents (XML Parsers are used only for reading XML documents)
- XML parsing logic with advanced validation capabilities beyond what most parsers are capable of, such as required field checking and data enumeration validation
Calling an Thunder Suite Reader
Unlike XML parsers, Thunder Suite generates the subroutine code needed to handle the XML processing for you. It also generates the needed data structures to be loaded or read from. There is no API interfacing, except to CALL the subroutine, from either COBOL or C programs. It hides all the complex XML processing from the calling program. The picture above is an example of how to invoke Thunder Suite-generated code to parse an input XML document.
So which should you use?
If you are writing Java or C++ code and are comfortable with XML, then XML parser would be an option to explore, since it is quite accessible in those environments. On the other hand, if you require XML handling in your COBOL, C or TAL programs on the NonStop, then Thunder Suite will make your job a lot easier.
Feedback pleaseDo you find this tutorial blog helpful? Let us know what you think, and how we can make it even better. Don’t forget, you can subscribe to our blogs (top right-hand corner of this page) to get automatic email notification when a new blog is available.
Phil Ly is the president and founder of TIC Software, a New York-based company specializing in software and services that integrate NonStop with the latest technologies, including Web Services, .NET and Java. Prior to founding TIC in 1983, Phil worked for Tandem Computer in technical support and software development.