I have an xml document that has nodes mixed in with text. I want to parse this node as bold text in-line with the existing text. I have searched and researched the web for answers but fail to find the way to do this. My xml file looks like this:
<song>
<lyrics>
<verse name="v1">
<lines>
On a <chord name="A"/>hill far away stood an <chord name="D"/>old rugged cross, The <chord name="E7"/>emblem of suff'ring and <chord name="A"/>shame;<br/>
And I <chord name="A"/>love that old cross where the <chord name="D"/>dearest and best, For a <chord name="E7"/>world of lost sinners was <chord name="A"/>slain.
</lines>
</verse>
</lyrics>
</song>
To parse the text of the verse I have done:
$xml = @simplexml_load_file($file) or die("Can't read XML-SONG file...");
$myVerse= $xml->lyrics->verse[0]->lines;
echo $myVerse;
which prints:
On a hill far away stood an old rugged cross, The emblem of suff'ring and shame; And I love that old cross where the dearest and best, For a world of lost sinners was slain.
But how do I parse those <chord name="D"/ > as (bold) text in between the text?..