Presentation is loading. Please wait.

Presentation is loading. Please wait.

XHTML and Forms Review – Page 1CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: Review XHTML and Forms.

Similar presentations


Presentation on theme: "XHTML and Forms Review – Page 1CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: Review XHTML and Forms."— Presentation transcript:

1 XHTML and Forms Review – Page 1CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: Review XHTML and Forms

2 XHTML and Forms Review – Page 2CSCI 2910 – Client/Server-Side Programming Difference Between HTML and XHTML The purpose of HTML tags is to turn on and off formatting. Because of this, it isn't vital to observe rules such as nesting. For example, in HTML, the following code is okay: This paragraph would not be legal in XHTML.

3 XHTML and Forms Review – Page 3CSCI 2910 – Client/Server-Side Programming Difference Between HTML & XHTML (continued) XHTML is an application of HTML that follows the rules of XML The purpose of XML tags is to contain data. If the following document were not properly nested, there would trouble trying to identify the data.

4 XHTML and Forms Review – Page 4CSCI 2910 – Client/Server-Side Programming XML Example Dave Tarnoff tarnoff Abby Betsy Catcher zabc123 David Ebenezer Fletcher zdef456 George Harris Izod zghi789

5 XHTML and Forms Review – Page 5CSCI 2910 – Client/Server-Side Programming Benefits of XHTML over HTML Easy to introduce new elements. (HTML typically only added new elements when IE/Netscape competition resulted in a new tag.) XHTML can be extended beyond predefined elements. More rigorous syntax makes for simpler browser code which is good for products such as cell phones. Better portability across different platforms.

6 XHTML and Forms Review – Page 6CSCI 2910 – Client/Server-Side Programming Differences between HTML & XHTML Documents must be well formed –Must have opening and closing tags for container tags –New format for in-line tags –Must be properly nested Element and attribute names must be in lower case Attribute values must always be in quotations Attribute minimization is not allowed, e.g., NORESIZE must be noresize="noresize" Identify elements using both name and id attributes, e.g.,

7 XHTML and Forms Review – Page 7CSCI 2910 – Client/Server-Side Programming Template for XHTML document <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Simple XHTML Document Hello, World!

8 XHTML and Forms Review – Page 8CSCI 2910 – Client/Server-Side Programming XML Declaration The XML declaration defines the XML version and the character encoding that should be used to interpret the document. Computers store all information as 1's and 0's. There are different ways to represent characters using these 1's and 0's. The character encoding used by a document is the method to use when converting the 1's and 0's into characters.

9 XHTML and Forms Review – Page 9CSCI 2910 – Client/Server-Side Programming DOCTYPE Tag <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> The W3C has defined a document type definition (DTD) to be, "...a collection of declarations that, as a collection, defines the legal structure, elements, and attributes that are available for use in a document that complies to the DTD." The DOCTYPE tag identifies which DTD the browser is supposed to use when displaying the XHTML document.

10 XHTML and Forms Review – Page 10CSCI 2910 – Client/Server-Side Programming Three DTD Types Strict DTD: Adheres exactly to XHTML standard. Transitional DTD: Uses HTML rather than CSS to format page. Allows use of deprecated elements. Allows for widest audience. Frameset DTD: Used when document is partitioned into 2 or more frames.

11 XHTML and Forms Review – Page 11CSCI 2910 – Client/Server-Side Programming XML Namespace and Language The W3C has defined an XML namespace as, "a collection of names, identified by a URI (uniform resource identifier) reference, which is used in XML documents as element types and attribute names." The html tag is used to define the language for the XHTML document (lang="en") and for the XML used (xml:lang="en").


Download ppt "XHTML and Forms Review – Page 1CSCI 2910 – Client/Server-Side Programming CSCI 2910 Client/Server-Side Programming Topic: Review XHTML and Forms."

Similar presentations


Ads by Google