[sword-devel] OSIS title of work unclear
Wolfgang Schultz
woschultz at googlemail.com
Fri Jul 4 09:51:03 MST 2008
Hi,
i have solved the little problem by reading of your wiki entry
http://www.crosswire.org/wiki/index.php/OSIS_Bibles#General_structure
Here the steps:
1 .Read the value of the attribute "osisIDWork" in the element "osisText"
2. Look for an element "work" that has an attribute "osisWork" and
which has the same value as "osisIDWork"
3. Look for the child-element "title" in the "work" element from step
2 and read the content.
greetings
wolfgang
http://www.zefania.de
if this matter is of interest to you here is the piece of code for the steps
using (XmlReader reader = XmlReader.Create(PathToOsisBibleModul))
{
reader.MoveToContent();
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element &&
reader.Name == "osisText")
{
if (reader.HasAttributes)
{
FMyLetterCode =
reader.GetAttribute("osisIDWork");
}
}
if (reader.NodeType == XmlNodeType.Element &&
reader.Name == "work")
{
if (reader.HasAttributes)
{
if (reader.GetAttribute("osisWork") ==
FMyLetterCode) {
if (reader.ReadToDescendant("title"))
{
FMyModulName = reader.ReadString();
}
}
}
}
[...........]
More information about the sword-devel
mailing list