How to select all the attributes that contain certain String in an XML Document using LINQ

Posted by jaircazarin on Stack Overflow See other posts from Stack Overflow or by jaircazarin
Published on 2010-05-09T02:20:26Z Indexed on 2010/05/09 2:28 UTC
Read the original article Hit count: 424

Filed under:
|
|

Similar to XPath: How to match attributes that contain a certain string but without using XPath. Is it possible?

<c BarFoo="val1">
   <d Foo="val2" someAttribute="">
      <e FooBar="val3" />
   </d>
</c>

Basically I want to select all the attribute values in the document that their attribute name contains "Foo", so it should return the values of "BarFoo", "FooBar", "Foo" (va1, val2, val3)

© Stack Overflow or respective owner

Related posts about c#

Related posts about linq-to-xml