XML and JSON

Diff between XML and JSON

JSON

Pro:

      • Simple syntax, which results in less “markup” overhead compared to XML.
      • Easy to use with JavaScript as the markup is a subset of JS object literal notation and has the same basic data types as JavaScript.
      • JSON Schema for description and datatype and structure validation
      • JsonPath for extracting information in deeply nested structures

Con:

      • Simple syntax, only a handful of different data types are supported.

XML

Pro:

      • Generalized markup; it is possible to create “dialects” for any kind of purpose
      • XML Schema for datatype, structure validation. Makes it also possible to create new datatypes
      • XSLT for transformation into different output formats
      • XPath/XQuery for extracting information in deeply nested structures
      • built in support for namespaces

Con:

      • Relatively wordy compared to JSON (results in more data for the same amount of information).

From <http://stackoverflow.com/questions/4862310/json-and-xml-comparison>

JSON library name?

NewtonSoft.JSON

What is XSLT?

XSLT is a language for transforming XML documents into XHTML documents or to other XML documents.

XPath is a language for navigating in XML documents.

      • XSLT stands for XSL Transformations
      • XSLT is the most important part of XSL
      • XSLT transforms an XML document into another XML document
      • XSLT uses XPath to navigate in XML documents
      • XSLT is a W3C Recommendation

From <http://www.w3schools.com/xsl/xsl_intro.asp>

What is Xpath

XPath is used to navigate through elements and attributes in an XML document

      • XPath is a syntax for defining parts of an XML document
      • XPath uses path expressions to navigate in XML documents
      • XPath contains a library of standard functions
      • XPath is a major element in XSLT
      • XPath is a W3C recommendation

From <http://www.w3schools.com/xsl/xpath_intro.asp>

What is XSD?

An XML Schema describes the structure of an XML document.

The XML Schema language is also referred to as XML Schema Definition (XSD).

The purpose of an XML Schema is to define the legal building blocks of an XML document:

      • the elements and attributes that can appear in a document
      • the number of (and order of) child elements
      • data types for elements and attributes
      • default and fixed values for elements and attributes

From <http://www.w3schools.com/XML/schema_intro.asp>

Leave a comment