Is it possible to query an XML Literals statement with an embedded expression for the name of an XElement on a child axis?
For example, this works when using an extension method:
Dim clrValue As String = "green"
Dim el As XElement = Source...<clrScheme>.Elements(clrValue).FirstOrDefault
But as an embedded expression, it doesn't work:
Dim clrValue As String = "blue"
Dim el As XElement = Source...<clrScheme>.<<%= clrValue %>>.FirstOrDefault
The difference is .Elements(clrValue). vs .<<%= clrValue %>>..
The IDE hover-over-<<%... errors I'm getting are:
- XML Name Expected
- '>' expected
- Expression expected
- Character is not valid
There is no documentation to say that I can use an embedded expression as an XElement name in a child axis, but there also isn't any document to say that I can't. Is this even possible and I'm just missing something, like a processing directive?