Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/XML-Output/C-sharp/xml-output.cs
Normal file
27
Task/XML-Output/C-sharp/xml-output.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
class Program
|
||||
{
|
||||
static string CreateXML(Dictionary<string, string> characterRemarks)
|
||||
{
|
||||
var remarks = characterRemarks.Select(r => new XElement("Character", r.Value, new XAttribute("Name", r.Key)));
|
||||
var xml = new XElement("CharacterRemarks", remarks);
|
||||
return xml.ToString();
|
||||
}
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var characterRemarks = new Dictionary<string, string>
|
||||
{
|
||||
{ "April", "Bubbly: I'm > Tam and <= Emily" },
|
||||
{ "Tam O'Shanter", "Burns: \"When chapman billies leave the street ...\"" },
|
||||
{ "Emily", "Short & shrift" }
|
||||
};
|
||||
|
||||
string xml = CreateXML(characterRemarks);
|
||||
Console.WriteLine(xml);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue