₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,774 members, 8,423,667 topics. Date: Wednesday, 10 June 2026 at 06:21 AM

Toggle theme

Json & Xml - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingJson & Xml (1103 Views)

1 Reply (Go Down)

Json & Xml by Fulaman198(op): 1:45am On May 28, 2015
I remember back in my childhood in my teens at the beginning of these 2000s I taught myself HTML in less than 24 hours. I was wondering if it were possible with JSON and XML.
Re: Json & Xml by blenyo11(m): 7:21am On May 28, 2015
What you taught yourself in less than 24 hours then was the basics of html. You got better at it as you kept using it and you keep discovering new things. Its possible that you are still discovering new things in this fundamental language up till now.
In the same way you can get the basics of XML (whose subset a beginner can say html is) and get better at it as you keep using it. The same goes for JSON which is more of a data structure just like XML.
But it all depends on how fast you can learn which your claim shows you are. Though one can only wonder why you will learnt html at the beginning 2000s and have not know this 2 fundamental languages.
Re: Json & Xml by kudaisi(m): 12:14pm On May 28, 2015
Why learn both though ? And why do you want to learn them in a Day (who dey pursue you) ? undecided I mean, JSON was born out of the need to eliminate some of the disadvantages that are encountered in XML for serilization of data.
for example using Javascript and depending on the parser:
A typical json would look like this:
someJSON = {
"title" : "Return of the mark",
"length" : 243
}
while the XML equivalent will be this
<song>
<title>Return of the mark</age>
<length>243</length>
</song>
The JSON will be parsed like this:
song = JSON.parse(someJSON);
console.log(song.age);
console.log(song.name);
while the XML will be parsed like this:
someObject = parseXML();
songs = myObject.getChildren("song"wink;
song = song[0];
console.log(song.getChildren("title"wink[0].value());
console.log(song.getChildren("length"wink[0].value())
It's obvious which is fatter right ? That's why JSON is often referred to as fat-free XML.

That said, both XML and HTML are derivatives of the Standard Generalized Markup Language (SGML). However, compared to SGML XML is simpler while HTML is the simplest of them. If the reason you need XML and JSON is for data-interchange then learn JSON first has it is starting to become the de facto standard for serialization of data and that's why every major website this days including social networks have a RESTful API.

JSON replacing XML for data-interchange doesn't mean XML will become useless with time. XML in itself has many other derivatives and it is adopted in many programming languages and frameworks for example Java uses an XML derivative called FXML for JavaFX, .Net uses XAML for Windows Presentation Foundation (WPF) and Spring Framework uses XML for may of it's plumbings. When you can you should learn XML in case might have a use for it in the future.
Re: Json & Xml by Fulaman198(op): 5:02pm On May 28, 2015
blenyo11:
What you taught yourself in less than 24 hours then was the basics of html. You got better at it as you kept using it and you keep discovering new things. Its possible that you are still discovering new things in this fundamental language up till now.
In the same way you can get the basics of XML (whose subset a beginner can say html is) and get better at it as you keep using it. The same goes for JSON which is more of a data structure just like XML.
But it all depends on how fast you can learn which your claim shows you are. Though one can only wonder why you will learnt html at the beginning 2000s and have not know this 2 fundamental languages.
The reason I never spent time learning XML and Json is because I'm not currently involved in Web Development. I'm in the Network Technologies and Engineering realm. But I'm interested in improving myself in another area of I.T.
Re: Json & Xml by Fulaman198(op): 5:04pm On May 28, 2015
kudaisi:
Why learn both though ? And why do you want to learn them in a Day (who dey pursue you) ? undecided I mean, JSON was born out of the need to eliminate some of the disadvantages that are encountered in XML for serilization of data.
for example using Javascript and depending on the parser:
A typical json would look like this:
someJSON = {
"title" : "Return of the mark",
"length" : 243
}
while the XML equivalent will be this
<song>
<title>Return of the mark</age>
<length>243</length>
</song>
The JSON will be parsed like this:
song = JSON.parse(someJSON);
console.log(song.age);
console.log(song.name);
while the XML will be parsed like this:
someObject = parseXML();
songs = myObject.getChildren("song"wink;
song = song[0];
console.log(song.getChildren("title"wink[0].value());
console.log(song.getChildren("length"wink[0].value())
It's obvious which is fatter right ? That's why JSON is often referred to as fat-free XML.

That said, both XML and HTML are derivatives of the Standard Generalized Markup Language (SGML). However, compared to SGML XML is simpler while HTML is the simplest of them. If the reason you need XML and JSON is for data-interchange then learn JSON first has it is starting to become the de facto standard for serialization of data and that's why every major website this days including social networks have a RESTful API.

JSON replacing XML for data-interchange doesn't mean XML will become useless with time. XML in itself has many other derivatives and it is adopted in many programming languages and frameworks for example Java uses an XML derivative called FXML for JavaFX, .Net uses XAML for Windows Presentation Foundation (WPF) and Spring Framework uses XML for may of it's plumbings. When you can you should learn XML in case might have a use for it in the future.
Good stuff, Json definitely seems like the better language whereas XML like HTML is a markup language. So I see your point.
Re: Json & Xml by spikesC(m): 7:13pm On May 28, 2015
Fulaman198:
Good stuff, Json definitely seems like the better language whereas XML like HTML is a markup language. So I see your point.
JSON is not a language.
It is a data structure, so there's no learning to it. No body writes JSON data, it is generated and parsed by a library.

There's also no learning to XML. It is a custom tagged markup language.
Re: Json & Xml by Fulaman198(op): 10:56pm On May 28, 2015
spikesC:
JSON is not a language.
It is a data structure, so there's no learning to it. No body writes JSON data, it is generated and parsed by a library.

There's also no learning to XML. It is a custom tagged markup language.
Cool got thank you for the information
1 Reply

Programming Challenge: Convert String to Json with a LoopList Of All States With Local Governments In Nigeria In JSON, PHP And SQL FormatAndroid Quiz Application With Json Parser, Php And Mysql Database234

...HP Programming Laptop @ Giveaway PriceI Need A Verified Naija Non Hosted Adsense Account ............