I've got two documents - one is a custom XML file format, the other is an RSS feed with a bunch of custom extensions. I want to fill in fields in the XML file with values found in the RSS feed when one element value matches.
This is for an offline process that will be run a few times manually - it doesn't need to perform well, be all that fault tolerant, etc. Manual labor or intervention is fine.
My master XML document looks like this:
<videos>
<video>
<title>First Video</title>
<code>AAA123</code>
<id>decaf-decaf-decaf-decaf</id>
<description>lots of text here...</description>
</video>
<video>
<title>Second Video with no code</title>
<code></code>
<id>badab-badab-badab-badab</id>
<description>lots of text here...</description>
</video>
</videos>
The RSS feed is standard RSS with some extra field:
<ns:code>AAA123</ns:code>
<ns:type>Awesome</ns:type>
<ns:group>Wonderful</ns:group>
I'd like to pull the extra fields from the RSS document in to the XML document when the value matches the value:
<videos>
<video>
<title>First Video</title>
<code>AAA123</code>
<id>decaf-decaf-decaf-decaf</id>
<description>lots of text here...</description>
<type>Awesome</type>
<group>Wonderful</group>
</video>
<video>
<title>Second Video with no code</title>
<code></code>
<id>badab-badab-badab-badab</id>
<description>lots of text here...</description>
<type></type>
<group></group>
</video>
</videos>
I'd most like to use c#, LINQ, or some kind of Excel-fu. I guess if I had to I could deal with XSLT as long as it doesn't involve me writing much XSLT myself.
I looked at this question, but it didn't seem all that helpful for what I'm trying to do: http://stackoverflow.com/questions/80609/merge-xml-documents