xlinq

How can I embed XElements into XML literals in VB.NET?

In VB.NET I can easily embed strings into XML literals using <xml><%= "my string" %></xml>. How can I embed an XElement instance? I know I can use methods on the XElement, XNode, etc classes, but I'd like to do it in the XML literals if possible. ...

XML navigation and reading using C# 4.0 dynamic?

Is there a DLR-enabled XML navigation and reading class available in .NET 4.0? For example, imagine I have this XML: <foo> <bar>foobar is here</bar> <bar>foobar is also here</bar> <baz>foobar is not here</bar> </foo> Is there an easy way to navigate through this XML like this: var doc = SomeDlrEnabledParser.Parse (xmlStrin...

XLINQ - Is it possible to have conditionals within a query?

In trying to teach myself ASP.NET and OO design in general, I decided to make a simple web-based game. It's a rudimentary role-playing game, where the player can create a character of a certain profession. These professions give the character certain kinds of attacks, and some of these abilities have status effects (poison on enemies, ...

Is it possible to create an object instance based on a string value denoting its type?

I'm trying to dynamically create an object of a certain type in a LINQ-to-XML query based on a string within my XML document. I'm used to being able to dynamically create an object of any type in PHP and JavaScript by simply being able to write something like: $obj = new $typeName(); Ideally, I'd like to be able to do something like:...

Xml.Linq - diffrences between XNA 4.0 (windows emulator), .NET 3.5 (Application)

I have created application for testing Linq queries (time) which I using in game project. And now, one query take 1.2s on Windows Application, but when I'm trying to use that same query on windows game (XNA 4.0) it is really, really, really slow and i don't know why. I cannot use SQLite database ( windows game is only for testing purpo...

XElement.Elements(XName name) doesn't return a name that exists in XElement.Elements()

As you can see, the schema.Elements returns three elements one of whom is an EntityContainer element. But when I try to search thru the Elements overload specifying the "EntityContainer" (schema.<EntityContainer>) it doesn't retrieve anything. ...

How can I store inline HTML in an XText class?

I'm using XElement-related stack of classes to build HTML. One thing I need is the XText element to store raw HTML (e.g., <i>this</i>) without HTML-encoding it. Is there any hack that would let me do it so that when I call ToString() it gives me the expected HTML back? ...