(→Example) |
|||
| (One intermediate revision not shown) | |||
| Line 3: | Line 3: | ||
== Example == | == Example == | ||
| - | + | ||
| + | |||
| + | [[File:AB_dataformat_example.png]] | ||
<?xml version='1.0' encoding='UTF-8'?> | <?xml version='1.0' encoding='UTF-8'?> | ||
| Line 21: | Line 23: | ||
</elements> | </elements> | ||
</model> | </model> | ||
| + | |||
| + | Deps format described here [[AgileBrowser/FullUserGuide/Deps]] | ||
| + | |||
| + | |||
| + | == Schema == | ||
| + | |||
| + | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| + | <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
| + | <!-- definition of attributes --> | ||
| + | <xs:attribute name="i" type="xs:positiveInteger"/> <!-- id of element --> | ||
| + | <xs:attribute name="r" type="xs:positiveInteger"/> <!-- reference to id --> | ||
| + | <xs:attribute name="n" type="xs:string"/> <!-- key (name) of key value pair --> | ||
| + | <xs:attribute name="v" type="xs:string"/> <!-- value of key value pair --> | ||
| + | <xs:attribute name="t" type="xs:string"/> <!-- type --> | ||
| + | <xs:attribute name="version" type="xs:string"/> <!-- type --> | ||
| + | <!-- definition of complex elements --> | ||
| + | <xs:element name="model"> | ||
| + | <xs:complexType> | ||
| + | <xs:sequence> | ||
| + | <xs:element ref="elements"/> | ||
| + | </xs:sequence> | ||
| + | <xs:attribute ref="version" use="required"/> | ||
| + | </xs:complexType> | ||
| + | </xs:element> | ||
| + | <!-- High level root for element structure --> | ||
| + | <xs:element name="elements"> | ||
| + | <xs:complexType> | ||
| + | <xs:choice maxOccurs="unbounded"> | ||
| + | <!-- element attributes --> | ||
| + | <xs:element ref="a"/> | ||
| + | <!-- child elements --> | ||
| + | <xs:element ref="e"/> | ||
| + | </xs:choice> | ||
| + | <xs:attribute ref="t" use="required"/> | ||
| + | </xs:complexType> | ||
| + | </xs:element> | ||
| + | <!-- Element --> | ||
| + | <xs:element name="e"> | ||
| + | <xs:complexType> | ||
| + | <xs:choice maxOccurs="unbounded"> | ||
| + | <xs:element ref="e"/> | ||
| + | <xs:element ref="a"/> | ||
| + | <xs:element ref="r"/> | ||
| + | </xs:choice> | ||
| + | <!-- name --> | ||
| + | <xs:attribute ref="n" use="required"/> | ||
| + | <!-- type --> | ||
| + | <xs:attribute ref="t"/> | ||
| + | <!-- number id: use only if there are incoming dependencies here (to save space) --> | ||
| + | <xs:attribute ref="i"/> | ||
| + | </xs:complexType> | ||
| + | </xs:element> | ||
| + | <!-- Relationship alias dependency --> | ||
| + | <xs:element name="r"> | ||
| + | <xs:complexType> | ||
| + | <xs:sequence> | ||
| + | <xs:element maxOccurs="unbounded" minOccurs="0" ref="a"/> | ||
| + | </xs:sequence> | ||
| + | <!-- target of the dependency: numeric element id of the used element (i attribute) --> | ||
| + | <xs:attribute ref="r" use="required"/> | ||
| + | <!-- dependency type --> | ||
| + | <xs:attribute ref="t" use="required"/> | ||
| + | </xs:complexType> | ||
| + | </xs:element> | ||
| + | <!-- Attribute assignment consists of name n and value v --> | ||
| + | <xs:element name="a"> | ||
| + | <xs:complexType> | ||
| + | <xs:attribute ref="n" use="required"/> | ||
| + | <xs:attribute ref="v" use="required"/> | ||
| + | </xs:complexType> | ||
| + | </xs:element> | ||
| + | </xs:schema> | ||
Elements are described with tag name e, dependencies (or relationships) with tag name r and attributes with tag name a. Dependencies are directed and declared in the source side. The target of the dependency is referred with numeric id to keep format compact. Those elements that are not associated with incoming dependencies do not need numeric identifiers, like in the example below.
<?xml version='1.0' encoding='UTF-8'?>
<model version="2.0">
<elements t="architecture">
<a n="model_creation_time" v="2011-01-17T15:13:32.810000+02:00" />
<e n="Applications">
<e n="FooApp" t="QMLApp">
<r r="1" t="uses"/>
</e>
</e>
<e n="System">
<e i="1" n="baz">
<a n="license" v="LGPL"/>
</e>
</e>
</elements>
</model>
Deps format described here AgileBrowser/FullUserGuide/Deps
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:attribute name="i" type="xs:positiveInteger"/> <xs:attribute name="r" type="xs:positiveInteger"/> <xs:attribute name="n" type="xs:string"/> <xs:attribute name="v" type="xs:string"/> <xs:attribute name="t" type="xs:string"/> <xs:attribute name="version" type="xs:string"/> <xs:element name="model"> <xs:complexType> <xs:sequence> <xs:element ref="elements"/> </xs:sequence> <xs:attribute ref="version" use="required"/> </xs:complexType> </xs:element> <xs:element name="elements"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element ref="a"/> <xs:element ref="e"/> </xs:choice> <xs:attribute ref="t" use="required"/> </xs:complexType> </xs:element> <xs:element name="e"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element ref="e"/> <xs:element ref="a"/> <xs:element ref="r"/> </xs:choice> <xs:attribute ref="n" use="required"/> <xs:attribute ref="t"/> <xs:attribute ref="i"/> </xs:complexType> </xs:element> <xs:element name="r"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" minOccurs="0" ref="a"/> </xs:sequence> <xs:attribute ref="r" use="required"/> <xs:attribute ref="t" use="required"/> </xs:complexType> </xs:element> <xs:element name="a"> <xs:complexType> <xs:attribute ref="n" use="required"/> <xs:attribute ref="v" use="required"/> </xs:complexType> </xs:element> </xs:schema>