1 / 18

XML SCHEMA

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”.

Télécharger la présentation

XML SCHEMA

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML SCHEMA

  2. Schema • A schema is a collection of: • type definitions • simple type • complex type (contains element or attribute) • element declarations

  3. Example xml & xsd

  4. Complex Type Definitions • The elements must appear in the same sequence • The attribute must contain “US”

  5. 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)

  6. 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

  7. 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

  8. 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 • ..........

  9. New simple types • by deriving from existing simple types (restricting)

  10. Enumeration

  11. List Types

  12. Union Type

  13. Anonymous Type

  14. Complex Types from Simple Types

  15. Empty Content

  16. Content Structure • all • sequence • choice

  17. Choice & Group

  18. All

More Related