Xml schema
Download
1 / 18

XML SCHEMA - PowerPoint PPT Presentation


  • 68 Views
  • Uploaded on

XML SCHEMA. Schema. A schema is a collection of: type definitions simple type complex type (contains element or attribute) element declarations. Example xml & xsd. Complex Type Definitions. The elements must appear in the same sequence The attribute must contain “US”.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' XML SCHEMA' - beck-stevens


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Schema
Schema

  • A schema is a collection of:

    • type definitions

      • simple type

      • complex type (contains element or attribute)

    • element declarations



Complex type definitions
Complex Type Definitions

  • The elements must appear in the same sequence

  • The attribute must contain “US”


Complex type definition
Complex Type Definition

  • The “ref” attribute is for referencing an existing element

  • The value of this attribute must reference a global element (declared directly under schema)


Occurrence constraints
Occurrence Constraints

  • For elements:

    • minOccurs: default 1

    • maxOccurs: defalut 1

  • For attributes the “use” attribute has the following value:

    • required

    • optional (default)

    • prohibited

  • “default” attribute is for both attribute and element definitions

  • default attribute values apply when attributes are missing, default element values apply when elements are empty


Global elements
Global Elements

  • The declaration enables the element to appear at the top-level of an instance document

  • In the example, both purchaseOrder and comment can be the root

  • cardinality constraints can not be put to global declarations


Simple types
Simple Types

  • string

  • normalizedString

  • token

  • byte

  • unsignedByte

  • base64Binary

  • hexBinary

  • integer

  • positiveInteger

  • negativeInteger

  • nonNegativeInteger

  • nonPositiveInteger

  • int

  • unsignedInt

  • long

  • unsignedLong

  • decimal

  • float

  • double

  • boolean

  • time

  • dateTime

  • duration

  • date

  • anyURI

  • language

  • ..........


New simple types
New simple types

  • by deriving from existing simple types (restricting)








Content structure
Content Structure

  • all

  • sequence

  • choice




ad