Friday, 27 February 2015

Ways to parse out values inside of xml nodes and print them in additional xml nodes



I was wondering what might be a good way to approach this issue. I have to clean up ~1000 xml files that have multiple names within one name tag. Further complicating the issue, there is no distinction between first and last name.


Basically what I have is this:



<name>Li, S.; Wang, K.; Wang, D.</name>


and what I want is this:



<name>
<given>S.</given>
<family>Li</family>
</name>


and so on, for the other names. It doesn't seem like XSLT is really intended to separate out values in this way but I could be wrong. Is there a way that I can do this? Any language is fine, I just don't know where to start.


No comments:

Post a Comment