Visual Studio project files malformed XML

Hi,

I'm trying to read the value of the OutputType node in the Visual Studio .csproj file below:

Library

I would expect the XPath //Project/PropertyGroup/OutputType would give me the value but Finalbuilder can not find the node. After trying different workarounds, I realized that if I replace xmlns= with xmlns:x= in the first line, the XPath is correct and the value is returned.

I don't know enough about XML namespace definitions or the XPath definitions to tell if this is a bug or expected behaviour, but it seems strange. I would expect that Visual Studio project files contains well-formed XML.

Regards,

Rasmus Aaen

MSXML forces you to use namespaces when a default namespace is declared in the document node. In the XML Parser tab, check the checkbox "Automatically use namespace prefixes declared in the document root node" and specify a prefix to use, for example : x

Then in the XPath statement you need to use the namespace :
//x:Project/x:PropertyGroup/x:OutputType


HTH