I want to clean up some xml that is missing some reference information
and tagging
Here's what I want at the end of the process
<citation id="c1">
<ref><jcite><refauth><fname>E.</fname> <middlename>C.</
middlename> <surname>Bullard</surname></refauth>, <jtitle>Mon. Not. R.
Astron. Soc., Geophys. Suppl.</jtitle><coden>MNRAA4</coden> <volume>5</
volume>, <pages>248</pages> (<date>1948</date>).</jcite></ref></
citation>
<citation id="c2"><ref><jcite><refauth><fname>J.</fname>
<surname>Larmor</surname></refauth>, <jtitle>Rep. Br. Assoc. Adv.
Sci.</jtitle><issn></issn> <volume>87</volume>, <pages></pages>159
(<date>1919</date>); <jtitle>Engineering</jtitle> <volume>108</
volume>, <pages>461</pages> (<date>1919</date>).</jcite></ref></
citation>
<citation id="c3"><ref><jcite><refauth><fname>W.</fname>
<surname>Elsasser</surname></refauth>, <jtitle>Phys. Rev.</
jtitle><issn>0096-8250</issn> <volume>69</volume>, <pages>106</pages>
(<date>1946</date>); <volume>70</volume>, <pages>202</pages>
(<date>1946</date>); <volume>72</volume>, <pages>821</pages>
(<date>1947</date>).</jcite></ref></citation>
<citation id="c4"><ref><jcite><refauth><fname>E.</fname>
<middlename>C.</middlename> Bullard</refauth>, <jtitle>Proc. R. Soc.
London A</jtitle><issn>1364-5021</issn> <volume>197</volume>,
<pages>433</pages> (<date>1949</date>).</jcite></ref></citation>
Here's what I'm working with
<citation id="c1">1. M. H. Miles, R. A. Hollins, B. F. Bush, J. J.
Lagowski, R. E. Miles,
<emph type="italic">J. Electroanal.
Chem.</emph>
<emph type="bold">346</emph>, 99 (1993), available at
http://www.lenr-canr.org/acrobat/ MilesMcorrelatio.pdf. </citation>
<citation id="c2">2. M. H. Miles, B. F. Bush, K. B. Johnson,
<emph type="italic">Anomalous Effects in Deuterated Systems</emph>,
Naval Air Warfare Center Weapons Division, China Lake, CA (1996),
available at http://www.lenr-canr.org/acrobat/ MilesManomalousea.pdf.
</citation>
<citation id="c3">3. P. L. Hagelstein, M. C. H. McKubre, D.
J. Nagel, T. A. Chubb, R. J. Hekman, in <emph type="italic">Condensed
Matter Nuclear Science: Proceedings of the 11th International
Conference on Cold Fusion</emph>, J.-P. Biberian, ed., World
Scientific, Hackensack, NJ (2006), p. 23, available at http://www.lenr-canr.org/
acrobat/Hagelsteinnewphysica.pdf. </citation>
<citation id="c4">4. Special issue on cold fusion, <emph
type="italic">Accountability Res.</emph>
<emph type="bold">8</emph> (2000). All the papers in this
special issue are available at http:// www.lenr-canr.org. </citation>
<citation id="c5">5. D. Goodstein, <emph
type="italic">Accountability Res.</emph>
<emph type="bold">8</emph>, 59 (2000), available at
http://www.lenr-canr .org/acrobat/GoodsteinDwhateverha .pdf. </
citation>>
I've designed a few simple grep queries to convert the style tags to
<jtitle>, <volume>, <pages>, and <date> (mainly by using
<style>([^<]*)</style> and <new tag>\1</new tag> but I'm stuck on a
couple of items.
There's a ID for journals called CODEN which computers use to lookup
references in crossref, an online database. Its similar to the ISSN
number but a series of characters. This may be a stupid question but
how can I tell BBEdit to grab the title (e.g. <jtitle>([^<]*)</jtitle>
to find it) but not the <jtitle> tag itself, go to excel, command-F to
find the title (say "Phys. Rev. Lett.") find the coden reference next
to it, copy it, go back to BBEdit, move past the </jtitle> and insert
<coden>PRLTAO</coden> (for the example given).
The second issue is that there can be between 1-5 authors listed, so I
need to figure out how to construct a loop that would insert the tags
for one author, then look to see if there's another, etc...as well as
check whether a middle name tag should be inserted.
Thoughts anyone?
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem,
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>