I am working on a project that slots into another project. The project I am slotting into produces a weird XML syntax that cannot be changed.
It has a weird element, to illustrate
<DocumentRoot>
<Parent>
<Child-Which-Can-Occur-Random-Number-Of-Times> Data </Child-Which-Can-Occur-Random-Number-Of-Times>
<Weird-Elt_12309843028938> Data I need </Weird-Elt_12309843028938>
<Weird-Elt_84509843323232> Data I need </Weird-Elt_84509843323232>
</Parent>
<Parent>
<Child-Which-Can-Occur-Random-Number-Of-Times> Data </Child-Which-Can-Occur-Random-Number-Of-Times>
<Weird-Elt_12309843028938> Data I need </Weird-Elt_12309843028938>
</Parent>
<Parent>
<Child-Which-Can-Occur-Random-Number-Of-Times> Data </Child-Which-Can-Occur-Random-Number-Of-Times>
<Weird-Elt_12309843028938> Data I need </Weird-Elt_12309843028938>
</Parent>
</DocumentRoot>
What I need : The name of the "Weird-Elt" tag, and it's contents.
Problem : XML cannot be changed. Weird-Elt element can occur a random number of times, as can the Element above it, Child-Which-Can-Occur-Random-Number-Of-Times
.
The only solution I can see is to use Linq to XML in conjunction with a regular expression to match the name of Weird-Elt.
Am I right in this ?