Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor

Similar presentations


Presentation on theme: "Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor"— Presentation transcript:

1 Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor john.d.tullis@us.arthurandersen.com

2 Copyrighted material John Tullis 3/18/2016 page 2 XML Part 4 XML Review The fundamental building blocks of XML consist of: Elements Tags Attributes Entities PCDATA CDATA.

3 Copyrighted material John Tullis 3/18/2016 page 3 XML Part 4 Elements Are the main building blocks of XML. Are declared as Elements with data are declared with the element type within the parenthesis, e.g.: ? CDATA means the element will not be parsed PCDATA means the element will be parsed ANY means that the element may have any content.

4 Copyrighted material John Tullis 3/18/2016 page 4 XML Part 4 Elements Declare a minimum of once occurrence of an element as:. Declare zero or more occurrences of an element: Declare zero or one occurrences of an element: Declaring mixed content: This states that there must be zero or one occurrences of childname1, at least one occurrence of childname2, and some other parsed character data also.

5 Copyrighted material John Tullis 3/18/2016 page 5 XML Part 4 Attributes Provide extra information about elements. Placed inside the start tag of an element. Come in name/value pairs. Example: The element is: img. The attribute name is: src. The value of the attribute is: image1.gif. Must be in quotes.

6 Copyrighted material John Tullis 3/18/2016 page 6 XML Part 4 Attributes In the DTD, attributes are declared within an ATTLIST declaration which has the following form:

7 Copyrighted material John Tullis 3/18/2016 page 7 XML Part 4 Attributes The attribute-type may have the following values: CDATA - character data. (eval|eval|…) - enumerated value. ID - unique identifier. IDREF - the identifier of another element. IDREFS - list of other identifiers. NMTOKEN - a valid XML name. NMTOKENS - a list of valid XML names. ENTITY - an entity. ENTITIES - a list of entities. NOTATION - a notation. xml: - the value is predefined.

8 Copyrighted material John Tullis 3/18/2016 page 8 XML Part 4 Attributes The attribute-default-value may have the following values: #DEFAULT value - has a default value. #REQUIRED - value must be included in the element. #IMPLIED - does not have to be included. #FIXED - value is fixed.

9 Copyrighted material John Tullis 3/18/2016 page 9 XML Part 4 Attributes The default attribute value is used to ensure that an attribute receives a value even if the author of the XML document does not assign a value. DTD example: XML example:

10 Copyrighted material John Tullis 3/18/2016 page 10 XML Part 4 Attributes The implied attribute is used if you do not want to force the XML document author to assign a value, but you don’t have a default value to assign. DTD example: XML example:

11 Copyrighted material John Tullis 3/18/2016 page 11 XML Part 4 Attributes The required attribute is used if you do not have a default value to assign, but you want to force the XML author to assign a value. DTD example: XML example:

12 Copyrighted material John Tullis 3/18/2016 page 12 XML Part 4 Attributes The fixed attribute is used if you do not want to permit the author to change the value of an attribute. DTD example: XML example:

13 Copyrighted material John Tullis 3/18/2016 page 13 XML Part 4 Attributes The enumerated attribute value is used when you want the value to be one of a fixed list of values. DTD example: XML example:

14 Copyrighted material John Tullis 3/18/2016 page 14 XML Part 4 Entities Entities are predominantly used as variables: The internal entity declaration: DTD example: XML example: &author


Download ppt "Copyrighted material John Tullis 3/18/2016 page 1 04/29/00 XML Part 4 John Tullis DePaul Instructor"

Similar presentations


Ads by Google