• +91 9971497814
  • info@interviewmaterial.com

XHTML Interview Questions Answers

Question 1 : How to writing XHTML demands a clean HTML syntax?

Answer 1 : Some More XHTML Syntax Rules: * Attribute names must be in lower case * Attribute values must be quoted * Attribute minimization is forbidden * The id attribute replaces the name attribute * The XHTML DTD defines mandatory elements 1. Attribute Names Must Be In Lower Case: This is wrong: <table WIDTH="100%"> This is correct: <table width="100%"> 2. Attribute Values Must Be Quoted: This is wrong: <table width=100%> This is correct: <table width="100%"> 3. Attribute Minimization Is Forbidden: This is wrong: <input checked> <input readonly> <input disabled> <option selected> <frame noresize> This is correct: <input checked="checked" /> <input readonly="readonly" /> <input disabled="disabled" /> <option selected="selected" /> <frame noresize="noresize" /> Here is a list of the minimized attributes in HTML and how they should be written in XHTML: HTML XHTML compact compact="compact" checked checked="checked" declare declare="declare" readonly readonly="readonly" disabled disabled="disabled" selected selected="selected" defer defer="defer" ismap ismap="ismap" nohref nohref="nohref" noshade noshade="noshade" nowrap nowrap="nowrap" multiple multiple="multiple" noresize noresize="noresize" 4. The id Attribute Replaces The name Attribute: HTML 4.01 defines a name attribute for the elements a, applet, frame, iframe, img, and map. In XHTML the name attribute is deprecated. Use id instead. This is wrong: <img src="picture.gif" name="picture1" /> This is correct: <img src="picture.gif" id="picture1" /> Note: To interoperate with older browsers for a while, you should use both name and id, with identical attribute values, like this: <im

Question 2 : Why is this XSLT important?

Answer 2 : You've heard all the hype about mobile phones and WAP haven't you? How do you think the WAP world, which expects documents to be in WML format, to be populated? Rather than manually creating WML markup, XSLT will enable XHTML documents to be automatically converted to WML.

Question 3 : Differences between XML and HTML

Answer 3 : Since XML and HTML are derived from SGML they are similar, but have the following differences: 1. XML is case-sensitive 2. XML must have quotes (single or double) around attributes 3. Most interpreters of HTML are very forgiving about missing end tags - XML parses are not. 4. Comments start with <-- and end with -->. Inside a comment, "--" may not appear. Although this is fine in html, it confuses xml parsers.

Question 4 : How to build a "Hello World" page. With XHTML ?

Answer 4 : "Hello World" Web page code looks like this: <?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> </p>

Question 5 : What is XHTML?

Answer 5 : 1  XHTML is a more formal, stricter version of HTML. XHTML is defined by an XML dtd which makes it much easier to handle. 2.  * XHTML stands for eXtensible Hyper Text Markup Language. * It is aimed to replace HTML. * It is almost identical to HTML 4.01 * It is the reformulation of HTML 4.01 as an application of XML. * It is a stricter, tidier version of HTML. XHTML 1.0 is the next level of coding as specified by the W3C. XHTML is a transition / combination of HTML and XML. To change from HTML to XHTML requires just a few changes in your coding styles. The main page to check out is CONVERTING but all the others provide valuable information about this coding technique as well. XHTML provides the framework for future extensions of HTML and aims to replace HTML in the future. Some resources refer to XHTML as HTML5. XHTML 1.0 became an official W3C recommendation on January 26, 2000. A W3C recommendation means that the specification is stable, that it has been reviewed by the W3C membership, and that the specification is now a Web standard. XHTML 1.0 is the first step toward a modular and extensible web environment based on XML (eXtensible Markup Language). It provides the bridge for web designers to use a future based coding and still be able to maintain compatibility with today's browsers. XHTML is a stricter and cleaner version of HTML. 3.   * XHTML stands for EXtensible HyperText Markup Language * XHTML is aimed to replace HTML * XHTML is almost identical to HTML 4.01 * XHTML is a stricter and cleaner version of HTML * XHTML is HTML defined as an XML application * XHTML is a W3C Recommendation XHTML is a combination of HTML and XML (EXtensible Markup Language). XHTML consists of all the elements in HTML 4.01 combined with the syntax of XML. Advantages of using XHTML instead of HTML 1. Documents can be validated much easier 2. Documents can be transformed via tools like XSLT into other documents for consumption by devices like handhelds 3. Fragments of documents can be retrieved faster 4. Text can be stored more effieciently in object oriented databases Answer4: The great thing about XHTML, though, is that it is almost the same as HTML

Question 6 : Why Code Your Own XHTML?

Answer 6 : Programs that produce HTML for you often do so badly, often producing Web pages that do things the long way. When you code your pages by hand you have an intimate understanding of what you're doing, and can make the actual size of the Web page file as small as possible. This decreases download times, so your pages load faster and your users are happier. When you use a program to generate HTML for you, you don't get the chance to understand how your page is built internally because it's all done for you. This is not a problem as long as everything works… but what if it doesn't? If you find that your Web page doesn't display properly in Internet Explorer 4, and many of your users use that browser, you're going to have to sort it out. This means forgetting about the program and looking at the code yourself. Will you see the problem? If you've been using the program to code the page for you, when problems occur you probably won't have the knowledge you need to fix them. The Internet is no longer limited to people with computers viewing Websites through one or two different Web browsers. Everything has a Web browser in it these days: mobile phones, televisions, personal digital assistants, cars… even fridges! Blind users "view" Websites using speech synthesis or Braille devices. There is no way you can test each page you produce in all the possible devices on which it may be used. But there is a way to ensure you have the best chance your site will work in most scenarios: to produce pages using the standards laid out by the World Wide Web Consortium (W3C), the people who work on XHTML and other Internet standards. The W3C provide a validation service to check that your page meets the standards, and if it does, it therefore has the best chance of being used on any device.

Question 7 : How is XHTML better than HTML? Why would you want to use XHTML?

Answer 7 : * to be able to take advantage of new coding techniques * problems with the earlier versions have been fixed. XHTML is a fairly close copy of HTML 4.01. Extensibility : Under HTML, the addition of a new group of elements requires alteration of the entire DTD. XML greatly eases the integration of new element collections as it is a subset of SGML itself and specifies it's own DTD. Portability : By the year 2002 as much as 75% of Internet access could be carried out on non-PC platforms such as palm computers, televisions, fridges, automobiles, telephones, etc. In most cases these devices will not have the computing power of a desktop computer, and will not be designed to accommodate ill-formed HTML as do current browsers. Currently, the Netscape browser helps greatly for testing web pages by displaying blank or broken pages when it comes across sloppy coding. IE is the most forgiving browser and will show almost any page no matter the extent of coding errors. While HTML itself isn't completely lacking in extensibility or portability but the evolution of it has been extremely slow compared to the pace of Internet development. This fuels the problems encountered trying to make your pages work on a wide range of browsers and platforms. XHTML will help to remedy those problems.

Question 8 : How To Get Ready For XHTML?

Answer 8 : XHTML is not very different from HTML 4.01, so bringing your code up to the 4.01 standard is a good start. In addition, you should start NOW to write your HTML code in lowercase letters. . The Most Important Differences: * XHTML elements must be properly nested * XHTML documents must be well-formed * Tag names must be in lowercase * All XHTML elements must be closed

Question 9 : Why XHTML?

Answer 9 : XHTML pages can be read by all XML enabled devices AND while waiting for the rest of the world to upgrade to XML supported browsers, XHTML gives you the opportunity to write "well-formed" documents now, that work in all browsers and that are backward browser compatible Since 1990, HTML (or Hyper Text Markup Language) has been the language recommended for creating Web pages. And it has been very successful . But HTML has its problems. Without going into specifics, as it's not the subject of this article, HTML has become a mess. To sort this mess out, in 1999 the World Wide Web Consortium came up with XHTML. XHTML stands for eXtended Hyper Text Markup Language, and is written in a language called XML or eXtended Markup Language. As the name implies, XHTML has the capability to be extended. You can use extra modules to do things with your pages that weren't possible with HTML. The long-term goal is that your Web pages will be able to be understood by computers as well as humans. How does this work? Allow me to explain. You may be thinking that computers already understand Web pages because you use a computer to view them. This is true. But computers only understand how to display your pages, not what they mean. Imagine if computers did understand what Web pages meant! You could tell your computer to go and visit all of your local supermarket's Websites and report back to you on which store is the cheapest for this week's shopping. Your computer could visit the news sites around the world and bring back the latest headlines that relate to things you're interested in. The possibilities are endless.

Question 10 : Why XHTML Modularization?

Answer 10 : The XHTML modularization model defines the modules of XHTML. XHTML is a simple, but large language. XHTML contains most of the functionality a web developer will need. For some purposes XHTML is too large and complex, and for other purposes it is much too simple. By splitting XHTML into modules, the W3C (World Wide web Consortium) has created small and well-defined sets of XHTML elements that can be used separately for simple devices as well as combined with other XML standards into larger and more complex applications. With modular XHTML, product and application designers can: * Choose the elements to be supported by a device using standard XHTML building blocks. * Add extensions to XHTML, using XML, without breaking the XHTML standard. * Simplify XHTML for devices like hand held computers, mobile phones, TV, and home appliances. * Extend XHTML for complex applications by adding new XML functionality (like MathML, SVG, Voice and Multimedia). * Define XHTML profiles like XHTML Basic (a subset of XHTML for mobile devices).

XHTML Contributors

krishan

Share your email for latest updates

Name:
Email:

Our partners