On Apr 22, 2009, at 9:10 PM, Brian J. Dumont wrote:

Troy A. Griffitts wrote:

Dima, see below...

Brian and DM,

I've made some recent updates around link code.

Can someone please check current SVN and if things still fail, update our testsuite to add a simple failure case so I can have a look, and so we don't break things unnoticed in the future?

1.6.0.RC2 fails to link.  So does SVN r2328.

I found the problem. SWORD reports the count of verses in a VerseList differently. A range now counts as one. It used to count as many verses as was in it.

Here is a demonstration of the problem that I quickly hacked together. (Troy, tell me which testcase file to put it in and I'll add it.) It should say (and used to say) that
"There are 5 verses that are in the range"
#include <iostream>

#include <swbuf.h>
#include <listkey.h>
#include <versekey.h>

#ifndef NO_SWORD_NAMESPACE
using namespace sword;
#endif

using namespace std;

int main(int argc, char **argv) {
        VerseKey currentVerse;
        SWBuf keyVal = "Matt.1.1-Matt.1.5";
ListKey verseKeys = currentVerse.ParseVerseList(keyVal, "Gen. 1.1", true);
        int memberKeyCount = verseKeys.Count();
        if (memberKeyCount) {
cout << "There are " << memberKeyCount << " verses that are in the range: " << keyVal << endl;
                for (verseKeys = TOP; !verseKeys.Error(); verseKeys++)
                {
                        cout << verseKeys << endl;
                }
        }
        else {
cout << "Error: Invalid reference/annotateRef: " << keyVal << endl;
        }
}



I'll look into the testsuite.  FYI, a sample xml is:

<?xml version="1.0" encoding="UTF-8"?>
<osis
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace";
    xmlns:osis="http://www.bibletechnologies.net/2003/OSIS/namespace";
xsi:schemaLocation="http://www.bibletechnologies.net/2003/OSIS/namespace http://www.bibletechnologies.net/osisCore.2.1.1.xsd";> <osisText osisIDWork="Luther" osisRefWork="commentary" xml:lang="en" canonical="false">
        <header>
            header.
        </header>
        <div type="bookGroup">
            <title>New Testament</title>
            <div type="book" osisID="Matt" canonical="false">
                <title type="main" short="Matthew">Matthew</title>
<div type="section" annotateType="commentary" annotateRef="Matt.1.1">
                    <p>
                    Blah blah...
                    This is a test!
                    </p>
                </div>
<div type="section" annotateType="commentary" annotateRef="Matt.22.1-Matt.22.9">
            <title level="2">Sermon; Matthew 21:1-9</title>
            <p>
                This fails
            </p>
            </div>
        </div>
        </div>
    </osisText>
</osis>

_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to