Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,679 members, 7,820,385 topics. Date: Tuesday, 07 May 2024 at 02:01 PM

Json & Xml - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Json & Xml (985 Views)

Programming Challenge: Convert String to Json with a Loop / List Of All States With Local Governments In Nigeria In JSON, PHP And SQL Format / Android Quiz Application With Json Parser, Php And Mysql Database (2) (3) (4)

(1) (Reply) (Go Down)

Json & Xml by Fulaman198(m): 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.

1 Like

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.

2 Likes

Re: Json & Xml by Fulaman198(m): 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(m): 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.

1 Like

Re: Json & Xml by Fulaman198(m): 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)

12 Things To Do Before Applying For Google Adsense / How to Grow Wealthy from Writing / Part 2 Of How To Bypass A Download Error On Google Play Store

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 30
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.