XML Literal Attributes LINQ

  • Thread starter Thread starter dbasnett
  • Start date Start date
D

dbasnett

Guest
Is it a bug that XML literal attributes with hyphens can't be accessed with .@ ????? See the example.

Dim foo As XElement = <root>
<a-b username="bar"></a-b>
<c-d user-name="car"></c-d>
</root>

Dim name As String = foo.<a-b>.@username
' name = foo.<c-d>.@user-name 'wont compile
'must be done like this
name = foo.<c-d>.Attributes("user-name").FirstOrDefault.Value






Search Documentation

SerialPort Info

Multics - An OS ahead of its time.

 "Those who use Application.DoEvents have no idea what it does

    and those who know what it does never use it."    former MSDN User JohnWein

Continue reading...
 

Similar threads

Back
Top