[osis-core] <chapter> with two different models and stratgies for schema construction.

Patrick Durusau osis-core@bibletechnologieswg.org
Sun, 08 Jun 2003 13:55:51 -0400


Todd,

Back online for a few minutes but about to get some sleep. Back on later 
today.

Todd Tillinghast wrote:

>Patrick,
>
>I have attached a mini-schema and a related document to demonstrate the
>following:
>1) A schema with an element with the same name but a different model.
>(<chapter>.
>
Well, yes, but you have one global complex type and then define the 
"other" chapter element entirely in a content model. Clever but I don't 
know what it buys us in situations where I have to backup and use 
milestones. For example, I may think that I can use chapters (as opposed 
to divs) and all goes well until I hit one of the odd divisions that 
you, Chris and Troy were mentioning. At that point I do need to use the 
<chapter> milestones, and in fact have to backup to the last opening 
chapter element to do it. Question then is, do I back all the way up to 
make it completely consistent?

Note that your solution solves the ambiguity problem by not allowing ref 
but defining the element inline. I was hearing you propose two elements 
of the same name,  that is not what your proposal does, it creates 
elements with the "same" name in different spaces, but those names are 
in fact different. One operates only locally and the other globally.

Still agree that we need to look at using more complexType definitions 
and extending from there but suspect that is an August agenda item. (In 
other words, I think I can finish the regexes and get all the other 
stuff validated today, so the gang can make sure I got everything from 
Dallas, but don't think I can restructure the entire schema in time for 
the quick release we need for 1.5. Since restructuring will (should) not 
have an impact on 1.5 documents, what do you think about an August 
release of 1.5.1?

Hope you are having a great day!

Patrick

>2) Strategy to use named simple and complex types rather than named
>elements (other than <osis>.
>3) Opportunity to use Complex and Simple types by extension.  This will
>help us in the future.  (For example to do the things Kirk is wanting to
>do, will be easier if there a number of named Simple and Complex types
>that can be extended and supplanted.
>
>The sample XML document is simple but demonstrates <chapter> as a
>milestone and as a container.  (Try to add content to <chapter/> that is
>a child of <p>.)
>
>I have not put a lot of thought into the most strategic "extension"
>hierarchy.  The extension model is only to demonstrate the idea.
>
>Todd
>  
>
>------------------------------------------------------------------------
>
><?xml version="1.0" encoding="UTF-8"?>
><osis xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="TwoElementsWithTheSameNameButDifferentType.xsd">
>	<osisText>
>		<header/>
>		<div type="book">
>			<hi/>
>			<chapter><div></div></chapter>
>		</div>
>		<div type="book">
>			<div type="section">
>				<p>text text text text	<chapter sID="A"/></p>
>				<p>
>					<chapter eID="A"/>
>					<chapter sID="B"/>
>				</p>
>				<chapter eID="B"/>
>			</div>
>		</div>
>	</osisText>
></osis>
>  
>
>------------------------------------------------------------------------
>
><?xml version="1.0" encoding="UTF-8"?>
><!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by Todd Tillinghast (CF) -->
><!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by Todd Tillinghast (private) -->
><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
>	<xs:complexType name="OSISType">
>		<xs:sequence>
>			<xs:element name="osisText" type="OSISTextType" maxOccurs="unbounded"/>
>		</xs:sequence>
>	</xs:complexType>
>	<xs:complexType name="OSISTextType">
>		<xs:sequence>
>			<xs:element name="header" type="HeaderType"/>
>			<xs:element name="div" type="DivType" maxOccurs="unbounded"/>
>		</xs:sequence>
>	</xs:complexType>
>	<xs:complexType name="SimpleContainerType">
>		<xs:sequence>
>			<xs:element name="seg" type="SegType" minOccurs="0" maxOccurs="unbounded"/>
>			<xs:element name="hi" type="HiType" minOccurs="0" maxOccurs="unbounded"/>
>			<xs:element name="divineName" type="DivineNameType" minOccurs="0" maxOccurs="unbounded"/>
>		</xs:sequence>
>		<xs:attribute name="type" type="xs:string" use="optional"/>
>		<xs:attribute name="osisID" type="xs:string" use="optional"/>
>	</xs:complexType>
>	<xs:complexType name="ContainerType">
>		<xs:complexContent>
>			<xs:extension base="SimpleContainerType">
>				<xs:sequence>
>					<xs:element name="div" type="DivType" minOccurs="0" maxOccurs="unbounded"/>
>					<xs:element name="p" type="PType" minOccurs="0" maxOccurs="unbounded"/>
>				</xs:sequence>
>			</xs:extension>
>		</xs:complexContent>
>	</xs:complexType>
>	<xs:complexType name="HeaderType"/>
>	<xs:complexType name="DivType">
>		<xs:complexContent>
>			<xs:extension base="ContainerType">
>				<xs:sequence>
>					<xs:element name="chapter" type="ChapterType" minOccurs="0" maxOccurs="unbounded"/>
>				</xs:sequence>
>				<xs:attribute name="scope" type="xs:string" use="optional"/>
>			</xs:extension>
>		</xs:complexContent>
>	</xs:complexType>
>	<xs:complexType name="PType" mixed="true">
>		<xs:complexContent mixed="true">
>			<xs:extension base="SimpleContainerType">
>				<xs:sequence>
>					<xs:element name="chapter" type="MilestoneChapterType" minOccurs="0" maxOccurs="unbounded"/>
>				</xs:sequence>
>			</xs:extension>
>		</xs:complexContent>
>	</xs:complexType>
>	<xs:complexType name="VerseType"/>
>	<xs:complexType name="ChapterType">
>		<xs:complexContent>
>			<xs:extension base="ContainerType">
>				<xs:attribute name="sID" type="xs:string" use="optional"/>
>				<xs:attribute name="eID" type="xs:string" use="optional"/>
>			</xs:extension>
>		</xs:complexContent>
>	</xs:complexType>
>	<xs:complexType name="MilestoneChapterType" mixed="false">
>		<xs:attribute name="sID" type="xs:string" use="optional"/>
>		<xs:attribute name="eID" type="xs:string" use="optional"/>
>		<xs:attribute name="osisID" type="xs:string" use="optional"/>
>		<xs:attribute name="type" type="xs:string" use="optional"/>
>	</xs:complexType>
>	<xs:complexType name="DivineNameType"/>
>	<xs:complexType name="HiType"/>
>	<xs:complexType name="SegType"/>
>	<xs:element name="osis">
>		<xs:complexType>
>			<xs:complexContent>
>				<xs:extension base="OSISType"/>
>			</xs:complexContent>
>		</xs:complexType>
>	</xs:element>
></xs:schema>
>  
>

-- 
Patrick Durusau
Director of Research and Development
Society of Biblical Literature
Patrick.Durusau@sbl-site.org
Co-Editor, ISO 13250, Topic Maps -- Reference Model

Topic Maps: Human, not artificial, intelligence at work!