xs chema

Upload: bongcucxanh

Post on 02-Apr-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Xs Chema

    1/22

    XML Schema

    Matthias Hauswirth

  • 7/27/2019 Xs Chema

    2/22

    Agenda

    W3C Process

    XML Schema Requirements

    The Specifications

    Schema Tools

  • 7/27/2019 Xs Chema

    3/22

    The W3C Process

    Working Draft

    Candidate Recommendation

    Proposed Recommendation

    Recommendation

    TechnicalReports(TR

    )

    Note

    Proposals

    Proposals

    Working

    Group

    Others

  • 7/27/2019 Xs Chema

    4/22

    XML Schema: Status

    Working Drafts (Part 0, 1, 2)

    Candidate Recommendation

    Proposed Recommendation

    Recommendation

    TechnicalReports(TR

    )

    Requirements

    DCDXML-Data

    SchemaWorkingGroup

    Others

    SOX DDML

  • 7/27/2019 Xs Chema

    5/22

    XML Schema Requirements

    Structural

    namespaces

    primitive types & structural schema integration

    inheritance

    Data type

    integers, dates, (like in languages)

    user-defined (constrain some properties)

    Conformance

    processors, validity

  • 7/27/2019 Xs Chema

    6/22

    Design Principles

    More expressive than DTDs

    Expressed in XML

    Self-describing

    Usable by various XML applications

    Simple enough

  • 7/27/2019 Xs Chema

    7/22

    The Specifications

    Part 0: Primer

    non-normative introduction

    Part 1: Structuresdefine structure

    constraining contents

    Part 2: Datatypesspecify datatypes on elements and attributes

  • 7/27/2019 Xs Chema

    8/22

    An Example Document (1/2)

    Matthias Hauswirth

    4500 Brookfield Dr.

    Boulder

    CO

    80303

    Brian Temple

    1234 Strasse

    Boulder

    CO

    80302

    ...

  • 7/27/2019 Xs Chema

    9/22

    An Example Document (2/2)Brian pays

    Porsche

    1

    129400.00Need a new one

    Ferrari

    2

    189000.25

    1999-05-21

  • 7/27/2019 Xs Chema

    10/22

    An Example Schema (1/3)

    ...

  • 7/27/2019 Xs Chema

    11/22

    An Example Schema (2/3)

    ...

  • 7/27/2019 Xs Chema

    12/22

    An Example Schema (3/3)

  • 7/27/2019 Xs Chema

    13/22

    Part 1: Structures

    Type Definitions

    Attribute Declarations

    Element Declarations

    Attribute Group Definitions

    Model Group Definitions

    Notation Declarations

    Annotations

  • 7/27/2019 Xs Chema

    14/22

    DTD vs. Schema Structure

    DTD

    ((e2,e3?)+|e4)>

    Schema

  • 7/27/2019 Xs Chema

    15/22

    Referential/Uniqueness Integrity

    Define Constraints using XPath expressions

  • 7/27/2019 Xs Chema

    16/22

    Part 2: Datatypes

    Value Space

    defined axiomatically (primitive types)

    enumerated outright

    defined by restricting value space of other type combination of values of other type (list)

    has certain properties (e.g. cardinality, equality, ordered)

    Lexical Space

    set of literals for a type (e.g. 100 and 1.0E2 denote same value) Facets

    fundamental facets (define the type)

    constraining facets (allow to constrain the value space)

  • 7/27/2019 Xs Chema

    17/22

    Fundamental Facets

    Fundamental facets cant be changed

    Equal

    all types provide an equality relation

    Order some types provide an ordering relation

    Bounds

    upper bound and lower bound

    Cardinality finite, infinite

    Numeric

    yes or no

  • 7/27/2019 Xs Chema

    18/22

    Constraining Facets

    length

    minLength

    maxLength

    pattern

    enumeration

    maxInclusive / maxExclusive

    minInclusive / minExclusive

    precision

    scale

    encoding

    duration

    period

  • 7/27/2019 Xs Chema

    19/22

    Primitive vs. Derived Types

    Primitive Types string boolean float

    double decimal timeDuration recurringDuration binary uriReference ID

    IDREF ENTITY NOTATION QName

    exist ab initio

    Derived Type

    by restriction

    use constraining facets

    by list

    next slide

  • 7/27/2019 Xs Chema

    20/22

    Built-in vs. User-Derived Types

    Built-in types

    primitive

    derived

    language

    IDREFS

    long

    int

    short

    positiveInteger

    time

    month

    recurringDay

    ...

    User-derived types

    derived-only

  • 7/27/2019 Xs Chema

    21/22

    Atomic vs. List Types

    Atomic

    values indivisible

    10.5

    List

    sequence of values of

    atomic type

    8 10 10.5

  • 7/27/2019 Xs Chema

    22/22

    Tools

    XML Schema-aware ParserXerces-J

    Oracle XML Schema Processor

    XML Schema Validator (XSV, online)DTD to Schema Conversion Tools

    XML Schema Editor

    Extensibilitys XML Authority

    XML Schema-aware Instance EditorExtensibilitys XMLInstance

    ChannelPoints Merlot (maybe in future)