View Single Post
Staro 01.05.2009., 01:25   #2
markaV
Premium
Moj komp
 
markaV's Avatar
 
Datum registracije: Feb 2009
Lokacija: Pozega
Postovi: 93
CODE:
---------
XDocument doc =
new XDocument(
new XElement("TrivadisLocations",
new XElement("Location",
new XAttribute("City","Basel"),
new XElement("Consultants",
new XElement("Consultant",
new XAttribute("FirstName", "Thomas"),
new XAttribute("LastName", "Huber")
),
new XElement("Consultant",
new XAttribute("FirstName", "Christoph"),
new XAttribute("LastName", "Pletz")
)
)
),
new XElement("Location",
new XAttribute("City", "Freiburg"),
new XElement("Consultants",
new XElement("Consultant",
new XAttribute("FirstName", "Thomas"),
new XAttribute("LastName", "Wukasch")
)
)
),
new XElement("Location",
new XAttribute("City","Zürich"),
new XElement("Consultants",
new XElement("Consultant",
new XAttribute("FirstName", "Patrick"),
new XAttribute("LastName", "Spieler")
)
)
)
)
);

doc.Save("locations.xml");

REZULTAT
-----------
<?xml version="1.0" encoding="utf-8"?>
<TrivadisLocations>
<Location City="Basel">
<Consultants>
<Consultant FirstName="Thomas" LastName="Huber" />
<Consultant FirstName="Christoph" LastName="Pletz" />
</Consultants>
</Location>
<Location City="Freiburg">
<Consultants>
<Consultant FirstName="Thomas" LastName="Wukasch" />
</Consultants>
</Location>
<Location City="Zürich">
<Consultants>
<Consultant FirstName="Patrick" LastName="Spieler" />
</Consultants>
</Location>
</TrivadisLocations>

Zadnje izmijenjeno od: markaV. 01.05.2009. u 01:41.
markaV je offline   Reply With Quote