chen's first test slides

Post on 15-Jan-2015

359 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

TRANSCRIPT

Together Control Centerand XML

Greg CathcartMentor

2

Why XML

• The Situation

• The Problem

• The Opportunity

• The Solution

3

The Situation

• HTML “Foundation of World Wide Web”

• HTML and HTTP have Revolutionized how Information is Shared

• HTML Designed Primarily for Display How Information Looks Not How Information is Structured

4

The Problem

• Presentation and Content are Combined

• Difficult to Manage Efficiently (Modifying HTML page every time data changes.)

• Difficult for Data Intensive Applications

5

The Opportunity

• Need for Separation of Presentation and Content

• Vast Opportunities in Almost Every Industry Standardization of Data Custom Applications

6

The Solution

• XML is an Open Text Based Markup Language

• Provides Structural and Semantic Information to Data

• Provides Additional Meaning and Context to Applications Using Data

• Data about Data or “Metadata”

• Subset of SGML Optimized for the Web

7

What is XML

• The Origin of XML

• The Structure of XML

• Variants of XML

• The Future of XML

8

The Origin of XML

• Markup Languages

• SGML

• HTML

• XML

9

Variants of XML

• XSL Patterns (Query Language)

• XSL (Style Sheet Based Formatting)

• SMIL (Multimedia Authoring)

• WML (Wireless Markup Language)

• XLL (Extended Linking Specification)

• Others

10

Goals of XML

• XML SHALL BE STRAIGHTFORWARDLY USABLE OVER THE INTERNET

• XML SHALL SUPPORT A WIDE VARIETY OF APPLICATIONS • XML SHALL BE COMPATIBLE WITH SGMLSGML • IT SHALL BE EASY TO WRITE PROGRAMS WHICH PROCESS XML

DOCUMENTS • THE NUMBER OF OPTIONAL FEATURES IN XML IS TO BE KEPT TO

THE ABSOLUTE MINIMUM, IDEALLY ZERO • XML DOCUMENTS SHOULD BE HUMAN-LEGIBLE AND

REASONABLY CLEAR. • THE XML DESIGN SHOULD BE PREPARED QUICKLY • THE DESIGN OF XML SHALL BE FORMAL AND CONCISE. • XML DOCUMENTS SHALL BE EASY TO CREATE • TERSENESS IN XML MARKUP IS OF MINIMAL IMPORTANCE

11

The XML Document

• Prolog XML Declaration DTD (Document Type

Declaration/Definition)

• Document Element (Can be nested) Elements Attributes Entities

12

The Document Type Definition

• Outlines the Rules for the Document

• Document Validation

• Ensures Document Obeys Validity Constraints Identified in XML Specification

• External and Internal DTD Subsets

13

Internal/External DTD Subsets

• External (DTD reference in Declaration) Exists Outside the Content of the Document Common DTD for a Group of Documents

• Internal (Written Directly in Document) Exists within the Content of the Document Used to Customize Document for a Specific

Application

14

Element Declarations

• Element Name

• Content Specification List of Other Elements/Content Model Keyword Empty Keyword Any Mixed Content

15

Content Model Example

• <!ELEMENT EMAIL (TO, FROM, CC, SUBJECT, BODY)>

•Contains Subelements

•Corresponding Element Declaration Must Appear

16

DTD Document Content Example

<!DOCTYPE EMAIL [

<!ELEMENT EMAIL (TO, FROM, CC, BODY)>

<!ELEMENT TO (#PCDATA)>

<!ELEMENT FROM (#PCDATA)>

<!ELEMENT CC (#PCDATA)>

<!ELEMENT BODY (#PCDATA)>

]>

17

Attribute Declaration Example

• <!ATTLIST ElementName AttributeName Type Default>

• Multiple Attribute Declarations Allowed

• Can be Located Anywhere in the DTD

• Best to Locate Near Corresponding Element

18

Attribute Declaration Example

<?xml version="1.0"?>

<!DOCTYPE EMAIL [

<!ELEMENT EMAIL (TO+, FROM, CC*, BCC*, SUBJECT?, BODY?)>

<!ATTLIST EMAIL

LANGUAGE (Western|Greek|Latin|Universal) "Western“

ENCRYPTED CDATA #IMPLIED

PRIORITY (NORMAL|LOW|HIGH) "NORMAL">

<!ELEMENT TO (#PCDATA)> <!ELEMENT FROM (#PCDATA)>

<!ELEMENT CC (#PCDATA)> <!ELEMENT BCC (#PCDATA)>

19

Attribute Types and Usage (Example)

CDATA Only character data can be used in the attribute.

ENTITY Attribute value must refer to an external binary entity declared in the DTD.

IDAttribute value must be a unique identifier. If a document contains ID attributes with the same value, the processor should generate an error.

IDREF Value must be a reference to an ID declared elsewhere in the document. If the attribute does not match the referenced ID value, the processor should generate an error.

IDREFS Same as IDREF, but allows multiple values separated by white space.

NMTOKENAttribute value is any mixture of name token characters, which must be letters, numbers, periods, dashes, colons, or underscores.

NMTOKENSSame as NMTOKEN, but allows multiple values separated by white space.

20

Attribute Defaults

#REQUIRED Every element containing this attribute must specify a value for that attribute. A missing value results in an error.

#IMPLIED This attribute is optional. The processor can ignore this attribute if no value is found.

#FIXED fixed value This attribute must have the value fixedvalue. If the attribute is not included in the element, fixedvalue is assumed.

Default Identifies a default value for an attribute. If the element does not include the attribute, the value default is assumed.

21

Entities

• Containers for Content

• Internal/External

• General and Parameter

• Parsed/Unparsed

22

Entity Declaration Example

<!ENTITY EntityName EntityDefinition>

23

Together Control Center

• Overview of XML Functionality The XML Structure Diagram DTD Creation and Modification DTD Import/Export

• Future Directions

24

XML Structure Diagram

• Elements

• Groups

• Reference Links

• Attribute Groups

• Notes

• Note Links

25

TCC Diagram Pane with DTD

26

Element Properties

27

XML Structure Diagram Properties Tab

• Properties

• Reusable Attributes

• General Entities

• Notations

• Processing Instructions

• Hyperlinks

• Description

• HTMLdoc

• Req

• Custom Properties

28

Diagram Properties

29

Attribute Properties Tab

30

Diagram Pane with HTML Edit

31

Diagram Pane with DTD Edit

32

XML Schema

Specification Designed for Data Exchange

Does Not Require a DTD

top related