[osis-core] New milestone use of elements
Troy A. Griffitts
osis-core@bibletechnologieswg.org
Wed, 28 May 2003 14:02:15 -0700
Patrick,
:) OK, one more time.... I'M NOT suggesting we actually can get the
schema rules correct about milestones...
I'm only _trivially_ suggesting that we don't hand code all elements
with a 'mID', but instead specify something less specific but more
exempliary on each element.
Schema syntax follows:
// stole regex from osisWorkType
<xs:simpleType name="mIDType">
<xs:restriction base="xs:string">
<xs:pattern value="((\p{L}|\p{N}|_)+)((\.(\p{L}|\p{N}|_)+)*)?"/>
</xs:restriction>
</xs:simpleType>
// all documentation about Milestonable behaviour here
<xs:attributeGroup name="milestoneable">
<xs:attribute name="mID" type="mIDType" use="optional"/>
</xs:attributeGroup>
// example element
<xs:element name="verse">
<xs:complexType mixed="true">
...
<xs:attributeGroup ref="milestoneable"/>
</xs:complexType>
</xs:element>
__________________________________________
OR AS AN ALTERNATIVE, I WOULD RATHER MILESTONEABLE NOT BE LIMITED TO AN
ATTRIBUTEGROUP, SO SOMETHING _LIKE_:
// all documentation about Milestoneable behaviour here
<xs:complexType name="milestoneable">
<xs:attribute name="mID" type="mIDType" use="optional"/>
</xs:complexType>
// example element
<xs:element name="verse">
<xs:complexType mixed="true">
<xs:complexContent>
<xs:extension base="milestoneable"/>
...
</xs:complexContent>
</xs:complexType>
</xs:element>
This is my feable 1 hour old knowledge of XML Schema, so please be kind.
Remember, this was meant to be a nit-pickey comment and has evolved into
me learning Schema syntax. I realize just adding 'mID' to every element
accomplishes the same thing, but it doesn't CONCEPTUALLY isolate this
behaviour to some Schema THING like either of the above alternatives do.
-Troy.
Patrick Durusau wrote:
> Troy,
>
> Troy A. Griffitts wrote:
>
>> Patrick,
>> It was simpler than what you thought, I think....
>>
>> You said that you had "...add[ed] the 'mID' attribute to all the
>> elements that can be listed in the milestoneSE type attribute." (see
>> below for quote :) )
>>
>> I was just suggesting that INSTEAD of adding 'mID' to all elements
>> that should have it, we normalize this 'mID' attribute out into some
>> schema 'form', I guess like whatever milestoneSE was. And then let
>> each element 'get' this 'thing'...
>
>
> One possible method would be for me to replace the "mID" on all those
> elements with a call to an attribute by reference, which would have the
> documentation you are seeking.
>
> Not sure it is possible to create a class of element that requires two
> empty elements and the "mID" and then to extend it with each of the
> other elements. Will have to think about that one.
>
> Patrick
>
>>
>> I guess I should learn schema syntax and state my suggestion
>> appropriately.
>>
>> trying one more attempt at non-schema syntax:
>>
>> class Milestoneable {
>> // all docs here, including the fact that there must
>> // be exactly 2 elements containing this mID value and
>> // that this semantic logically has identical OSIS meaning
>> // as the XML container semantic.
>>
>> allow attribute 'mID';
>>
>> };
>>
>> class <q> extends Milestoneable {...};
>> class <verse> extends Milestoneable {...};
>> ...
>>
>>
>>
>>
>>
>> Patrick Durusau wrote:
>>
>>> Troy,
>>>
>>> Troy A. Griffitts wrote:
>>>
>>>>> What I did was to add the mID attribute to all the elements that
>>>>> can be listed in the milestoneSE type attribute.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> I know this is silly nit-picking... but...
>>>>
>>>> Is there a way to have a schema 'form' (speaking Platonic, for lack
>>>> of my schema knowledge) that declares the attribute mID as valid.
>>>> We could call the form, 'milestoneable' or something-or-other, then
>>>> the elements that are milestoneable could 'be of|inherit|get' this
>>>> form. This way we could have all the docs regarding the
>>>> 'milestoneable' semantic at this point, including all the OSIS rules
>>>> regarding such. I realize they will just be pros, but at least they
>>>> will be where someone would expect to find them.
>>>
>>>
>>>
>>>
>>> Not sure what you mean by "declares the attribute mID as valid." What
>>> I think you want is to have the semantic of having an attribute value
>>> for that attribute defined. In other words, if I am using this as a
>>> container, then no mID attribute value should be declared. If used as
>>> a milestone, then declare the mID attribute.
>>>
>>> BTW, I think this container semantic with mID goes beyond most of the
>>> other milestone work I have seen. Maybe we should work up an article
>>> for xml.com or somewhere about it.
>>>
>>> Patrick
>>>
>>>
>>>>
>>>> -Troy.
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> osis-core mailing list
>>>> osis-core@bibletechnologieswg.org
>>>> http://www.bibletechnologieswg.org/mailman/listinfo/osis-core
>>>>
>>>
>>
>>
>> _______________________________________________
>> osis-core mailing list
>> osis-core@bibletechnologieswg.org
>> http://www.bibletechnologieswg.org/mailman/listinfo/osis-core
>>
>