0

I'm working with an existing C# API that accepts string XPath expressions (ActiveMQ message body constraints, but that's not an important detail).

I'm a newcomer to Linq. Is it possible to build up a Linq predicate and export that as an XPath expression?

I'm interested because of Linq's strong typing and syntax checking compared with a simple XPath string.

Chris Dolan
  • 8,905
  • 2
  • 35
  • 73
  • 1
    Your question isn't all that clear, but are you looking for [Get the XPath to an XElement?](http://stackoverflow.com/questions/451950/get-the-xpath-to-an-xelement) – Ani Oct 25 '11 at 16:25
  • @Ani - yes, I think that's very close to what I was looking for. Thanks. – Chris Dolan Oct 25 '11 at 16:31

1 Answers1

0

Yes you can use Linq to Xml provider, you can found an example here:

http://odetocode.com/blogs/scott/archive/2009/06/05/from-linq-to-xpath-and-back-again.aspx

ADIMO
  • 1,107
  • 12
  • 24