Presentation is loading. Please wait.

Presentation is loading. Please wait.

WELL- FORMEDNESS CH 6. Objective Well-formedness rules Text in XML Elements and Tags in Atributes Entity references CDATA sections Comments Unicode XML1.1.

Similar presentations


Presentation on theme: "WELL- FORMEDNESS CH 6. Objective Well-formedness rules Text in XML Elements and Tags in Atributes Entity references CDATA sections Comments Unicode XML1.1."— Presentation transcript:

1 WELL- FORMEDNESS CH 6

2 Objective Well-formedness rules Text in XML Elements and Tags in Atributes Entity references CDATA sections Comments Unicode XML1.1 Well-formed HTML

3 What is Well formedness? Well-formedness is the minimum criterion necessary for XML processors and browsers to read files

4 Well-formedness Rules Element must have start <> and tag. e.g. is legal start tag but is not and are legal Element must have at least one character. - is not a legal start-tag and is not a legal end-tag. check your work with an XML parser before distributing them

5 XML document could be any of the following: The result of a query against a database that combines several records from different tables A data structure created in memory by a Java program A data stream created on the fly by a CGI program written in Perl One part of a larger file containing several XML documents

6 XML Documents An XML document is made up of text Sequence of characters with a fixed length that follow certain constraints XML documents are made up of storage units called entities Each entity contains a well-formed document fragment All the entities that make up the document could be store in files or database

7 XML Documents cont… XML declaration - Declaration like this What this mean is that document can be understood completely on their own without reading other file Document need another file XML processors determine which character set is been used

8 Elements and Tags Element names - Every element has a name made up of one or more characters e.g. Name included in the element’s start and end-tags. Element names begin with a letter such as y or A, or an underscore _ Both lower- and uppercase letters may be used in XML names

9 Elements names Legal XML start-tags with legal XML name Not legal XML start tage

10 Elements and Tags cont… Empty-element tags Elements may nest but may not overlap -Elements may contain other elements, however, element cannot overlap. Simply, put if element contain start tag, it must end in end-tag. Example. What the Butler Saw

11 A Simple XML Element Structure What the Butler Saw Joe Orton 1969 The Ideal Husband Oscar Wilde 1895

12 Attributes Elements can have attributes Each attribute of an element is encoded in the start tag of the element as a name-value pair separated by an equals sign (=) and, optionally, some extra white space Atributes names are strings. It can be letter or the underscore(_)

13 Attributes cont… Atributes names may not include white space. Element cannot have two attributes with the same name. e.g. Attribute names are case-sensitive E.g.

14 Attribute values Values of attribute are string. Even if the value is a digit/number correct not correct

15 Comments Hello XML! <!-- Goodbye XML! -->

16 XSLT Sample http://www.learn-xslt-tutorial.com/Flow- Control.cfm#h1.1 http://www.w3schools.com/xsl/xsl_intro.asp


Download ppt "WELL- FORMEDNESS CH 6. Objective Well-formedness rules Text in XML Elements and Tags in Atributes Entity references CDATA sections Comments Unicode XML1.1."

Similar presentations


Ads by Google