Question 6 :
Why Code Your Own XHTML?
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 to build a "Hello World" page. With XHTML ?
"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>
Question 8 :
Why XHTML Modularization?
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).
Question 9 :
What about elements that don't have a close tag, such as <IMG> and <hr> ?
There are two solutions. You could use a close tag (e.g. <img src="logo.gif" ...></img>). However the best solution is to simply include a forward slash in the element: <img src="logo.gif" ... />
Will this work?
As long as you include a space before the slash it will cause no problems in most Web browsers - although there have been reports of problems with some embedded HTML viewers such as Java's Swing HTML editor.
Question 10 :
Why do we need modular DTDs?
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.