XML Schema

General Principles
  • Understand when it is appropriate to use schemas
    • List pros and cons of validating documents with schemas (as opposed to not validating documents)
    • Name advantages of schemas over DTDs
  • Describe the limitations of schemas:
    • What types of data schemas are good at validating
    • What types of data are better validated by other means
Vocabulary Define the fundamental schema vocabulary:
  • instance document
  • qualified / unqualified name
  • simple type / content
  • complex type / content
  • mixed content
  • derivation / restriction / extension / union / facet
<schema ...> element attributes Use the schema element attributes to
  • Associate a namespace with a schema
  • Indicate whether elements and attributes must be qualified
Schema-aware instance documents
  • Decide when to use the schema instance namespace (http://www.w3.org/2001/XMLSchema-instance) and when to use the schema namespace (http://www.w3.org/2001/XMLSchema)
  • Identify and locate schemas from an XML document
  • List reasons for and against making documents schema-aware
Data types Differentiate the lexical and value space of data. Special types and values
  • Indicate in a schema that an element can be nil
  • Declare a nil (null) element in an instance document
  • Explain the difference between empty elements and nil elements
  • Describe the available ways of handling whitespace: preserving, replacing, collapsing
Predefined data types

Write schema using the following predefined data types:

  • xs:anySimpleType
  • String data types: xs:string, xs:normalizedString, xs:token, xs:language
  • Numeric data types: xs:float, xs:double, xs:decimal, xs:integer, xs:long, xs:int, xs:short, xs:byte
  • Other: xs:boolean, xs:dateTime, xs:date, xs:time

Note: There are (many) more predefined data types than the ones in this list. The ones which are not in the list are outside the scope of this exam!

Restricting data types Reduce the value space of another type using
  • Intervals (minInclusive, maxExclusive, etc.)
  • Enumerated values
  • Patterns
  • Whitespace restriction
Extending data types
  • Indicate which types can be used as base types
  • Specify how an extended data type relates to it's base type
  • Distinguish the possibilities when extending complex data types with
    • empty content model (containing neither child elements nor text nodes)
    • simple content model (containing only text nodes, no child elements)
    • mixed content model (potentially containing both child elements and text nodes)
Complex data types Construct the four types of complex data types (each with or without attributes):
  • empty: <product id="123" />
  • sub-elements only (no free text): <employee><name>John</name></employee>
  • containing unparsed character data: <food type="dessert">Ice cream</food>
  • mixed: <text>He was <it>really</it> angry.</text>
Schema documentation
  • Motivate embedded documentation in schemas
  • Use the annotation, appinfo and documentation elements to document schemas
  • Explain the advantages of documenting schemas using these elements, as opposed to plain old <!-- ... --> style comments
  • Define the possible documentation formats which can be used in documentation
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值