Schema Flashcards
What is a schema and what is the base language?
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 do you start a xml schema document?
See attached
How do you define an element in xsd (schema language)?
Define element called element with attributes name and type.
It uses an empty element
See attached.
What is occurence constraint similar to in DTD?
Show an example of a occurence constraint.
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 do you show structure and multiple choices in xsd?
Using xsd:sequence and xsd:choice
See attached for example.
Types like xsd:string, xsd:integer etc are Simple Types.
Describe and give an example of a Complex Type.
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 do you define attributes in xsd?
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