You are on page 1of 7

XML Difference FAQs-1 1.Difference between XML 1.0 and XML 1.1 S.No 1 XML 1.0 XML 1.

0 compatible. is XML 1.1 backward Unlike XML 1.0, XML 1.1 is forward compatible with the Unicode Standard. XML 1.1 processor is able to process documents that use characters that will be allotted in future versions of the Unicode Standard. XML 1.1 recognizes the characters at the end of line. New text characters have been introduced in order to correct the misalignment that is observed at the end of a line in XML.

In XML 1.0, no text characters are present to interpret the characters that are located at the end of the line.

Normalization and new name In XML 1.1, the NEL character characters are not supported in (0x85) is normalized to a linefeed the XML 1.0 version. in text. Ambiguity always exists in this A new set of control characters are version of XML 1.0 for coding introduced in XML 1.1 to support the characters the characters that are ambiguous.

2.Difference between XML and XSLT S.No 1 XML XSLT

XML is used for storing data in XSLT is used for transforming and a structured format. also for formatting XML file to display the content or to process the content. XML does not perform XSLT is a specialized language transformation of data. that performs transformation of one XML document into a different XML document. XSLT can also perform transformation of XML document into HTML document and XHTML document. XPath is a specialized XSLT will be using XPath for language that is used to transformation and formatting of address portions of the XML XML file. file.

3.Difference between XML and XHTML

S.No 1 2 3



XML is an extensible language XHTML provides both the flexibility but it is not very flexible. and extensibility. XML focuses mainly on the XHTML can interpret the design. languages that are designed badly. XML is used to create new XHTML mainly focuses on mobile internet languages. applications and browsers. It also runs in variety of applications without enforcing any limitation based on the platforms.

Reference: Difference between XML and JSON Difference between XML and JSON S.No 1 XML JSON

Abbreviation: Abbreviation: XML stands for Extensible JSON stands for JavaScript Object Markup Language. Notation. Meaning: XML is a markup language that defines a set of rules for encoding documents in a format that is both humanreadable and machinereadable. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications,all gratis open standards.The design goals of XML emphasize simplicity, generality, and usability over the Internet.It is a textual data format with strong support via Unicode for the languages of the world. Although the design of XML focuses on documents, it is widely used for the representation of arbitrary data structures, for example in web services. Type of format: Meaning: JSON is a text-based open standard designed for humanreadable data interchange. It is derived from the JavaScript scripting language for representing simple data structures and associative arrays, called objects. Despite its relationship to JavaScript, it is languageindependent, with parsers available for many languages.The JSON format is often used for serializing and transmitting structured data over a network connection. It is used primarily to transmit data between a server and web application, serving as an alternative to XML.

Type of format:

Markup language 4 5 Extended from: SGML Developed by: World Wide Web Consortium

Data interchange Extended from: JavaScript Developed by: The JSON format was originally specified by Douglas Crockford for using it at State Software, a company co-founded by Crockford, starting around 2001. Data types: Provides scalar data types and the ability to express structured data through arrays and objects.

Data types: Does not provide any notion of data types. One must rely on XML Schema for adding type information.

Support for arrays: Support for arrays: Arrays have to be expressed Native array support. by conventions, for example through the use of an outer placeholder element that models the arrays contents as inner elements. Typically, the outer element uses the plural form of the name used for inner elements. Support for objects : Support for objects : Objects have to be expressed Native object support. by conventions, often through a mixed use of attributes and elements. Null support: Null support: Requires use of xsi:nil on Natively recognizes the null value. elements in an XML instance document plus an import of the corresponding namespace. Comments: Comments: Native support and usually Not supported. available through APIs. Namespaces : Supports namespaces, which eliminates the risk of name collisions when combining documents. Namespaces also allow existing XML-based standards to be safely extended. Namespaces : No concept of namespaces. Naming collisions are usually avoided by nesting objects or using a prefix in an object member name (the former is preferred in practice).




Formatting decisions : Complex. Requires a greater effort to decide how to map application types to XML elements and attributes. Can create heated debates whether an element-centric or attributecentric approach is better. Size : Documents tend to be lengthy in size, especially when an element-centric approach to formatting is used. Parsing in JavaScript : Requires an XML DOM implementation and additional application code to map text back into JavaScript objects. Learning curve : Generally tends to require use of several technologies in concert: XPath, XML Schema, XSLT, XML Namespaces, the DOM, and so on.

Formatting decisions : Simple. Provides a much more direct mapping for application data. The only exception may be the absence of date/time literal.


Size : Syntax is very terse and yields formatted text where most of the space is consumed (rightly so) by the represented data. Parsing in JavaScript : No additional application code required to parse text; can use JavaScript's eval function. Learning curve : Very simple technology stack that is already familiar to developers with a background in JavaScript or other dynamic programming languages.




Tools : Tools : Enjoys a mature set of tools Rich tool supportsuch as editors widely available from many and formattersis scarce. industry vendors. Microsoft .NET Framework : Very good and mature support since version 1.0 of the .NET Framework. XML support is available as part of the Base Class Library (BCL). For unmanaged environments, there is MSXML. Platform and language : Parsers and formatters are widely available on many platforms and languages (commercial and open source implementations). Microsoft .NET Framework : None so far, except an initial implementation as part of ASP.NET AJAX.



Platform and language : Parsers and formatters are available already on many platforms and in many languages. Consult for a good set of references. Most implementations for now tend to be open source projects. in


Integrated language : Integrated language : Industry vendors are currently Is natively supported

experimenting with support JavaScript/ECMAScript only. literally within languages. See Microsoft's LINQ project for more information.

Reference: Difference between DTD and XSD Difference between DTD and XSD S.No 1 DTD Abbreviation: DTD stands for Type Definition 2 Markup validation: XSD Abbreviation: Document XSD stands Definition for Xml Schema

Markup validation:

Can specify only the root Any global element can be root. No element in the instance ambiguous content support. document. No ambiguous content support. 3 Namespace support : Namespace support :

DTD does not support XSD uses its own set of namespace instead it has its namespaces and elements for own set of keywords for defining the schema. defining a schema example: !DOCTYPE for root tag !ELEMENT for an element !ATTLIST for an attribute !ENTITY for defining variables. 4 Code reuse: Code reuse:

Poorly supported. Can use Can reuse definitions using named parameter entities. types. 5 Datatype Support : Datatype Support :

No real datatype support. DTD Provides flexible set of datatypes. has only #PCDATA as the data type for the elements.(it is 1. primitive / fundamental data used for string datatype) types: string,decimal,float,boolean

2. Custom Data types i. complex type : a data type that contains child elements or attributes and also the mixed contents ii. simple type : a data type that contains only values. Provides multi-field key cross references. No co-occurrence constraints. 6 Datatype Validation: In DTD, no such restrictions Datatype Validation: XSD allows us to specify restriction on data . Example: tag. we can write only digits here. 7 Uses: Uses:

DTD is more suitable for small XSD is used in large XML Data ex: XML Data ADO.NET DataSets, Web ex:bookname,companyname Services. etc. 8 Strongly / Weakly typed: DTD is weaky typed. DTD lacks strong typing capabilities, and has no way of validating the content to data types. Strongly / Weakly typed: XML Schema is strongly typed. An XML Schema can define the data type of certain elements, and even constrain it to within specific lengths or values. This ability ensures that the data stored in the XML document is accurate.

Provisions Definitions:


Inline Provisions of Inline Definitions: XML Schema does not allow inline definitions

DTD allows inline definitions. This is good when working with small files, as it allows us to contain both the content and the schema within the same document, but when it comes to larger documents, this can be a disadvantage, as we pull content every time we retrieve the schema. This can lead to

serious overhead that can degrade performance. Reference: