[XML-SIG] Creating XML with Python

Eric Chao ericchao0613 at gmail.com
Thu Jul 24 10:29:46 CEST 2008

I've been trying to convert some text that has some odd coding to xml. I am
trying to use python to create a program that will process this text:
<SH>The Creation</SH>
<C>{{01:1}}1 <RA>In the beginning <RB>God <RC>created the heavens and the
<V>{{01:1}}2 The earth was <$FOr {a waste and emptiness}>><N1><RA>formless
and void, and <RB>darkness was over the
<V>{{01:1}}3 Then <RA>God said, ``Let there be light"; and there was light.

to something like this:

<book osisID="Gen">
<chapter sID="Gen.1"/>
<p><verse sID="Gen.1.1"/>In the beginning God created the heaven and the
earth.<verse eID="Gen.1.1"/></p>
<p><verse sID="Gen.1.2"/>And the earth was without form, and void; and
darkness was upon the face of the deep. And the Spirit of God moved upon the
face of the waters.<verse eID="Gen.1.2"/></p>
<p><verse sID="Gen.1.3"/>And God said, Let there be light: and there was
light.<verse eID="Gen.1.3"/></p>

I am not very good with Python and I was hoping someone could offer some
advice on how to get started. I tried to write a program that produces XML,
but I think I need more of a find and replace type program. Thanks !

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/xml-sig/attachments/20080724/f1d3e457/attachment.htm>

More information about the XML-SIG mailing list