Hi,
In my first attempt I'm confused why I'm not getting a single nodes value
but instead getting a ton of extra values that are in the document but
located before the value I wish to get. I'm passing in a csproj file and
looking to extract the OutputType value, which is a single value in a group
of nodes. The root is Project and there are several PropertyGroup nodes
however only the first one contains the value Outputtype so I'm not sure if
that makes a difference.
start snippet
new XPathDocument(_currentFile.FullName);
// Create a navigator to query with XPath.
nav = docNav.CreateNavigator();
strExpression = "/Project/PropertyGroup/OutputType";
XPathExpression xpress = nav.Compile(strExpression);
Console.WriteLine("OutputType : {0}",
nav.Select(strExpression).Current.Value );
end snippet
This is what the output looks like
OutputType :
DebugAnyCPU8.0.507272.0{106C49F4-4260-4A70-A362-84AF2DA95766}ExePropertiesWelcomeEmailWelcomeEmail truefullfalsebin\Debug\DEBUG
;TRACEprom
pt4pdbonlytruebin\Release\TRACEprompt4False..\..\V endor\DLL\Microsoft.ApplicationBlocks.Data.dllFals e..\..\Vendor\DLL\Microsoft.ApplicationBlocks.Exce
ptionManagement.dllFalse..\..\SPE_1_1\SPEComponent s\obj\Debug\SPE.Components.dll
That is every value in jsut /Project/PropertyGroup jammed together when all
I want is the value Exe from the node /Project/PropertyGroup/OutputType
Thanks for the help