Unformatted text preview:

Introducing XHTML: Module B: HTML to XHTMLGoalsThe Evolution of XHTMLSlide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10The Basics of XMLSlide 12Slide 13The XML DeclarationSlide 15Slide 16Parsing XML DocumentsSlide 18Slide 19Writing Well-Formed DocumentsSlide 21All XML Documents Must Have a Root ElementSlide 23XML is Case SensitiveSlide 25All XML Elements Must Have Closing TagsSlide 27XML Elements Must Be Properly NestedSlide 29Attribute Values Must Appear Within Quotation MarksEmpty Elements Must Be ClosedSlide 32Slide 33Combining XML and HTMLSlide 35Slide 36Slide 37ResourcesQuestions?Fundamentals of Web DesignCopyright ©2004  Department of Computer & Information ScienceIntroducing XHTML:Module B: HTML to XHTMLFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceGoals•Understand how XHTML evolved as a language for Web delivery•Understand the importance of DTDs•Understand how to validate XML/XHTML markup•Understand how XML/XHTML differ from HTMLFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Evolution of XHTML•The Web is expanding to other media, called user agents, which are devices that are capable of retrieving and processing HTML and XHTML documentsFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Evolution of XHTML•A user agent can be a traditional Web browser or a device such as a mobile phone or PDA, or even an application that simply collects and processes data instead of displaying it•HTML is not suitable for user agents other than Web browsersFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Evolution of XHTML•HTML has evolved into a markup language that is more concerned with how data appears than with the data itself•Current and older versions of Web browsers allow you to write sloppy HTML codeFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Evolution of XHTML•Languages based on SGML use a Document Type Definition, or DTD, to define the tags and attributes that you can use in a document, and the rules the document must follow when it includes themFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Evolution of XHTML•When a document conforms to an associated DTD, it is said to be valid•When a document does not conform to an associated DTD, it is said to be invalidFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Evolution of XHTML•You can check whether a document conforms to an associated DTD by using a program called a validating parserFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Evolution of XHTML•Because HTML is based on SGML, it requires a DTD, and the HTML DTD is built directly into Web browsers•When a Web browser opens an HTML document, it first compares the document to the DTDFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Evolution of XHTML•If an HTML document is missing any required tags, the HTML DTD supplies them, allowing the Web browser to render the page correctlyFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Basics of XML•Extensible Markup Language, or XML, is used for creating Web pages and defining and transmitting data between applications•Like HTML, XML is based on SGMLFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Basics of XML•Version 1.0 of XML achieved recommendation status by the W3C in 1998 and was still current at the time of this writingFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe Basics of XML•In XML you refer to a tag pair and the data it contains as an element•All elements must have an opening and a closing tag•The data contained within an element’s opening and closing tags is referred to as its contentFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe XML Declaration•XML documents should begin with an XML declaration•Specifies the version of XML being usedFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe XML Declaration•Not required to include an XML declaration because currently only one version of XML exists, version 1.0•The encoding attribute of the XML declaration designates the language used by the XML documentFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceThe XML Declaration•It’s a good practice to always include the XML declaration because XML will almost certainly evolve into other versions that will contain features not found in version 1.0Fundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceParsing XML Documents•When a document adheres to XML’s syntax rules, it is said to be well formed•You will study XML’s rules for writing well formed documentsFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceParsing XML Documents•You use a program called a parser to check whether an XML document is well formed•Two types of parsers: non-validating and validatingFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceParsing XML Documents•A non-validating parser simply checks whether an XML document is well formed•A validating parser checks whether an XML document is well formed and if it conforms to an associated DTDFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceWriting Well-Formed Documents•Well-formed XML documents allow user agents to read the document’s data easilyFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceWriting Well-Formed Documents•User agents expect XML data to be structured according to specific rules, which allows the user agent to read data quickly without having to decipher the data structureFundamentals of Web DevelopmentCopyright ©2004  Department of Computer & Information ScienceAll XML Documents Must Have a Root Element•A root element contains all the other elements


View Full Document

IUPUI CS N100 - Module B: HTML to XHTML

Documents in this Course
Load more
Download Module B: HTML to XHTML
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Module B: HTML to XHTML and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Module B: HTML to XHTML 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?