start = Domain
Domain =
element Domain {
# still having some problems with included documents ...
# the included document is given the attribute xml:base ...
# but my schema does not permit this ...
#
# This almost generates the correct schema ... but it
# doesn't have the correct schemaLocation
#
#
#
#
attribute xml:base { xsd:anyURI }?,
attribute id { xsd:ID },
DocDef,
element Imports { Domain* }?,
element Modules {
element ModuleClass { ModuleDef }*
}?,
element Devices {
element Device {
attribute id { xsd:Name },
DocDef,
Characteristics?,
Modules?,
element SubDevices {
element SubDevice {
attribute id { xsd:Name },
DocDef,
Characteristics?,
Modules?
}*
}?
}*
}?
}
Characteristics =
element Characteristics {
element Characteristic {
attribute name { text },
attribute optional { xsd:boolean }?,
attribute value { text }?,
DocDef,
SimpleType
}+
}
DataTypeDef =
# Discuss: Doc on DataType?
attribute unitOfMeasure { text }?,
(StructType | ArrayType | SimpleType)
StructType =
element Struct {
attribute name { text }?,
DataTypeDef+
}
ArrayType =
element Array {
attribute name { text }?,
DataTypeDef
}
SimpleType =
element SimpleType {
attribute name { text }?,
attribute type { BasicType }
# TODO Constraints Perhaps directly in DataTypeDef
}
BasicType =
"integer"
| "boolean"
| "string"
| "byte"
| "float"
| "array"
| "enum"
| "date"
| "time"
| "datetime"
| "blob"
| "uri"
DocText =
(text
| element em { text }
| element b { text }
| element tt { text })*
# element is always optional
DocDef =
element Doc {
DocText
| (element p { DocText }
| element img {
attribute src { text },
element caption { text }
})*
}?
ModuleDef =
attribute name { text },
attribute optional { xsd:boolean }?,
element extends {
attribute domain { xsd:IDREF },
attribute class { text }
}?,
DocDef,
Characteristics?,
Actions?,
Data?,
Events?
Modules =
element Modules {
element Module { ModuleDef }*
}
Actions =
element Actions {
element Action {
attribute name { text },
attribute optional { xsd:boolean }?,
DocDef,
DataTypeDef?,
ArgDef?
}*
}
ArgDef =
element Args {
element Arg {
attribute name { text },
DocDef,
DataTypeDef
}*
}
Data =
element Data {
element DataPoint {
attribute name { text },
attribute optional { xsd:boolean }?,
attribute writable { xsd:boolean }?,
attribute readable { xsd:boolean }?,
attribute eventable { xsd:boolean }?,
DocDef,
DataTypeDef
}*
}
Events =
element Events {
element Event {
attribute name { text },
attribute optional { xsd:boolean }?,
DocDef,
Data?
}*
}