SlideShare a Scribd company logo
1 of 20
XML For Dummies Book Author : Lucinda Dykes & Ed Tittle Slides Prepared By: Son TN Chapter 4 : Adding XTHML for the Web
Contents HTML, XML, and XHTML Comparing XML and HTML XHTML Makes the Move to XML Syntax Convert a document from HTML to XHTML The Role of DOCTYPE Declarations
4.1. HTML, XML, and XHTML HTML, XHTML, and XML represent stages in the development of markup languages. HTML, designed to display content in Web browsers, came first. XML, intended for data exchange, came next. XHTML — which uses the markup tags of HTML and the strict syntax of XML.
4. 1.1 What HTML does best HTML makes our Web world look pretty. Such as a personal site that you create for your family. Most Web sites use straight HTML to display data
4. 1.2 The limits of HTML HTML was enlisted to perform some pretty specify tasks. Allow tight control over document display. Provide the flexibility to describe different, specific types of information and data. Convey information from a variety of media and in a various formats. Define complex linking relationships between document. Publish a single set of information cross a variety of media. Two overarching problems prevent Web designers from achieving this control with HTML: HTML lacks fine controls. Not include mechanisms for the control. … Display vary. Problems with browsers that users view web pages (IE, Firefox…) …
4. 2. Comparing XML and HTML XML and HTML are not the same kind of markup language. But XML and HTML both derive from the same parent SGML. So they must be similar, right ? HTML and XML both use tags and attributes. XML and HTML look similar. HTML defines basic text elements and includes defaults (and more explicit controls) for how text may be displayed in a browser window XML tells us only what each element means. XML says nothing about how elements should or must be displayed — XML separates content and the presentation of that content.
4.2.1 Using XML to describe data XML is not limited to any fixed set of tagsor element types. You can define your own sets of elements and even your own attributes that you may then use within your documents. XML Document HTML Document <html> <p> Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah (XML) blobbity blobbity blobitty blah blah blah blah. blah blah blah </p> <p> Blah blah blah Lucinda Dykes blah Ed Tittel. </p> </html> <Cover> <Abstract> This book is about the foundations of the Extensible Markup Language (XML) and how to use it for your own applications. </Abstract> <AuthorInfo> The authors are <Author>Lucinda Dykes</Author> and <Author>Ed Tittel</Author>. </AuthorInfo> </Cover>
4. 2.2 The benefits of using HTML  It’s quick, easy, and cheap. HTML is way easier than the alternative. Anyone can create an HTML document by using a text editor and a little knowledge. Even if you don’t know HTML, you can use an HTML editor — a What You See Is What You Get-style (that is, WYSIWYG-style) editor such as FrontPage or Dreamweaver — to produce readable Web pages in minutes.
4. 2.3 The benefits of using XML XML seems to be brimming with benefits. Unlimited element Structured data Data exchange XML complements HTML XML documents are well formed Self-describing Search engines Updates User-selected view of data Intelligent XML-based pages that contain human-readable data offer exciting potential for users. A Web designer/developer reaps several benefits from XML as well. ,[object Object],[object Object]
4. 3.1 Making the switch Making the switch from HTML to XHTML means mastering the rules of XHTML — in particular, XML syntax and structure. You have only a few major rules to get under your belt, but you have to follow them if you want to create a valid XHTML document.  Every tag in an XHTML document must be closed. Empty elements (elements without content, such as a br tag) must be correctly formatted with a closing slash. All tags must be nested correctly — the tag you open last must be the tag you close first All XHTML tags must be written using only lowercase. All attribute values must be put in quotation marks. An acceptable XML document must be well formed.
4. 3.2 Every element must be closed That all nonempty elements (that is, those that contain actual text) must have a start tag and an end tag. In the case of HTML Doing without an end tag just doesn’t fly in XHTML. You have to add closing paragraph tags where they belong if you want the resulting lines to work right. Is the same as <p>text text text <p>text text text</p>
4. 3.3 Empty elements must be formatted correctly All nonempty XML elements must use both a start tag and an end tag to be correct. An empty element is a singleton tag (also called an empty tag) that hangs around by itself. Empty tags in HTML include the <br>, <hr>, and <img> tags. The hr element looks like this in HTML: In XHTML, it looks like this: <hr> <hr />
4. 3.4 Tags must be properly nested The rules of XHTML syntax say that tags must be nested in the correct order. The rule is always to close first what you opened last, working your way from the inside to the outside tags.  Ill formed <p>This book was written by <i><b>Dan Brown</i></b>. Well-formed <p>This book was written by <i><b>Dan Brown</b></i>.</p>
4. 3.5 Case makes a difference HTML is not case sensitive; XHTML is. When you use HTML, it doesn’t matter what case you use for elements and attributes. For example, for the opening body tag, you can use <BODY>, <body>, or even <Body> they all work fine. XHTML, on the other hand, is a bit more finicky about case. All XHTML elements and attribute names must be in lowercase or your page won’t validate. Use any case for the value of an attribute
4. 3.6 Attribute values are in quotation marks In XHTML, all attribute values must be in quotation marks. The following markup works just fine on an HTML page: You have to add quotation marks around the attribute value to create valid XHTML. Table 4-1 highlights the major rules for XHTML syntax and shows how markup looks in HTML and XHTML. <tr align=right> <tr align=”right”>
4. 4. Converting a documentfrom HTML to XHTML
4. 4. Converting a documentfrom HTML to XHTML
4. 5. The Role of DOCTYPE Declarations The DOCTYPE declaration serves several purposes: It allows your page to be validated as XHTML. It tells the browser which version of which markup language you used to create the page and references the specific DTD for that language. It enables your page to be displayed properly in Web-standards-compliant browsers. You have three different DOCTYPES to choose among for an XHTML 1.0 document: strict, transitional, and frames.
4.6 Summary Understanding the limitations of HTML Comparing HTML with XML Getting the best of both worlds: XHTML Converting HTML to XHTML
Xml For Dummies   Chapter 4 Adding Xhtml For The Web

More Related Content

What's hot

Week1 xml
Week1 xmlWeek1 xml
Week1 xml
hapy
 
Tutorial 08 - Creating Effective Web Pages
Tutorial 08 - Creating Effective Web PagesTutorial 08 - Creating Effective Web Pages
Tutorial 08 - Creating Effective Web Pages
guest22edf3
 
Tutorial 8 - Creating Effective Web Pages
Tutorial 8 - Creating Effective Web PagesTutorial 8 - Creating Effective Web Pages
Tutorial 8 - Creating Effective Web Pages
dpd
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
yht4ever
 

What's hot (20)

Introduction to XHTML
Introduction to XHTMLIntroduction to XHTML
Introduction to XHTML
 
Xhtml
XhtmlXhtml
Xhtml
 
Web Application and HTML Summary
Web Application and HTML SummaryWeb Application and HTML Summary
Web Application and HTML Summary
 
html tags
html tagshtml tags
html tags
 
Diva
DivaDiva
Diva
 
Lecture1
Lecture1Lecture1
Lecture1
 
Xml 150323102007-conversion-gate01
Xml 150323102007-conversion-gate01Xml 150323102007-conversion-gate01
Xml 150323102007-conversion-gate01
 
Week1 xml
Week1 xmlWeek1 xml
Week1 xml
 
Tutorial 08 - Creating Effective Web Pages
Tutorial 08 - Creating Effective Web PagesTutorial 08 - Creating Effective Web Pages
Tutorial 08 - Creating Effective Web Pages
 
Xhtml
XhtmlXhtml
Xhtml
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
 
html
htmlhtml
html
 
Xml description
Xml descriptionXml description
Xml description
 
HTML Basic Tags
HTML Basic Tags HTML Basic Tags
HTML Basic Tags
 
HTML 5 Topic 2
HTML 5 Topic 2HTML 5 Topic 2
HTML 5 Topic 2
 
HTML5 Topic 1
HTML5 Topic 1HTML5 Topic 1
HTML5 Topic 1
 
Tutorial 8 - Creating Effective Web Pages
Tutorial 8 - Creating Effective Web PagesTutorial 8 - Creating Effective Web Pages
Tutorial 8 - Creating Effective Web Pages
 
Tm 1st quarter - 1st meeting
Tm   1st quarter - 1st meetingTm   1st quarter - 1st meeting
Tm 1st quarter - 1st meeting
 
Web Development Course - XML by RSOLUTIONS
Web Development Course - XML by RSOLUTIONSWeb Development Course - XML by RSOLUTIONS
Web Development Course - XML by RSOLUTIONS
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 

Viewers also liked

X Gripe A Grp6
X Gripe A Grp6X Gripe A Grp6
X Gripe A Grp6
ap8cgrp6
 
XHTML+ CSS
XHTML+ CSSXHTML+ CSS
XHTML+ CSS
justmas
 
Xedapp demo - Excel sheet updates using Xedapp
Xedapp demo  - Excel sheet updates using XedappXedapp demo  - Excel sheet updates using Xedapp
Xedapp demo - Excel sheet updates using Xedapp
Xedapp
 
Xmas Time Czapi - 2007
Xmas Time Czapi - 2007Xmas Time Czapi - 2007
Xmas Time Czapi - 2007
JH4
 

Viewers also liked (20)

Xd A10000 Wb
Xd A10000 WbXd A10000 Wb
Xd A10000 Wb
 
Xoopit: Greasemonkey + JS (SF JS #3)
Xoopit: Greasemonkey + JS (SF JS #3)Xoopit: Greasemonkey + JS (SF JS #3)
Xoopit: Greasemonkey + JS (SF JS #3)
 
Xmascardio
XmascardioXmascardio
Xmascardio
 
X La Gui
X La GuiX La Gui
X La Gui
 
XFT Promotion Tool presentation
XFT Promotion Tool presentationXFT Promotion Tool presentation
XFT Promotion Tool presentation
 
X Gripe A Grp6
X Gripe A Grp6X Gripe A Grp6
X Gripe A Grp6
 
Xiang Ming Zeng
Xiang Ming ZengXiang Ming Zeng
Xiang Ming Zeng
 
Xe Nang
Xe NangXe Nang
Xe Nang
 
Xmas2008
Xmas2008Xmas2008
Xmas2008
 
XHTML+ CSS
XHTML+ CSSXHTML+ CSS
XHTML+ CSS
 
Xeupc08b
Xeupc08bXeupc08b
Xeupc08b
 
XMPP - Beyond IM
XMPP - Beyond IMXMPP - Beyond IM
XMPP - Beyond IM
 
Xoay Rubiv
Xoay RubivXoay Rubiv
Xoay Rubiv
 
XO Enterprise SIP
XO Enterprise SIPXO Enterprise SIP
XO Enterprise SIP
 
Xi voices part i
Xi voices part iXi voices part i
Xi voices part i
 
Xin Ghi On
Xin Ghi OnXin Ghi On
Xin Ghi On
 
Xedapp demo - Excel sheet updates using Xedapp
Xedapp demo  - Excel sheet updates using XedappXedapp demo  - Excel sheet updates using Xedapp
Xedapp demo - Excel sheet updates using Xedapp
 
Xmas Time Czapi - 2007
Xmas Time Czapi - 2007Xmas Time Czapi - 2007
Xmas Time Czapi - 2007
 
xkp showcase
xkp showcasexkp showcase
xkp showcase
 
XMediaLab Sydney 2010 (Scott & Rob)
XMediaLab Sydney 2010 (Scott & Rob)XMediaLab Sydney 2010 (Scott & Rob)
XMediaLab Sydney 2010 (Scott & Rob)
 

Similar to Xml For Dummies Chapter 4 Adding Xhtml For The Web

Introdution to HTML
Introdution to HTMLIntrodution to HTML
Introdution to HTML
yashh1402
 
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
phanleson
 

Similar to Xml For Dummies Chapter 4 Adding Xhtml For The Web (20)

Xhtml
XhtmlXhtml
Xhtml
 
XML
XMLXML
XML
 
Session 1
Session 1Session 1
Session 1
 
Introdution to HTML
Introdution to HTMLIntrodution to HTML
Introdution to HTML
 
Xml material
Xml materialXml material
Xml material
 
Xml material
Xml materialXml material
Xml material
 
Xml material
Xml materialXml material
Xml material
 
Computer fundamentals-internet p2
Computer fundamentals-internet p2Computer fundamentals-internet p2
Computer fundamentals-internet p2
 
Html presentation
Html presentationHtml presentation
Html presentation
 
Xml tutorial
Xml tutorialXml tutorial
Xml tutorial
 
Xml 1
Xml 1Xml 1
Xml 1
 
XML
XMLXML
XML
 
Class2
Class2Class2
Class2
 
xml.pptx
xml.pptxxml.pptx
xml.pptx
 
xml introduction in web technologies subject
xml introduction in web technologies subjectxml introduction in web technologies subject
xml introduction in web technologies subject
 
Vskills certified html5 developer Notes
Vskills certified html5 developer NotesVskills certified html5 developer Notes
Vskills certified html5 developer Notes
 
O9xml
O9xmlO9xml
O9xml
 
Introduction to HTML.pptx
Introduction to HTML.pptxIntroduction to HTML.pptx
Introduction to HTML.pptx
 
XML - Extensible Markup Language for Network Security.pptx
XML - Extensible Markup Language for Network Security.pptxXML - Extensible Markup Language for Network Security.pptx
XML - Extensible Markup Language for Network Security.pptx
 
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...Xml For Dummies   Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
Xml For Dummies Chapter 8 Understanding And Using Dt Ds it-slideshares.blog...
 

More from phanleson

Lecture 1 - Getting to know XML
Lecture 1 - Getting to know XMLLecture 1 - Getting to know XML
Lecture 1 - Getting to know XML
phanleson
 

More from phanleson (20)

Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Spark
 
Firewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth FirewallsFirewall - Network Defense in Depth Firewalls
Firewall - Network Defense in Depth Firewalls
 
Mobile Security - Wireless hacking
Mobile Security - Wireless hackingMobile Security - Wireless hacking
Mobile Security - Wireless hacking
 
Authentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless ProtocolsAuthentication in wireless - Security in Wireless Protocols
Authentication in wireless - Security in Wireless Protocols
 
E-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server AttacksE-Commerce Security - Application attacks - Server Attacks
E-Commerce Security - Application attacks - Server Attacks
 
Hacking web applications
Hacking web applicationsHacking web applications
Hacking web applications
 
HBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table designHBase In Action - Chapter 04: HBase table design
HBase In Action - Chapter 04: HBase table design
 
HBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - OperationsHBase In Action - Chapter 10 - Operations
HBase In Action - Chapter 10 - Operations
 
Hbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBaseHbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBase
 
Learning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlibLearning spark ch11 - Machine Learning with MLlib
Learning spark ch11 - Machine Learning with MLlib
 
Learning spark ch10 - Spark Streaming
Learning spark ch10 - Spark StreamingLearning spark ch10 - Spark Streaming
Learning spark ch10 - Spark Streaming
 
Learning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQLLearning spark ch09 - Spark SQL
Learning spark ch09 - Spark SQL
 
Learning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a ClusterLearning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a Cluster
 
Learning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark ProgrammingLearning spark ch06 - Advanced Spark Programming
Learning spark ch06 - Advanced Spark Programming
 
Learning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your DataLearning spark ch05 - Loading and Saving Your Data
Learning spark ch05 - Loading and Saving Your Data
 
Learning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value PairsLearning spark ch04 - Working with Key/Value Pairs
Learning spark ch04 - Working with Key/Value Pairs
 
Learning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with SparkLearning spark ch01 - Introduction to Data Analysis with Spark
Learning spark ch01 - Introduction to Data Analysis with Spark
 
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about LibertagiaHướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
Hướng Dẫn Đăng Ký LibertaGia - A guide and introduciton about Libertagia
 
Lecture 1 - Getting to know XML
Lecture 1 - Getting to know XMLLecture 1 - Getting to know XML
Lecture 1 - Getting to know XML
 
Lecture 2 - Using XML for Many Purposes
Lecture 2 - Using XML for Many PurposesLecture 2 - Using XML for Many Purposes
Lecture 2 - Using XML for Many Purposes
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Xml For Dummies Chapter 4 Adding Xhtml For The Web

  • 1. XML For Dummies Book Author : Lucinda Dykes & Ed Tittle Slides Prepared By: Son TN Chapter 4 : Adding XTHML for the Web
  • 2. Contents HTML, XML, and XHTML Comparing XML and HTML XHTML Makes the Move to XML Syntax Convert a document from HTML to XHTML The Role of DOCTYPE Declarations
  • 3. 4.1. HTML, XML, and XHTML HTML, XHTML, and XML represent stages in the development of markup languages. HTML, designed to display content in Web browsers, came first. XML, intended for data exchange, came next. XHTML — which uses the markup tags of HTML and the strict syntax of XML.
  • 4. 4. 1.1 What HTML does best HTML makes our Web world look pretty. Such as a personal site that you create for your family. Most Web sites use straight HTML to display data
  • 5. 4. 1.2 The limits of HTML HTML was enlisted to perform some pretty specify tasks. Allow tight control over document display. Provide the flexibility to describe different, specific types of information and data. Convey information from a variety of media and in a various formats. Define complex linking relationships between document. Publish a single set of information cross a variety of media. Two overarching problems prevent Web designers from achieving this control with HTML: HTML lacks fine controls. Not include mechanisms for the control. … Display vary. Problems with browsers that users view web pages (IE, Firefox…) …
  • 6. 4. 2. Comparing XML and HTML XML and HTML are not the same kind of markup language. But XML and HTML both derive from the same parent SGML. So they must be similar, right ? HTML and XML both use tags and attributes. XML and HTML look similar. HTML defines basic text elements and includes defaults (and more explicit controls) for how text may be displayed in a browser window XML tells us only what each element means. XML says nothing about how elements should or must be displayed — XML separates content and the presentation of that content.
  • 7. 4.2.1 Using XML to describe data XML is not limited to any fixed set of tagsor element types. You can define your own sets of elements and even your own attributes that you may then use within your documents. XML Document HTML Document <html> <p> Blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah (XML) blobbity blobbity blobitty blah blah blah blah. blah blah blah </p> <p> Blah blah blah Lucinda Dykes blah Ed Tittel. </p> </html> <Cover> <Abstract> This book is about the foundations of the Extensible Markup Language (XML) and how to use it for your own applications. </Abstract> <AuthorInfo> The authors are <Author>Lucinda Dykes</Author> and <Author>Ed Tittel</Author>. </AuthorInfo> </Cover>
  • 8. 4. 2.2 The benefits of using HTML It’s quick, easy, and cheap. HTML is way easier than the alternative. Anyone can create an HTML document by using a text editor and a little knowledge. Even if you don’t know HTML, you can use an HTML editor — a What You See Is What You Get-style (that is, WYSIWYG-style) editor such as FrontPage or Dreamweaver — to produce readable Web pages in minutes.
  • 9.
  • 10. 4. 3.1 Making the switch Making the switch from HTML to XHTML means mastering the rules of XHTML — in particular, XML syntax and structure. You have only a few major rules to get under your belt, but you have to follow them if you want to create a valid XHTML document.  Every tag in an XHTML document must be closed. Empty elements (elements without content, such as a br tag) must be correctly formatted with a closing slash. All tags must be nested correctly — the tag you open last must be the tag you close first All XHTML tags must be written using only lowercase. All attribute values must be put in quotation marks. An acceptable XML document must be well formed.
  • 11. 4. 3.2 Every element must be closed That all nonempty elements (that is, those that contain actual text) must have a start tag and an end tag. In the case of HTML Doing without an end tag just doesn’t fly in XHTML. You have to add closing paragraph tags where they belong if you want the resulting lines to work right. Is the same as <p>text text text <p>text text text</p>
  • 12. 4. 3.3 Empty elements must be formatted correctly All nonempty XML elements must use both a start tag and an end tag to be correct. An empty element is a singleton tag (also called an empty tag) that hangs around by itself. Empty tags in HTML include the <br>, <hr>, and <img> tags. The hr element looks like this in HTML: In XHTML, it looks like this: <hr> <hr />
  • 13. 4. 3.4 Tags must be properly nested The rules of XHTML syntax say that tags must be nested in the correct order. The rule is always to close first what you opened last, working your way from the inside to the outside tags. Ill formed <p>This book was written by <i><b>Dan Brown</i></b>. Well-formed <p>This book was written by <i><b>Dan Brown</b></i>.</p>
  • 14. 4. 3.5 Case makes a difference HTML is not case sensitive; XHTML is. When you use HTML, it doesn’t matter what case you use for elements and attributes. For example, for the opening body tag, you can use <BODY>, <body>, or even <Body> they all work fine. XHTML, on the other hand, is a bit more finicky about case. All XHTML elements and attribute names must be in lowercase or your page won’t validate. Use any case for the value of an attribute
  • 15. 4. 3.6 Attribute values are in quotation marks In XHTML, all attribute values must be in quotation marks. The following markup works just fine on an HTML page: You have to add quotation marks around the attribute value to create valid XHTML. Table 4-1 highlights the major rules for XHTML syntax and shows how markup looks in HTML and XHTML. <tr align=right> <tr align=”right”>
  • 16. 4. 4. Converting a documentfrom HTML to XHTML
  • 17. 4. 4. Converting a documentfrom HTML to XHTML
  • 18. 4. 5. The Role of DOCTYPE Declarations The DOCTYPE declaration serves several purposes: It allows your page to be validated as XHTML. It tells the browser which version of which markup language you used to create the page and references the specific DTD for that language. It enables your page to be displayed properly in Web-standards-compliant browsers. You have three different DOCTYPES to choose among for an XHTML 1.0 document: strict, transitional, and frames.
  • 19. 4.6 Summary Understanding the limitations of HTML Comparing HTML with XML Getting the best of both worlds: XHTML Converting HTML to XHTML