[sword-devel] xmllint & the OSIS standard

Troy A. Griffitts scribe at crosswire.org
Sun Apr 1 16:23:44 MST 2012


Dear Andrew,

There are tons of docs for module development on our wiki under Module 
Development:

http://www.crosswire.org/wiki/

... and lots of examples (the KJV data I gave being a rich OSIS 
example).  You should always obtain data from our source, as exporting 
and importing between formats is seldom ever lossless.

Here is a validating OSIS example which touches on many features and is 
best practice encoded as far as CrossWire is concerned:

http://www.crosswire.org/wiki/OSIS_Bibles/BSPExample

If you'd like to see how a particular entry of a module is encoded, you 
can use:

sword/examples/cmdline/lookup

to see this.

If you are new at module creation, 'imp' format is probably your easiest 
starting point:

$$$Gen.1.1
In the
beginning...
$$$Gen.1.2
and the earth was
without form...
...

Hope this is helpful,

Troy




On 04/02/2012 01:10 AM, Andrew Thule wrote:
> @ Troy, thanks for the .zip file.  I'm more interested in trying to
> figure out how to create modules than a specific module.  My plan is
> try checking some of the stock modules.  Writing a test module,
> validate it, eliminate errors .... so on.
>
> @ Matěj, I wasn't having much success with --schema either.  Even so,
> I downloaded a copy osisCore.2.1.1.xsd and the example you gave,
> worked (thanks).
>
> Is there a way to generate a .osis file from the stock modules without
> using mod2osis?  Using mod2osis seems to generate tons of errors with
> xmllint (presumably because the schema isn't supported).
>
> What's the best way to starting to create a 'test' module for learning purposes?
>
> ~Andrew
>
> If I download the .xsd file the command line example you gave should work
>
> On Sun, Apr 1, 2012 at 6:53 PM, Troy A. Griffitts<scribe at crosswire.org>  wrote:
>> 2.5 was crosswire modifications with hopes to get pushed into the core spec.
>>
>> Don't use mod2osis.  Use this:
>>
>> http://crosswire.org/~dmsmith/kjv2006/sword/kjvxml.zip
>>
>>
>>
>>
>> On 04/02/2012 12:28 AM, Andrew Thule wrote:
>>>
>>> I just started working with OSIS.  I create a KJV.osis file using:
>>>
>>> %mod2osis KJV>    KJV.osis
>>>
>>> Then looking at the KJV.osis file I see this as header:
>>>
>>> <?xml version="1.0" encoding="UTF-8" ?>
>>>
>>> <osis xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace"
>>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>    xsi:schemaLocation="http://www.bibletechnologies.net/2003/OSIS/namespace
>>> osisCore.2.5.xsd">
>>>
>>> <osisText osisIDWork="KJV" osisRefWork="defaultReferenceScheme"
>>> xml:lang="en">
>>>
>>> -=-=-=- Remainder Deleted -=-=-=-
>>>
>>> The schemaLocation produced by mod2osis uses "osisCore.2.5.xsd".
>>> Examples in the manual at the website (
>>> http://www.bibletechnologies.net/ ) says the most recent version is
>>> "osisCore.2.1.1.xsd".  Ok, no big deal, documentation is often the
>>> last thing that gets updated.  So then I try the following command:
>>>
>>> %xmllint --valid --noout KJV.osis
>>>
>>> All I get is:
>>>
>>> KJV.osis:3: validity error : Validation failed: no DTD found !
>>> Location="http://www.bibletechnologies.net/2003/OSIS/namespace
>>> osisCore.2.5.xsd"
>>>
>>> Then I try the following:
>>> %xmllint --noout --dtdvalid
>>> http://www.bibletechnologies.net/2003/OSIS/namespace/osisCore.2.5.xsd
>>> KJV.osis
>>> %xmllint --noout --dtdvalid
>>> http://www.bibletechnologies.net/2003/OSIS/osisCore.2.5.xsd KJV.osis
>>> %xmllint --noout --dtdvalid
>>> http://www.bibletechnologies.net/2003//osisCore.2.5.xsd KJV.osis
>>> %xmllint --noout --dtdvalid
>>> http://www.bibletechnologies.net/osisCore.2.5.xsd KJV.osis
>>> and:
>>> %xmllint --noout --dtdvalid
>>> http://www.bibletechnologies.net/2003/OSIS/namespace --schema
>>> osisCore.2.5.xsd KJV.osis
>>>
>>> All produce the same error, to the effect:
>>> http://www.bibletechnologies.net/2003/OSIS/namespace/osisCore.2.5.xsd:2:
>>> parser error : Content error in the external subset
>>> <html><head>
>>> ^
>>> Could not parse DTD
>>> http://www.bibletechnologies.net/2003/OSIS/namespace/osisCore.2.5.xsd
>>>
>>> Then I switch to looking at the osisCore.2.1.1.xsd file suggested at
>>> ( http://www.bibletechnologies.net/ ) site.  I create a test file
>>> using the suggested headers mentioned in the documents at the same
>>> site (as follows):
>>>
>>> -=-=-=- File -=-=-=-
>>>
>>> <?xml version="1.0" encoding="UTF-8" ?>
>>>
>>> <osis xmlns="http://www.bibletechnologies.net/2003/OSIS/namespace"
>>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>    xsi:noNamespaceSchemaLocation="osisCore.2.1.1"
>>>    xsi:schemaLocation="http://www.bibletechnologies.net/2003/OSIS/namespace
>>>
>>> http://www.bibletechnologies.net/osisCore.2.1.1.xsd">
>>>
>>> <osisText osisIDWork="TEST" osisRefWork="defaultReferenceScheme"
>>> xml:lang="en">
>>>
>>>          <header>
>>>                  <work osisWork="TEST">
>>>                          <title>TEST</title>
>>>                          <identifier type="OSIS">Bible.TEST</identifier>
>>>                          <refSystem>Bible.KJV</refSystem>
>>>                  </work>
>>>                  <work osisWork="defaultReferenceScheme">
>>>                          <refSystem>Bible.KJV</refSystem>
>>>                  </work>
>>>          </header>
>>>
>>>          <div type="x-testament"></div>
>>>          <div type="x-testament"></div>
>>>          </osisText>
>>> </osis>
>>>
>>> -=-=-=- End of File -=-=-=-
>>>
>>> Expecting errors because the above file is missing stuff, I still
>>> can't get xmllint to work with this, continue getting "no DTD found"
>>> errors.
>>>
>>> So here are some questions:
>>> 1. Given mod2osis generates .osis files pointing to osisCore.2.5.xsd
>>> and the site ( http://www.bibletechnologies.net/ ) suggests
>>> osisCore.2.1.1.xsd can someone tell me which version is the correct
>>> version to use?
>>> 2. What is the most recent version (perhaps development-wise)?
>>> 3. Where can I get my hands on a valid .xsd file?
>>> 4. Can someone give me an example of an xmllint command (linux) that
>>> works remotely?
>>>
>>> Thanks.
>>>
>>> ~Andrew
>>>
>>> _______________________________________________
>>> sword-devel mailing list: sword-devel at 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 at 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 at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page




More information about the sword-devel mailing list