1432 Introduction to XHTML: Part 1 (Web site templates) Appendix K
1432 Introduction to XHTML: Part 1 Appendix K Good Programming Practice K.1 Assign documents file names that describe their functionality. This practice can help you identify documents faster. It also helps people who want to link to a page, by giving them an easy-to-remember name. For example, if you are writing an XHTML document that contains product information, you might want to call it products.html. Machines running specialized software called a Web server store XHTML documents. Clients (e.g., Web browsers) request specific resources, such as the XHTML documents from the Web server. For example, typing www.deitel.com/books/downloads.htminto a Web browser s address field requests downloads.htmfrom the Web server running at www.deitel.com. This document is located in a directory named books. K.3 First XHTML Example In this appendix and the next, we present XHTML markup and provide screen captures that show how Internet Explorer renders (i.e., displays) the XHTML. Every XHTML document we show has line numbers for the reader s convenience. These line numbers are not part of the XHTML documents. Our first example (Fig. K.1) is an XHTML document named main.html that displays the message Welcome to XHTML!in the browser. The key line in the program is line 14, which tells the browser to display Welcome to XHTML!Now let us consider each line of the program. Lines 1 3 are required in XHTML documents to conform with proper XHTML syntax. For now, copy and paste these lines into each XHTML document you create. The meaning of these lines is discussed in detail in Chapter 18, Extensible Markup Language (XML). Lines 5 6 are XHTML comments. XHTML document creators insert comments to improve markup readability and describe the content of a document. Comments also help other people read and understand an XHTML document s markup and content. Comments do not cause the browser to perform any action when the user loads the XHTML document into the Web browser to view the document. XHTML comments always start with . Each of our XHTML examples includes comments that specify the figure number and file name and provide a brief description of the example s purpose. Subsequent examples include comments in the markup, especially to highlight new features. Good Programming Practice K.2 Place comments throughout your markup. Comments help other programmers understand the markup, assist in debugging and list useful information that you do not want the browser to render. Comments also help you understand your own markup when you revisit a document for modifications or updates in the future. 1 2 4 5 6 7 Fig. K.1 Fig. K.Fig.Fi K.1g. K.11First XHTML example. (Part 1 of 2.) Fig. K.
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.