[sword-devel] Setting canonical="true" ?

DM Smith dmsmith at crosswire.org
Thu Mar 1 13:48:12 MST 2012

On 03/01/2012 03:03 PM, Troy A. Griffitts wrote:
>> But as a module encoder, I'd do it the way the OSIS defaults are
> :) good.  You are a purist, but you are also practical DM! That's one 
> of the many things I like about you.
>> , with one exception:
> uh oh...
>>> The <div> element.
> OK, I think what you say below, in summary, is:
> trojan milestones don't allow schema validators to preserve xml 
> inheritance.
No, not schema validators. XML Parsers that can answer the question, 
what is the value of the canonical attribute.

> yes.  They don't preserve xml hierarchy or enforce logic children 
> restricted sets or most anything else schema defines.
> But that doesn't mean that the specification is wrong because the 
> schema can't be represented purely in schema.
> The OSIS documentation speaks about the use of trojan milestones and 
> the deficiencies that go along with them, but also the overlapping 
> hierarchy problem they attempt to solve.
> Wanna thumb wrestle for it?
> -Troy 
Sure. Let's wrestle! (I like that you are patient with me. :)

I guess that the argument for only having verse having canonical="true" 
is that everything outside verses is non-canonical unless specifically 
marked as canonical.

I think that the div should have canonical defined as optional in the 
schema, not false. And if not optional then true.

1) It is a required child element of osisText, which defaults to true. 
All of the possible child element of osisText default to false. So the 
default on osisText is meaningless. Either, it should be removed, or one 
of its children should have it set to optional, so that it can have meaning.

2) The div as a required child element, contains "canonical" 
descendants. In non-biblical material, e.g. a commentary, there are no 
verse elements and divs are a major structural element. Every div in it 
will probably require canonical="true". In biblical material, it is 
Book, Chapter, and verse. These too should be marked canonical="true". 
Within chapters, we often have section divs. I could go either way on 
these, but I'd probably want these set to be true.

3) By having it optional on the <div>, it doesn't need to be specified 
on every div. Only on some ancestor of the div. This makes it easier to 
have a semantically correct OSIS file (i.e. semantic as defined in the 
OSIS 2.1.1 user manual) in that the canonical value is not reset with 
each descendant div.

4) If not 3), having as defaulted to "true" means that the descendant 
content is canonical unless otherwise marked or defaulted. This is by 
the way what our software assumes. Only those (non-div) elements having 
canonical defaulting to false are treated as non-canonical by our 
software. Having it such in the schema, makes it match.

5) There is no issue with inheritance when using milestoned verses, if 
the container around the verse has canonical="true".

In Him,

More information about the sword-devel mailing list