XML Bible Reference User Guide
This resource contains XML versions of seven English and one French public-domain translations of the Holy Bible obtained from the sources listed below. Three interfaces, Java, PHP and MSXML/JavaScript have been developed for accessing the XML and displaying selected scripture passages in HTML format. These methods each use essentially the same syntax for requesting passages:
[translation!]book[.chapter[:verse|verse-range[,verse|verse-range]]][;[translation!][book][.chapter[:verse]]]...
The request may contain multiple passages, and the syntax can be condensed by not repeating elements that are the same in subsequent passages. For example:
Luke.6:31
BEB!1_Corinthians.13:1-8
Matthew.7:1-12;Luke.6:27-35
Matthew.6:1-8,19-21,34
Psalms.23
Psalms.27;41;66;
Galatians.3-6
Ecclesiastes.2:14-;3:-8
Proverbs.4:1-4;10;12;15;17;19
Genesis.1:1-5;John
Webster!Genesis.1!;KJV;YLT
The supported translations are accessed with the following abbreviations:
| Request | Display |
|---|---|
| ASV | American Standard Version |
| BEB | Basic English Bible |
| Darby | Barby Bible |
| KJV | King James Version |
| LSB | 1910 Louis Segond Bible |
| Webster | 1833 Webster Bible |
| WEB | World English Bible |
| YLT | Young's Literal Translation |
The formal syntax for scripture requests contains no spaces, and spaces in book names are replaced by underscore (_) characters. However, all my implemented interfaces accept spaces in place of the translation!book field separator, the book.chapter separator, and underscores within book names. For example, the second passage above could be written:
BEB 1 Corinthians 13:1-8
The only required formal separators are the colon (:) for chapter:verse and the semi-colon (;) between multiple passages. Book names are not case-sensitive, and there also are 3-letter abbreviations for book names that may be used (see biblexml.php or biblexml.js.)
The appearance of the HTML output from the PHP and JavaScript versions can be changed using the editing the class rules as documented in biblexml.css. However, the Java application does not honor external stylesheets.
Java
The Java application was developed using the NetBeans IDE with the Java 6 SDK and requires JRE 6 or higher runtime environment. My application can be installed on Windows using an Inno-compiled installer or the .jar files can be downloaded separately in a zipped file.
The Java application presents the user interface shown below, however it uses the same syntax described above to query the Bible XML for the requested passage. The user controls allow selection of a multiple passages and appending each to the request string. Complex and condensed-format requests such as the examples above can be entered directly into the Passage field. Requests are always submitted from the Passage field; the current UI control selections are used only if Passage is empty.
Users can choose the which XML source to use, either connecting to the XML resource here on ParkeNet.com or downloading and installing the XML files locally (or re-uploading the file set to another online site.) The only requirement is that the eight-translation sub-folder structure must be replicated under the source directory. The entire XML resource is available in a zip file (see below.)
PHP
The PHP 5.2 version implements a user interface similar to the Java version and the scripture request syntax is the same. Since PHP support is not enabled on this Web site, the examples cannot be demonstrated here, however my .php files, as well as the Bible XML resource, can be downloaded and installed whereever there is a server. Simply edit the global variable $xml_src in biblexml.php to point to the desired location.
The interface page, XMLBibleReference.php, submits the scripture passage request to the response page Bible.php and places the result in an iframe on the page. This technique could be used to provide Bible passage resources from links or user input on other Web pages.
/Bible.php?q=ASV!1_Timothy.3:12-29
MSXML/JavaScript
The page XMLBibleReference.html contains the same user interface (more or less) and uses JavaScript and an MSXML ActiveX object to access the Bible XML resources. As such, it only runs in Internet Explorer. The request syntax differs slightly in that it does not support multiple translations in a single request and the form request-method expects a q parameter containing the book.chapter:verse and a separate, optional t parameter specifying the translation, for example:
/Bible.html?q=John.3:16&t=Webster
Sources
Downloads
Bible XML
Each version contains 66 books as separate XML files plus a complete Bible XML file. The complete set contains all eight versions.
- American Standard Version
- Bible in Basic English
- Darby Bible
- King James Version
- Louis Segond Bible
- Webster Bible
- World English Bible
- Young's Literal Translation
- Complete Set (23MB)
Java Files
PHP Files
MSXML/JavaScript Files
Project inspired by Adrian Frost's Louis Segond Bible Sermon References