• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

XHTML Interview Questions Answers

Question - 11 : - What XHTML does it stand for? How is if different from HTML? Who developed it? ?

Answer - 11 : - XHTML stands for "Extensible HyperText Markup Language". It was developed by the World Wide Web Consortium (W3C) and is now a W3C Recommendation. XHTML is a reformulation of HTML 4 in XML 1.0. This means that the benefits provided by XML will be available to XHTML.

Question - 12 : - Why to type a tags in uppercase, and never bother closing the paragraphs ?

Answer - 12 : - For reasons on internationalisation XML elements are case sensitive. A choice had to be made, and lowercase won on the day. Tags may not overlap This is <em> emphasized text and <b>bold </em>text</b> becomes This is <em>emphasized text </em> is <b>bold text</b> Only certain tags may nest inside other tags Looking at the dtd for xhtml, the definition of the "ol" element is: <!ELEMENT ol (li)+> <!ATTLIST ol %attrs; type %OLStyle; #IMPLIED compact (compact) #IMPLIED start %Number; #IMPLIED > This implies that an order list, "ol", element may not contain paragraph tags or body text, just list items. <ol> These are some of my favorite animals: <li>octopus</li> <li>shrew</li> <li>lemur</li> and my most favorite <li>meerkats</li> </ol> becomes <p>These are some of my favorite animals:</p> <ol> <li>octopus</li> <li>shrew</li> <li>lemur</li> <li>meerkats</li> </ol>  

Question - 13 : - Why do we need modular DTDs?

Answer - 13 : - An application may wish to support only a subset of XHTML. For example a mobile phone, an Internet TV or even a Web-aware cooker may only require a subset of XHTML. Also modularity makes it easier to deploy new developments.

Question - 14 : - Why XHTML?

Answer - 14 : - 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 - 15 : - How To Get Ready For XHTML?

Answer - 15 : - 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 - 16 : - How to writing XHTML demands a clean HTML syntax?

Answer - 16 : - 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 - 17 : - XHTML should be the master storage format for my resources?

Answer - 17 : - NO! XHTML still lacks semantics. Ideally your resources should be stored in an appropriate XML format. XSLT can then be used to convert the resources to XHTML (for Web browsers), WML (for mobile phones), etc. XHTML is a useful intermediate stage.

Question - 18 : - What's about an assumption with XHTML?

Answer - 18 : - Serving XHTML with a MIME type of text/html is wrong. The whole point of XHTML is that it’s XML so that you can benefit from namespaces and the like. If you serve it as text/html, you can’t: In particular, ‘text/html’ is NOT suitable for XHTML Family document types that adds elements and attributes from foreign namespaces, such as XHTML+MathML [XHTML+MathML]. Source: http://www.w3.org/TR/xhtml-media-types/#text-html Two choices: 1. XHTML 1.0 served as application/xhtml+xml to conforming UAs, and text/html to Internet Explorer 2. HTML 4.01, served as text/html XHTML 1.1 is not an option because it mandates a MIME type of application/xhtml+xml which is incompatible with Internet Explorer

Question - 19 : - Any other important new developments?

Answer - 19 : - Yes: XSLT provides a transformation language which can be used to transform XML documents into other formats. XSLT can be used to transform documents from one XML DTD to another, or even to transform an XML document to an alternative format such as RTF or PDF.

Question - 20 : - Can we get down to practicalities. How do I create XHTML pages?

Answer - 20 : - The eGroups XHTML-L Web site provides links to XHTML tools, including conversion tools and editors. A couple of free tools are available (HTML-Kit, 1st Page 2000). Mozquito Factory appears to be the first licensed package on the market. You can expect the usual suspects (Microsoft, Dreamweaver, etc) to bring out new versions of their products with XHTML support.

Computer Contributors

Rajeev Katiyar
Yes Baroda

Share your email for latest updates


Our partners