JSON vs XML, Part 1: XML in RPG

What’s the difference?

JSON vs XML: when did these data formats originate, and how are they used in RPG (and development in general)? Both have a tremendous history behind them and are either derived from or parent to a variety of other means to hold data. This article will draw a few mentions to content cited in our previous blog posts on REST[1] vs SOAP[2] APIs (and a comparison[3]). This first in a series of three articles will explore XML, as well as its origins, general structure, and typical uses in RPG. The next article in this series will explore JSON in a similar fashion, while the third will draw comparisons between the two. Before getting too deep into the weeds, let’s define a few important terms mentioned in this series.


Definitions

The realm of client-server communication is loaded with acronyms and terms to keep track of. To begin with, let’s elaborate upon several key terms, and what they mean. 

XML – Extensible Markup Language – XML is a widely used data format, similarly structured to HTML. XML can be used in both SOAP and REST API calls.JSON – JavaScript Object Notation – JSON is arguably the fastest-growing data format used when communicating over HTTP in the present day, thanks to its memory-efficient format.WSDL – Web Service Definition Language – WSDL is an XML-based notation used for describing functionality of a SOAP-based web service[4]. WSDL is used at development time to describe a web service program with procedure names, input/output parameters, the URL of the web service, and the enveloping mechanisms and transport to be used (i.e., SOAP over HTTP).XSD – XML Schema Definition – An XSD is a file type that describes the structure of an XML document.REST – Representational State Transfer – REST is an architectural style, rather than a protocol (protocols define how diverse modules interact, while styles define how sets of protocols are organized[5]). REST utilizes existing web protocols and tools to communicate with APIs.SOAP – Simple Object Access Protocol – SOAP is a data-centric protocol that uses WSDL files for client-consumer communication.RPG – RPG is the primary language used when developing business applications on the IBM i OS. Also known as RPG Free, RPGLE, and RPG IV.IBM i – IBM i is the operating system used on IBM’s POWER servers. IBM i is the OS name, which was formerly i5/OS and OS/400. AS/400 is what was renamed to iSeries, System i, and then IBM Power Systems.

Table of Contents


XML – Extensible Markup Language

An expanded definition

Let’s dig into XML and find out what each of its terms mean. As mentioned in the “Definitions” section, XML stands for Extensible Markup Language. What do each of these terms mean?

Extensible

Oracle’s documentation describes extensibility as “an ability of the software system to allow and accept the significant extension of its capabilities without major rewriting of code or changes in its basic architecture. Extensible systems provide technology, tools, languages that are designed so that developers can expand or add to its capabilities.” [6, Page 5]

For example, when compared to HTML, XML is extensible. While HTML requires you to use a specific set of predefined tags (such as <body>, <head>, <div>, etc), XML accommodates user-defined tags (such as <OrderNumber>, <Quantity>, <Location>, <Status>, etc.).

Markup

Techtarget.com says that “Markup refers to the sequence of characters or other symbols that you insert at certain places in a text or word processing file to indicate how the file should look when it is printed or displayed or to describe the document’s logical structure. The markup indicators are often called tags.” [7]

Language

Techtarget.com also explains that “A markup language is a computer language that uses tags to define elements within a document. It is human-readable, meaning markup files contain standard words, rather than typical programming syntax.” [8]

While most languages programmers use are tied closely to the development of a program (think RPG, COBOL, or CL), markup languages can be considered a metalanguage (i.e. a language used to describe another language). [9]


What is XML’s history?

To get a broad understanding of XML, as well as some trivia, let’s look into XML’s predecessors, and where they came from. Furthermore, we’ll explore the offshoots of XML and similar data formats built parallel to it.

GML – Generalized Markup Language

The earliest roots of XML come from GML, as developed by Charles Goldfarb, Edward Mosher, and Raymond Lorie at IBM in the 1960s.[10] Made long before the advent of HTTP, GML was designed not for data interchange across the web, but for representation. GML documents were built using a series of markup tags intending to specify what a document should look like, rather than representing exactly what it would look like. [11]

SGML – Standard Generalized Markup Language

Extending from GML came SGML, which was formalized as an ISO standard in 1986[12], and defined as having a scope which includes “Standardization in the field of document structures, languages and related facilities for the description and processing of compound and hypermedia documents.”[13

Darla Ferrara at ThoughtCo describes SGML’s use well:

SGML, HTML, and XML are all markup languages… In this family of markup languages, Standard Generalized Markup Language (SGML) is the parent. SGML provides a way to define markup languages and sets the standard for their form. In other words, SGML states what some languages can or cannot do, what elements must be included, such as tags, and the basic structure of the language. As a parent passes on genetic traits to a child, SGML passes structure and format rules to markup languages.[14]

HTML – HyperText Markup Language

HTML, one of the most familiar coding languages, is an extension of SGML  and was released in 1993.[15] It has evolved greatly over the years, and is the primary language used when displaying web pages. 

XML – Extensible Markup Language

Released in 1996, XML is another SGML extension, and is one of the most widely-used data formats available today. While HTML worked well for building websites, its limited extensibility made it unsuitable for storing data in an efficient manner. XML was created in response to that. As described by Chris Collins in ‘A Brief History of XML’,

When it comes to data storage and interchange, HTML is a bad fit, as it was originally intended as a presentation technology, while SGML is considered too complex for general use. XML bridges this gap by being both human and machine readable, while being flexible enough to support platform and architecture independent data interchange.[16]

XHTML – Extensible HyperText Markup Language

XHTML is an extension of both HTML and XML, and its initial release was in 2000. As stated by w3schools.com, “XHTML was developed to make HTML more extensible and flexible to work with other data formats (such as XML). In addition, browsers ignore errors in HTML pages, and try to display the website even if it has some errors in the markup. So XHTML comes with a much stricter error handling.”[17]

Note, the 1-2 lines of text under each circular markup symbol points out general document requirements (or lack thereof) in the history of GML through XHTML.


How is XML structured?

XML is built using a tree structure, and begins with a single root element, which expands into a series of child, parent, and sibling elements. An XML document might be structured like this:

Talsco Weekly: Open Source, Remote Work and DevOps for the i

Welcome to another edition of Talsco Weekly

News:  POWERUp Brings IBM i Base Back Together in the Big Easy.
Open Source:  What is Kubernetes? An Ansible IBM i Disk Checker.
Remote Work:  I graduated into remote work. I felt so alone and left behind that I was desperate to return to the office.
DevOps:  More Details about IBM i Merlin.
Leadership:  Have you overlooked your responsibility to build a succession plan?

News

POWERUp Brings IBM i Base Back Together in the Big Easy

If you missed the POWERUp meeting in New Orleans, here’s a great recap of some of the things that you missed.

Open Source

What is Kubernetes?

Kubernetes (also known as “k8s” or “kube”) is an open source container orchestration platform that automates many of the manual processes involved in deploying, managing, and scaling containerized applications.

Here’s a good visual representation.

An Ansible IBM i Disk Checker

If you use Ansible, here’s an in-depth view of what it can do.

What is Ansible?

“Ansible is an agentless open source automation engine that helps to rapidly automate configuration management, deploying applications, virtual server and LPAR deployment and many other IT requirements.”

Remote Work

I graduated into remote work. I felt so alone and left behind that I was desperate to return to the office.

While there are huge benefits to working remotely, not everyone sees it that way.

Don’t get me wrong, I think the ability and the opportunity for the IBM i community to be able to work remotely has been a game changer on many different levels. However, there are scenarios and situations where it doesn’t always make sense. This article is an interesting read.

DevOps

More Details about IBM i Merlin

The “IBM i Modernization Engine for Lifecyle Integration, or Merlin” “enables users to develop IBM i application in ILE languages through open-source version of VS Code, a browser-based integrated development environment (IDE).”

Read more here.

Leadership

Have you overlooked your responsibility to build a succession plan?

One of the most critical elements to a vibrant, robust and forward thinking company that leverages the IBM i is the awareness and willingness of the current leadership to have a succession plan.

Key takeaway:

Identify Future Leaders: These leaders might be internal or external. “These are people who check many boxes when it comes to attributes like intellectual capability, expertise, and ambition. These are the kinds of people you want to consider taking part in your successor plan.”
Positioning Talent: “How you structure the talent in your organization is an essential aspect of building your successor plan.”
Developing Your A-Players: Here are some of the things you can implement: educational opportunities, cross-functional teams, and leverage peer groups.
When to Step Down: “At some point in your successor development plan journey, you need to make perhaps your most difficult decision: to step down.” Sometimes it is not just stepping down, it is simply letting go. AS/400 concepts and strategies that worked in the past, might need to be replaced with new strategies that help drive modernization and digital transformation projects of the future.

Creating an IBM i succession plan is one of the most important things IBM i leaders can do for the future of the platform.

Join

Sign up for Talsco Weekly to get the latest news, insight and job openings for the IBM i professional.

Contact us

If you are an RPG programmer looking to explore opportunities or a client who is looking for a talented IBM i professional, please contact us. We look forward to assisting you.

Share

Do you know of someone who could benefit from Talsco Weekly? If so, please use the social media buttons to spread the word. Thank you!

The post Talsco Weekly: Open Source, Remote Work and DevOps for the i appeared first on IBM i (AS/400, RPG) Recruiting, Staffing & Consulting.

Security Bulletin: IBM Java SDK and IBM Java Runtime for IBM i are vulnerable to unauthenticated attacker obtaining sensitive information and other attacks due to multiple vulnerabilities.

IBM® SDK Java™ Technology Edition and IBM® Runtime Environment Java™ used by IBM i are vulnerable to unauthorized attacker obtaining sensitive information and other vulnerabilities as described in the vulnerability details section. The vulnerability is fixed by applying a Group PTF as described in the Remediation/Fixes section.

Verified by MonsterInsights