Dear All,
I am converting citations present in books to xml coding using regular expressions. Anybody can suggest best resources on this topic.
Here I am having one small problem. Please help.
"<citation id="c7"><ref><book><refauth><fname>D.</fname><surname>Turnbull</surname></refauth> in <booktitle>Solid State Physics</I>: <I>Advances in Research and Application,</booktitle> edited by <refauth><fname>F.</fname><surname>Seitz</surname></refauth>and <refauth><fname>D.</fname><surname>Turnbull</surname></refauth>, (<publisher>Academic</publisher>, New York, <date>1956</date>), Vol. <volume>3</volume>, p. <pages>226</pages></lt>"
With the help of regular expression I have modified the text into these tags.
Now I want to change the <refauth> tags after "edited by" string into <editor> tags. I am changing the whole file with $line=<FIN>.
I have written the following code. But I can not able to print the desired output. In FOUT I am getting same as input.
$line=~s!``(.+)''!``<title>$1</title>''!g; * *while($line=~m!edited by\s?(.+?)\(!g){$ed=$1;$ed=~s!refauth!editor!g;} print FOUT $line;
Please help me in where I am going wrong and suggest me the solution.
Regards, Ganesh
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>