As I understand it, it took me a few minutes to figure it out, so I wanted to share with the rest of the community so that no one wasted time wasting time.
I am trying to generate the following line of XML using VB.NET XML literals
<Books>
<Book Name="The First Book" />
<Book Name="The Second Book" />
</Books>
I wrote code like this (suppose books are just an enumerated string)
Dim output = <Books>
<%= From book In Books _
Select _
<Book Name="<%= book %>"/> %>
</Books>
But the compiler complains about the quotation marks that should surround the attribute value. I tried using single quotes, two double quotes, nothing works.
source
share