ISO20022 — XML/JSON Basics [PART 1]
Background
In this article we will discuss aspects of “markup in text”.
This is the first article in a five part series
Part One — This Article
Words
As “Humans” we owe so much to words. “Word” is one of the aspects, that makes us unique in the animal kingdom.
Written words
Words are read and interpreted by us.
We are able to pass on so much knowledge to future generations using written words.
For example Royal College of Surgeons — Edinburgh is one 500 year old institution.
So much written medical knowledge has been passed down by this great institution helping us over so many generations.
Have a look at their library here :
Similarly in many other ancient cultures, written word, has helped save knowledge and pass it down many generations.
For example, in South Asia, two medical books of knowledge, namely Sushruta Samhita(Medicine) and Charak Samhita(Anatomy) have been passed down many generations.
They are 3000 year old Sanskrit books of Medicine and Anatomy respectively.
Do read about them here.
Sushruta Samhita(Medicine)
Charak Samhita(Anatomy)
Spoken words
Our thoughts can be clearly communicated when spoken with “words”.
In the Digital Age, speech can reach so many people. Radio has connected all of us all over the world. More so, now with TV and Movies.
We are truly one world, one people now.
Our First words
Parents are so happy when children speak their first “words”. It can be funny.
Spoken words confusion
Simple speech can be confusing.
For example speak out the word “to” and then the word “go”.
Why do “t” + “o” and “g” + “o” not sound the same way.
Lets look at Merriam Webster Web Site, to help us understand.
Word — To
Spoken as — tu̇,tü
Word — Go
Spoken as — gō
Markup — Why needed ?
Such simple words like “to” and “go”, can be confusing when spoken, especially for someone who is not a native English speaker.
The Merrian-Webster dictionary, could be one source of help.
It explains, the written word “to” is to bespoken as “tu̇” but a similarly written word “go” is to be spoken as “gō”.
Here “tu̇” and “gō” are the spoken markups of the words words “to” and “go”, respectively.
The above help is for humans to interpret and speak two simple words.
There are so many words in English
To quote, as per the above page there are more than 200,000 words in English.
The Second Edition of the 20-volume Oxford English Dictionary contains full entries for 171,476 words in current use, and 47,156 obsolete words. To this may be added around 9,500 derivative words included as subentries
Just “Words” are not enough, we use Words to form complex sentences and speech.
In this age of Artificial Intelligence, we have many machines, which add value by helping us process so much data for us.
And most data is not just “Words”. It needs to be interpreted by humans and machines alike.
Let's look at this simple “Address”
1 Love Lane
HeartShire
143
Address data is to interpreted like this :
-Address
-Line - 1 Love Lane
-County - HeartShire
-PostCode - 143
There needs to be some way for the “machine” to understand how to consume data.
Humans also need to know how the “machine” correctly consumes and interprets the data.
Markup Languages
HTML
Hyper Text Markup Language.
This is the way our browser interprets how to show a page.
Example HTML
<p>
<H1>Hello</H1>
</p>
The browser would see the above as a new paragraph, and then Heading1 is used to render “Hello”.
XML
What HTML is to browser XML(Extensible Markup Language) is to machines. What makes XML special, is that it is also, intended to be human readable.
Here is an example of a “Books” XML file. It has a “Books” wrapper, which in turn can have one or more “Book”s, which needs to have one “Name”, “Author” and “Date”.
<?xml version="1.0" encoding="utf-8"?>
<Books xsi:noNamespaceSchemaLocation="schema.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Book>
<Name>Name1</Name>
<Author>Author1</Author>
<Date>2013-02-17</Date>
</Book>
</Books>
Now both machines can read the file and also humans can read the file.
JSON
JSON is similar to XML in the goals, meaning it is human and machine readable. It is more compact than XML.
Here is the same data as above in JSON
{
"Books": {
"-xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"-xsi:noNamespaceSchemaLocation": "schema.xsd",
"Book": {
"Name": "Name1",
"Author": "Author1",
"Date": "2013-02-17"
}
}
}
Next
In the next article we will see a detailed Books example and introduce schemas.