Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <CODEBOOKINDEX>
- <ME Words="1" Score="25" Highscore="1">Main Entry Item
- <NM>attack</NM>
- <NM>cardiac</NM>
- <NM>chest</NM>
- <NM>effort</NM>
- <NM>heart</NM>
- <NM>pectoris</NM>
- <NM>syndrome</NM>
- <NM>vasomotor</NM>
- <IE>413.9</IE>
- <M1 Words="1" Score="25">An M1 Item (Same as ME, just first level Child)
- <IE>557.1</IE>
- </M1>
- <M1 Words="1" Score="25">Another M1 Item
- <IE>443.9</IE>
- <M2 Words="1" Score="25">An M2 Item (again same as ME, just a child of an M1 item)
- <CF>Arteriosclerosis,extremities</CF>
- <IE>440.20</IE>
- </M2>
- </M1>
- </ME></CODEBOOKINDEX>
- public CustomClass TranslateME(XElement source)
- {
- CustomClass result = new CustomClass();
- result.Words = (int) source.Attribute("Words");
- result.Score = (int) source.Attribute("Score");
- XAttribute highScore = source.Attribute("HighScore");
- result.HighScore = (highScore == null) ? 0 : (int) highScore;
- result.NMs = source
- .Elements("NM")
- .Select(x => x.Value)
- .ToList();
- result.IE = source
- .Element("IE").Value;
- result.SubEntries = source
- .Elements("M1")
- .Select(x => TranslateM1(x))
- .ToList();
- return result;
- }
Add Comment
Please, Sign In to add comment