Thursday, January 22, 2015

HTML5 Interview Questions and Answers Part 1

What is the relationship between SGML,HTML , XML and HTML? SGML (Standard generalized markup language) is a standard which tells how to specify document markup. It’s only a Meta language which describes how a document markup should be. HTML is a markup language which is described using SGML. So by SGML they created DTD which the HTML refers and needs to adhere to the same. So you will always find “DOCTYPE” attribute at the top of HTML page which defines which DTD is used for parsing purpose.


Now parsing SGML was a pain so they created XML to make things better. XML uses SGML. For example in SGML you have to start and end tags but in XML you can have closing tags which close automatically (“”). XHTML was created from XML which was used in HTML 4.0. So for example in SGML derived HTML “ ” is not valid but in XHTML it’s valid. You can refer XML DTD as shown in the below code snippet.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.