Schema Flashcards

1
Q

What is a schema and what is the base language?

A

A schema can be used to define XML document tree structure (like DTD).

It’s a XML based language - XML used to describe XML!

There is an XML Schema Document which describes the XML schema language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you start a xml schema document?

A

See attached

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you define an element in xsd (schema language)?

A

Define element called element with attributes name and type.

It uses an empty element

See attached.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is occurence constraint similar to in DTD?

Show an example of a occurence constraint.

A

An occurence constraint is similar to multiple elements in DTD.

Although you can set the max and min occurrences:

minOccurs = "numeric"
maxOccurs = "numeric" | "unbounded"
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you show structure and multiple choices in xsd?

A

Using xsd:sequence and xsd:choice

See attached for example.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Types like xsd:string, xsd:integer etc are Simple Types.

Describe and give an example of a Complex Type.

A

Complex types allows you to define new types.

Any element with child elements as content can be defined using a complex type.

See attached example.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you define attributes in xsd?

A

xsd:attribute name =”foo” type=”xsd:string” use=”required” fixed=”4” default=”3”

  • *use:** - required | optional | prohibited
  • *fixed:** - takes any constant
  • *default:** - takes any constant
How well did you know this?
1
Not at all
2
3
4
5
Perfectly