SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 241 | Next

Scott Klein

"Professional LINQ"


Keep in mind that you are never really working with the XName class directly, but rather with a
string representation.
Throughout this book you??™ve seen string arguments passed as parameters to constructors when creating
elements or attributes during XML tree construction, like this:
new XElements("Name", "Scott");
What happens is that the string is implicitly converted to an XName. That same concept can now be applied
to namespaces. The following creates a simple XML document with a default namespace:
XElement employee = new XElement("{http://wrox.com}Employee",
new XAttribute("id", "1"),
new XElement("{http://wrox.com}Name", "Scott"),
new XElement("{http://wrox.com}Title", "Developer")
);
This code produces the following XML:

Scott
Developer

Likewise, you can create an XML document that contains multiple namespaces:
XElement employee = new XElement("{http://wrox.com}Employee",
new XAttribute("id", "1"),
new XElement("{http://wrox.com}Name", "Scott"),
new XElement("{http://wrox.


Pages:
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6