unit 10 schema data processing. key concepts xml fundamentals xml document format document...

Post on 14-Dec-2015

225 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Unit 10Unit 10

Schema Data Schema Data ProcessingProcessing

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

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.

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

112

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.

Common Programming Common Programming ErrorsErrors

• Attempting to create more than one root element.

• Not adhering to case on element tags.

• Improper nesting.

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

<myRoot>

<x><y>

Hello World

</x></y>

</myRoot>

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

113

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

114

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.

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;)

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

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

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

119• Put just the graphic here.

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

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

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

122-123• Put just the graphic here.

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

168.

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

170, text only.

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

7.5, pg. 172-173.

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

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

174.

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.

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.

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

176-177, text only.

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

177-178.

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.

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.

Sample Document with Data Sample Document with Data Types Types

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

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

hierarchical tree.• Supports document navigation and

data retrieval.

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

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

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

299

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

300

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

305

top related