XML/Output
< XML
Given the list of names and the below template, generate an XML document.
XML/Output
You are encouraged to solve this task according to the task description, using any language you may know.
You are encouraged to solve this task according to the task description, using any language you may know.
<Students>
<Student Name="XXX" />
</Students>
Visual Basic .NET
Dim names As String() = New String() {"April", "Bob", "Chad", "Dave", "Emily"} Dim xml = <Students> <%= From s In names Select <Student Name=<%= s %>/> %> </Students> Console.WriteLine(xml)
Output
<Students> <Student Name="April" /> <Student Name="Bob" /> <Student Name="Chad" /> <Student Name="Dave" /> <Student Name="Emily" /> </Students>