R
Rory Becker
Is there a way to do something like the following...
Dim x As String =
SomeXElement.<Element1>.<SubElement>[email protected]("So
meDefaultString")
-------------------------------------------------------------
Rory said:Is there a way to do something like the following...
You could use If(@att, "default")
e.g. this sample
Dim foo As XElement = <foo>
<bar att="value"/>
<baz/>
</foo>
Dim val1 As String = If(foo.<bar>.@att, "default 1")
Dim val2 As String = If(foo.<baz>.@att, "default 2")
Console.WriteLine("val1: {0}; val2: {1}", val1, val2)
outputs
val1: value; val2: default 2