32
Unit 10 Unit 10 Schema Data Processing Schema Data Processing

Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Embed Size (px)

Citation preview

Page 1: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Unit 10Unit 10

Schema Data Schema Data ProcessingProcessing

Page 2: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Key ConceptsKey Concepts• XML fundamentals• XML document format• Document declaration• XML elements and attributes• Parsing• Reserved characters• CDATA• Schema fundamentals• Schema elements• Schema attributes and data types• XPath fundamentals• XPath tree

Page 3: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

XML FundamentalsXML Fundamentals• Stored as text files.• Can be created with any text editor.• Hierarchical data storage format.• Must contain at least one (root)

element.• File names end in .xml extension by

default, but vary with use.

Page 4: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Sample XML DocumentSample XML Document• XML How to Program, Figure 5.1, pg.

112

Page 5: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Key PointsKey Points• Elements are enclosed in angle

brackets <>.• The root element is the first element

opened and last element closed.• Inner elements in the hierarchy are

called child elements.

Page 6: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Common Programming Common Programming ErrorsErrors

• Attempting to create more than one root element.

• Not adhering to case on element tags.

• Improper nesting.

Page 7: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Improper NestingImproper Nesting<?xml version = "1.0"?>

<myRoot>

<x><y>

Hello World

</x></y>

</myRoot>

Page 8: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

XML ParsingXML Parsing• XML How to Program, Figure 5.2, pg.

113

Page 9: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Parsing FailureParsing Failure• XML How to Program, Figure 5.3, pg.

114

Page 10: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

CharactersCharacters• Supports ASCII and Unicode

characters• Markup text is enclosed in angle

brackets• Character data is inserted between

tags• White space characters include

spaces, line feeds, and carriage returns.

Page 11: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Reserved CharactersReserved Characters• Reserved for use by

XML– Ampersand (&)– Left angle bracket

(<)– Right angle bracket

(>)– Apostrophe (')– Double quote (")

• Built-in entities– Ampersand (&amp;)

• Built-in entities– Ampersand (&amp;)– Left angle bracket

(&lt;)– Right angle bracket

(&gt;)– Apostrophe

(&apos;)– Double quote

(&quot;)

Page 12: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Book SampleBook Sample• XML How to Program, Figure 5.5, pg.

119• Put just the markup code (text) here.

Page 13: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Book Sample (cont'd)Book Sample (cont'd)• XML How to Program, Figure 5.5, pg.

119• Put just the graphic here.

Page 14: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

CDATA ExampleCDATA Example• XML How to Program, Figure 5.7, pg.

122-123• Put just the markup code (text) here.

Page 15: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

CDATA Example (cont'd)CDATA Example (cont'd)• XML How to Program, Figure 5.7, pg.

122-123• Put just the graphic here.

Page 16: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Schema ElementsSchema Elements• XML How to Program, Figure 7.1, pg.

168.

Page 17: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Sample DocumentSample Document• XML How to Program, Figure 7.2, pg.

170, text only.

Page 18: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

ElementType AttributesElementType Attributes• XML How to Program, Figure 7.4 and

7.5, pg. 172-173.

Page 19: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

element and group element and group AttributesAttributes

• XML How to Program, Figure 7.6 and 7.7, pg. 173-174

Frank Miller
Keep lower case
Page 20: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

AttributeType AttributesAttributeType Attributes• XML How to Program, Figure 7.8, pg.

174.

Page 21: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Schema Sample with Schema Sample with AttributesAttributes

• XML How to Program, Figure 7.10, pg. 175-176.

• Break at line 22 to make two slides.

Page 22: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Schema Sample with Schema Sample with Attributes (cont'd)Attributes (cont'd)

• XML How to Program, Figure 7.10, pg. 175-176.

• Break at line 22 to make two slides.

Page 23: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Sample DocumentSample Document• XML How to Program, Figure 7.11, pg.

176-177, text only.

Page 24: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Example Data TypesExample Data Types• XML How to Program, Figure 7.12, pg.

177-178.

Page 25: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Schema Sample with Data Schema Sample with Data TypesTypes

• XML How to Program, Figure 7.13, pg. 178-179.

• Break at line 15 to make two slides.

Page 26: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Schema Sample with Data Schema Sample with Data Types (cont'd)Types (cont'd)

• XML How to Program, Figure 7.13, pg. 178-179.

• Break at line 15 to make two slides.

Page 27: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

Sample Document with Data Sample Document with Data Types Types

• XML How to Program, Figure 7.14, pg. 179-180, text only.

Page 28: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

XPath FundamentalsXPath Fundamentals• Represents XML document as nodes.• XPath structures document as

hierarchical tree.• Supports document navigation and

data retrieval.

Page 29: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

XPath Node TypesXPath Node Types• XML How to Program, Figure 11.5, pg.

304. It may be necessary to break into two slides.

Page 30: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

XML Document ExampleXML Document Example• XML How to Program, Figure 11.1, pg.

299

Page 31: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

XPath TreeXPath Tree• XML How to Program, Figure 11.2, pg.

300

Page 32: Unit 10 Schema Data Processing. Key Concepts XML fundamentals XML document format Document declaration XML elements and attributes Parsing Reserved characters

AxesAxes• XML How to Program, Figure 11.6, pg.

305