I am new to regular expressions and still learning.
I have an XML file which has a text node followed by clinical information.
In the text node I have Content IDs defined like
<item>
<content ID="a138134600007">Wellbutrin TABS;</content>
<content ID="a138134600007-sta"> (Active) </content>
<content ID="a138134600007-comments"> </content>
</item>
Later on in the lower xml snippet containing the actual clinical data these ids are referenced
<text>
<reference value="#al38134600007" />
</text>
I would like to replace the above text node with the content represented by the id so I would like to transform the file to look like
<text>
Wellbutrin TABS;
</text>
Being a Java developer I am resisting writing a really ugly solution and looking for a more elegant regular expression solution (not to mention the performance since the transformation needs to happen in half a million xml CCDs).
I will like to do it in perl since it is available by default on linux but happy to use any technology that can solve this problem.
Any suggestion?
Thanks in advance, Cheers, Vipin.