[xml] text between marker nodes



I'm trying to parse bible verses from some XML using libxml

Sample XML is:

<book id="GEN">
 <h>Genesis </h>
 <p>
 <c id="1"/>
 <v id="1"/>
 In the beginning God created the heavens and the earth. 
 <v id="2"/>
 Now the earth was formless and empty. Darkness was on the surface of the deep. Godâs Spirit was hovering 
over the surface of the waters.
 </p>
</book>

The 'v' tag does not enclose the verse, but marks the beginning. How would I parse each verse individually in 
this situation? For instance, should I search for the 'v' tag, then grab the everything between it and the 
next '<v>' or </p> tag?

Ian.







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]