summaryrefslogtreecommitdiff
path: root/testdata/osxmlparser/headings_ontology.osxml
blob: 56c9e7d46d9cf9c3b46ab4984323c235f2b25cf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?xml version="1.0" standalone="yes"?>
<ontology name="headings">

	<import rel="ontology" src="./book_ontology.osxml"/>

	<struct name="heading" cardinality="1" transparent="true">
		<!-- The parent mechanism is a curious thing. Remind yourself
		     that parent-child-relationship in this sense are mediated
		     by fields. So we must either reference a field that is
		     already there or declare a new one on the fly. -->
		<parentRef ref="book.book">
			<field name="heading" subtree="true" optional="true"/>
		</parentRef>
		<parentRef ref="book.chapter">
			<field name="heading" subtree="true" optional="true"/>
		</parentRef>
		<parentRef ref="book.section">
			<field name="heading" subtree="true" optional="true"/>
		</parentRef>
		<parentRef ref="book.subsection">
			<field name="heading" subtree="true" optional="true"/>
		</parentRef>
		<parentRef ref="book.paragraph">
			<field name="heading" subtree="true" optional="true"/>
		</parentRef>
		<!-- regarding its fields we have a problem here. We do not want to
		     declare a new field, because in fact we want to allow every
		     bit of content that a paragraph would allow - also considering
		     possible extensions of paragraph by other ontologies.
		     So we need to reference the default field of paragraph. -->
		<fieldRef ref="book.paragraph.$default"/>
	</struct>
</ontology>