We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byWalter Booker
Modified over 4 years ago
Copyright © 2003 Pearson Education, Inc. Slide 2-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide to XML by Cheryl M. Hughes
Copyright © 2003 Pearson Education, Inc. Slide 2-2 CHAPTER 2 A Closer Look at XML Documents
Copyright © 2003 Pearson Education, Inc. Slide 2-3 XML Syntax “Syntax” refers to the rules of a language Syntax is needed with any language so that the documents created with that language are consistent Programs that process documents expect the syntax rules to be followed, otherwise the document may not be interpreted correctly
Copyright © 2003 Pearson Education, Inc. Slide 2-4 Components of an XML Document XML Declaration Elements Attributes Entities Comments
Copyright © 2003 Pearson Education, Inc. Slide 2-5 Components: The XML Declaration The XML Declaration: Tells the processing program that the document is an XML document, along with other optional information The declaration is always the first line of an XML document Attributes that can be used in the Declaration: version encoding standalone Example:
Copyright © 2003 Pearson Education, Inc. Slide 2-6 Components: XML Elements Elements: Used to describe the data. Consist of: A start tag Content An end tag Example: Content The “root” element of a document is the outermost element, and contains all of the other elements in the document. There can be only one root element in a single document An element that does not contain any content is known as an “empty element”
Copyright © 2003 Pearson Education, Inc. Slide 2-7 Element Nesting The term “nesting” refers to the process of containing elements within other elements Terminology: Child elements – elements that are contained within other elements Parent elements – elements that contain other elements Sibling elements – elements that share the same parent element
Copyright © 2003 Pearson Education, Inc. Slide 2-8 Nesting Example 1 2 Sally 3 Joe 4 5 Larry 6 Curly 7 Mo 8 9
Copyright © 2003 Pearson Education, Inc. Slide 2-9 Components: XML Attributes Attributes help to describe XML elements Attributes are always contained in the start tag of the element they are describing Attributes are known as “name-value pairs” Example: address=“123 Main Street”
Copyright © 2003 Pearson Education, Inc. Slide 2-10 Components: XML Entities Two types of entities: General – placeholders for information contained in the XML document Parameter – used within a DTD to reference a grouping of elements Three types of general entities: Character – used in place of special characters Content – used for blocks of frequently used text Unparsed – used for binary or non-text data, like image files
Copyright © 2003 Pearson Education, Inc. Slide 2-11 Examples of Entities Character entity: Character: > Entity reference: > or > Usage: x > y Content entity: Declaration: Usage: &address; Unparsed entity: Declaration: Usage: &aimage;
Copyright © 2003 Pearson Education, Inc. Slide 2-12 Components: Comments An XML comment is ignored by applications that process XML Comments are commonly used for documentation, or to add information for others viewing the document The content of the comment is surrounded by special comment tags: Example:
Copyright © 2003 Pearson Education, Inc. Slide 2-13 Well-Formed XML Documents A “well-formed” document is one which adheres to the syntax rules for XML: An XML document contains one root element All elements must have start and end tags, except for empty elements Elements must be properly nested All attributes must have a value Attributes can only appear in the start tag and must be unique to that element Element names are case-sensitive Special characters must be written as entities Names of element can start only with letters or an underscore, and can contain letters, numbers, hyphens, periods and underscores
Copyright © 2003 Pearson Education, Inc. Slide 2-14 XML Parsers A “parser” is a program that checks the syntax of an XML document to ensure that the document is well-formed Two types of parsers: Non-validating – only checks for syntax Validating – checks syntax and verifies the document against a DTD or Schema
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
XML 6.3 DTD 6. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes: Elements.
History Leading to XHTML
XHTML1 Building Document Structure. XHTML2 Objectives In this chapter, you will: Learn how to create Extensible Hypertext Markup Language (XHTML) documents.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
XML Introduction What is XML –XML is the eXtensible Markup Language –Became a W3C Recommendation in 1998 –Tag-based syntax, like HTML –You get to make.
Tutorial 11 Creating XML Document
XML Primer. 2 History: SGML vs. HTML vs. XML SGML (1960) XML(1996) HTML(1990) XHTML(2000)
Introduction to XML Rashmi Kukanur. XML XML stands for Extensible Markup Language XML was designed to carry data XML and HTML designed with different.
Document Type Definitions. XML and DTDs A DTD (Document Type Definition) describes the structure of one or more XML documents. Specifically, a DTD describes:
Introducing XHTML: Module B: HTML to XHTML. Goals Understand how XHTML evolved as a language for Web delivery Understand the importance of DTDs Understand.
Copyright © 2003 Pearson Education, Inc. Slide 1-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
Introduction to XML This material is based heavily on the tutorial by the same name at
ECA 228 Internet/Intranet Design I Intro to XML. ECA 228 Internet/Intranet Design I HTML markup language very loose standards browsers adjust for non-standard.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes, Harvard University Extension School — Cambridge, MA The Web Wizard’s Guide.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
© 2019 SlidePlayer.com Inc. All rights reserved.