cash23523
Programmer
- Apr 12, 2007
- 4
I'm fairly new to programming .NET and XML together. What I am doing is trying to create a small web application that reads an XML file. The XML file(s) contain passages from the bible. But the files are mixed content. For example Genesis Chapter 1 appears like:
<verse number="1">
In the
<strongs number="7225">beginning</strongs>
<strongs number="430">God</strongs>
<strongs number="1254">created</strongs>
<strongs number="*853" />
the
<strongs number="8064">heaven</strongs>
and the
<strongs number="776">earth</strongs>
.
</verse>
The strongs child element, attribute number, is a dictionary reference number which I will evetually use to hyperlink each word that can be found in the text to the Hebrew or Greek word origin in the dictionary. However, I cannot come up with anything at the moment to read entirely through the verse element without skipping words such as "the" and "and the" found in the XML above mainly because I am not that familiar with working with XML yet.
Basically what I am trying to is parse a string together with the html tags for each verse before I send it to a string builder and then place it in a label. I would like to be able to read through each verse and basically switch the <strongs><\strongs> with <a href="number goes here"></a> like:
Dim str as String
str = "In the beginning <a href="7225">God</a>......"
I figured there was an easier way to read through the string rather than using something like reader.ReadInnerXML to return the entire verse and then going through and removing, adding, or modifying the <strong> tags with something like the .contains() method.
And help would be appreciated.
<verse number="1">
In the
<strongs number="7225">beginning</strongs>
<strongs number="430">God</strongs>
<strongs number="1254">created</strongs>
<strongs number="*853" />
the
<strongs number="8064">heaven</strongs>
and the
<strongs number="776">earth</strongs>
.
</verse>
The strongs child element, attribute number, is a dictionary reference number which I will evetually use to hyperlink each word that can be found in the text to the Hebrew or Greek word origin in the dictionary. However, I cannot come up with anything at the moment to read entirely through the verse element without skipping words such as "the" and "and the" found in the XML above mainly because I am not that familiar with working with XML yet.
Basically what I am trying to is parse a string together with the html tags for each verse before I send it to a string builder and then place it in a label. I would like to be able to read through each verse and basically switch the <strongs><\strongs> with <a href="number goes here"></a> like:
Dim str as String
str = "In the beginning <a href="7225">God</a>......"
I figured there was an easier way to read through the string rather than using something like reader.ReadInnerXML to return the entire verse and then going through and removing, adding, or modifying the <strong> tags with something like the .contains() method.
And help would be appreciated.