Simple XML Structure Markup Language
When an application is presented with an XML document, it is not always easy to know how to map that document into native programming langugae data structures. That this is a problem is indicated by the variety of inline type declaration structures such as soap:array, XML-RPC's array type and RDFs .... This specification aims to unify and extend these inline type systems as well as provide a means for data structure mappings to be declared in the schema for use at design and compile time.
Instance Annotation Vocabulary
Any element in an XML document may have an sx:type attribute. It must take one of the following values:
- list: the sub-elements are treated as an ordered list, preceded by any attributes in alphabetical order.
- struct: the sub-elements and attributes are treated as an unordered set of key/value pairs called slots. An attribute's name is the slots key and the attribute's value is the slot's value. An element's name is the key and the content is the value. No key may occur more than once.
- dictionary: the sub-elements are treated as an unordered set of key/value pairs. Each sub-element represents a single pair. The dictionary may either a) have an attribute as the key, in which case the content of the element should be considered to be the value or b) have an element as the key, in which case there should be a second element as the value. If the element has only a single attribute or exactly two elements then the correct pattern may be inferred. In order to handle the situation where the element has multiple attributes then the key attribute may be declared with an attribute called xs:keyattr which has as its value an attribute name. The element must have an attribute of this name.
- elementReference: a reference to an element in this document or another. The XPointer-bearing URI reference may be on an attribute or as the content of the element. The relevent attribute may be declared
- if the element has non-whitespace content, the content of the element is treated as an XPointer referring to a particular element in another document. If it h
Schema Annotation Vocabulary
The schema annotation vocabulary is reperesented by the namespace "http://www.prescod.net/sxsml/schema". For the purposes of this document this will be abbreviated "sxs".
The sxs:type attribute may be used on an xsd:complexType element. It declares that a particular element corresponds to one of the three compound types supported by SXSML:
- list: a list of items. The length of the list may be supplied with minOccurs and maxOccurs as per usual. It MUST NOT use any other xsd-defined attributes. The xsd:complexType MUST contain one xsd:element element. It MAY contain an annotation element. It MUST NOT contain anything else.
- struct: a set of key/value pair where the keys are known at design time. The complexType MUST allow at least one sub-element or attribute. Each sub-element or attribute must have a unique name. Each must have a maxOccurs of 1 (or default). Each must have a minOccurs of 0, 1 or the default. The complexType MUST NOT use any xsd-defined attributes. It MAY contain an annotation element. It MUST NOT contain anything else.
- dictionary: a set of key/value pairs where the keys are chosen only as the service is being used. It MUST contain a single group. The group must have two elements or an attribute and an element. The first element (or the attribute) represents the key. The second element represents the value. The group MAY have a minOccurs or maxOccurs specified. The elements or attribute may not.
- elementReference: an XPointer reference to an element of a particular type
- resource: a reference to a web resource of a particular type
Simplified W3C XML Schema Summary (separate spec?)
Old Junk
SXSML has two parts, a vocabulary for annotating schemas and one for marking up document instances (namespace "http://www.prescod.net/sxsml/schema", commonly abbreviated "sxi"). The schema vocabulary is portable to any schema language but only a binding to the W3C XML Schema language will be provided in the first version.