Below I mentioned the Code. I need how to replace it using id numbers

Need to replace <xref ref-type="bibr" rid="b0001">Ewald <italic>et al.</italic>, 1993</xref> as <xref ref-type="bibr" rid="Ewald1">Ewald <italic>et al.</italic>, 1993</xref>

To Take the text from the ref-list id and replace in call outs

Example:

<xref ref-type="bibr" rid="b0001">Ewald <italic>et al.</italic>, 1993</xref>

<bib id="CIT-Ewald-b0001"> take the text found in id inbetween the text CIT- and -b0001 i.e. "Ewald" and find the id found in body text i.e. rid="b0001" and replace as rid="Ewald1"

<bib id="CIT-Kasten-b0002"> take the text found in id inbetween the text CIT- and -b0002 i.e. "Kasten" and find the id found in body text i.e. rid="b0002" and replace as rid="Kasten2"

Now u onderstand what I am asking

<body><p>Approximately 125&#x2009;231 joint replacements and 442 total + elbow replacements were performed in England and Wales in 2013 accor +ding to data collected by the <xref ref-type="bibr" rid="b0004">Natio +nal Joint Registry (2014)</xref>. Elbow replacements have a deep infe +ction rate ranging from 1 to 12&#x2009;% (<xref ref-type="bibr" rid=" +b0001">Ewald <italic>et al.</italic>, 1993</xref>; <xref ref-type="bi +br" rid="b0002">Kasten &#x0026; Skinner, 1993</xref>), with an estima +ted mean of 5&#x2009;% (<xref ref-type="bibr" rid="b0003">Little <ita +lic>et al.</italic>, 2005</xref>).</p><p><italic>Staphylococcus aureu +s</italic> and <italic>Staphylococcus epidermidis</italic> together a +ccount for approximately 50&#x2009;% of the agents isolated from infe +cted joint prostheses, making them the most common causative bacteria + (<xref ref-type="bibr" rid="b0005">Tattevin <italic>et al.</italic>, + 1999</xref>). Bacteria responsible for elbow prostheses infections i +nclude <italic>Staphylococcus aureus</italic>, <italic>Staphylococcus + epidermidis</italic>, <italic>Klebsiella</italic> spp. and <italic>E +nterobacter cloacae</italic> (<xref ref-type="bibr" rid="b0006">Yamag +uchi <italic>et al.</italic>, 1998</xref>).</p></body> <back><ref-list> <bib id="CIT-Ewald-b0001"><citation citation-type="journal"><article-t +itle>Capitellocondylar total elbow replacement in rheumatoid arthriti +s. Long-term results</article-title> <source>J Bone and Joint Surg</s +ource> <volume>75</volume> <fpage>498</fpage>&#x2013;<lpage>507</lpag +e>.</citation></ref> <bib id="CIT-Kasten-b0002"><citation citation-type="journal"><article- +title>Total elbow arthroplasty. An 18-year experience</article-title> +<source>Clin Orthop</source><volume>290</volume><fpage>177</fpage>&#x +2013;<lpage>188</lpage>.</citation> <bib id="CIT-Little-b0003"><article-title>Total elbow arthroplasty: a +systematic review of the literature in the English language until the + end of 2003</article-title><source>J Bone Joint Surg Br</source><vol +ume>87</volume><fpage>437</fpage>&#x2013;<lpage>444</lpage>.</citatio +n></ref> <bib id="CIT-National-b0004"><citation citation-type="book"><inpress>< +ext-link ext-link-type="url" xlink:href="http://www.njrcentre.org.uk/ +njrcentre/healthcareproviders/accessingthedata/statsonline/njrstatson +line/tabid/179/default.aspx">http://www.njrcentre.org.uk/njrcentre/He +althcareproviders/Accessingthedata/StatsOnline/NJRStatsOnline/tabid/1 +79/Default.aspx</ext-link>. Accessed 25 January 2014</inpress>.</cita +tion></ref> <bib id="CIT-Tattevin-b0005"><article-title>Prosthetic joint infection +: when can prosthesis salvage be considered?</article-title><source>C +lin Infect Dis</source><volume>29</volume><fpage>292</fpage>&#x2013;< +lpage>295</lpage>.</citation> <bib id="CIT-Yamaguchi-b0006"><article-title>Infection after total elb +ow arthroplasty</article-title><source>J Bone Joint Surg Am</source>< +volume>80</volume><fpage>481</fpage>&#x2013;<lpage>491</lpage>.</cita +tion> </ref-list> </back>

In reply to Search and replace the Text using id numbers in perl using hash by codewalker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.