Skip to content

Instantly share code, notes, and snippets.

@PilotBob
Last active January 2, 2016 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PilotBob/8343038 to your computer and use it in GitHub Desktop.
Save PilotBob/8343038 to your computer and use it in GitHub Desktop.
<Variables><Variable Name="SSRSPath"><Value>AP/Vendors</Value></Variable></Variables>
Given the above XML fragment (it's actually just part of the XDocument) have do I get the value of the Variable element where Name="SSRSPath" ???
var path = from x in doc.DescenDescendants(ns + "Variables")
ok, that gets me the variables XElement (there is only one). Now what?
Using C#.
@PilotBob
Copy link
Author

PilotBob commented Jan 9, 2014

DOH! Figured it out:

                    var deployPath = (from e in reportDoc.Descendants(ns + "Variable")
                                     where e.Attribute("Name").Value == "SSRSPath"
                                     select e.Value).SingleOrDefault();                        

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment