XHTML Interview Questions (2021) - Javatpoint
XHTML Interview Questions (2021) - Javatpoint
1) What is XHTML?
XHTML stands for Extensible Hypertext Markup Language. It is a combination of XML and HTML.
It is a more formal and stricter version of HTML.
That is the reason behind its preferences over HTML because; most of the web pages contain bad
HTML.
The xmlns attribute in <html> is mandatory and must specify the xml namespace for the
document.
<html>, <head>, <title>, and <body> are mandatory with their respective closing tags.
Following are the reasons specifying why XHTML is better than HTML:
XHTML uses style sheets instead of font, color and alignment tags of HTML.
XML of XHTML makes easy the integration of new elements as subsets of SGML.
XHTML validation is a process used to validate XHTML documents with W3C's validator.
XHTML is not very different from HTML 4.01, so you can easily adopt it. You should start to write
your HTML code in lowercase letters.
Let's take an example to show you in XHTML every attribute must have a value.
Example in HTML:
<ol compact> <input type="radio" name="title" value="decline" checked>decline</input>
Same example in XHTML:
<ol compact="compact" > <input type="radio" name="title" value="decline" checked="chec
The decomposition of XHTML into a group of modules that are abstract to provide modularity is
known as XHTML Modularization.
The XHTML modules are utilized in the XML document type definition language.
XHTML modularization specifies a well defined set of XHTML elements which can be compiled and
extended. It supports a specific devise by using standard building blocks and standard methods for
building blocks usage.
Strict DTD
Transitional DTD
Frameset DTD
You can use any of the DTD on the top of the XHTML document.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello World</title>
</head>
<body>
<p>My first Web page.</p>
</body>
</html>
Modular DTD makes it easy to deploy new deployments. An application only supports subset of
XHTML. For example a mobile phone, Internet TV etc. only require a subset of XHTML.
DOM is a platform independent, World Wide Web Consortium (W3C) standard form of
representation of structured documents as an object-oriented model. It is an application
programming interface for accessing HTML and XML documents.