Microsoft
70-516 · Question #53
70-516 Question #53: Real Exam Question with Answer & Explanation
Sign in or unlock 70-516 to reveal the answer and full explanation for question #53. The question stem and answer options stay visible for context.
Question
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application. The application contains the following XML document: <bib> <book title="TCP/IP Illusrated" year="1994"> <author>Author1</author> </book> <book title="Programming in UNIX" year="1992"> <author>Author1</author> <author>Author2</author> <author>Author3</author> </book> <book title="Data on the web" year="2000"> <author>Author4</author> <author>Author3</author> </book> </bib> You add the following code fragment. (Line numbers are included for reference only.) 01 public IEnumerable<XElement> GetBooks(string xml) 02 { 03 XDocument doc = XDocument.Parse(xml); 04 ... 05 } You need to return a list of book XML element that are authored by Author1. Which code segment should you insert at line 04?
Options
- Areturn doc.Element("bib").Elements()
- Breturn doc.Element("bib").Elements()
- Creturn doc.Elements("bib").Elements()
- Dreturn doc.Elements("bib").Elements()
Unlock 70-516 to see the answer
You've previewed enough free 70-516 questions. Unlock 70-516 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.