linq to xml selection/update
- by gleasonomicon
If I have the following xml, how would I use linq to xml blank out the date fields in each video node? I wanted to do it for the purpose of a comparison in a unit test.
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<main>
<videos>
<video>
<id>00000000-0000-0000-0000-000000000000</id>
<title>Video Title</title>
<videourl>http://sample.com</videourl>
<thumbnail>http://sample.com</thumbnail>
<dateCreated>2011-01-12T18:54:56.7318386-05:00</dateCreated>
<dateModified>2011-02-12T18:54:56.7318386-05:00</dateModified>
<Numbers>
<Number>28</Number>
<Number>78</Number>
</Numbers>
</video>
<video>
<id>00000000-0000-0000-0000-000000000000</id>
<title>Video Title</title>
<videourl>http://sample.com</videourl>
<thumbnail>http://sample.com</thumbnail>
<dateCreated>2011-01-12T18:54:56.7318386-05:00</dateCreated>
<dateModified>2011-02-12T18:54:56.7318386-05:00</dateModified>
<Numbers>
<Number>28</Number>
<Number>78</Number>
</Numbers>
</video>
</videos>