This project is read-only.
2
Vote

BibleClip accessing Bible objects

description

Each bible clip has its own instance of the bible object. The bible object is a significant size and so should not be duplicated in each clip. Instead the producer should hold a static reference to the bible object which it loads when needed. This way each clip can share a bible.

comments

cable007 wrote Sep 5, 2011 at 4:18 PM

I think changing it in that way will modify one of the features of the clip - each clip being able to use its' own translation. This allows a person to be able to use 2 bible clips to show the same verse in different translations at the same time (for side by side comparison, for example). I don't believe that sharing a bible object via the producer would allow for that functionality to be kept.

However, I do agree that the memory usage is very significant. I don't know how XPath to search for verses instead of loading to memory will work (mentioned in other issues), but I suspect that using it will shrink the size of the object quite a bit.

owaits wrote Sep 5, 2011 at 10:28 PM

You could have a translation library and query the correct translation. My concern is that at least at my church we can have about 30verses all of the same translation. That equates to allot of wasted memory. I think xpath would negate it though as you would not need to load the whole file just the bits you need.

wrote Sep 10, 2011 at 6:03 AM

wrote Oct 2, 2011 at 10:38 AM

wrote Feb 13, 2013 at 12:44 AM

wrote Oct 24, 2014 at 1:57 PM

joergteichmann wrote Oct 25, 2014 at 9:57 AM

How to use XPath to search for verses:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Xml.XPath;
using System.Xml;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();


        OpenFileDialog ofd = new OpenFileDialog();
        ofd.ShowDialog();
        string file = ofd.FileName;

        XmlDocument XmlDoc = new XmlDocument();
        XmlDoc.Load(new XmlTextReader(file));

        string xpath = "//BIBLEBOOK[@bsname='1Mo']/CHAPTER[@cnumber=1]/VERS[@vnumber=1]";   

        XmlNodeList XmlNodes = XmlDoc.SelectNodes(xpath);

        foreach (XmlNode node in XmlNodes)
        {
            richTextBox1.AppendText(node.InnerXml);
        }
    }   // constructor
}       // class
} // namespace


Bless you!
Jörg