Use:
xPathNavigator.Evaluate
(@"substring-before(substring-after(@DisplayMemberBinding, 'Path='),
',')"
);
Of course, you need to cast the result to string
.
XSLT-based verification:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:mux="http://schemas.microsoft.com/SystemCenter/Common/UI/Views/GridView">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="/*">
<xsl:value-of select=
"substring-before(substring-after(@DisplayMemberBinding, 'Path='),
',')"/>
</xsl:template>
</xsl:stylesheet>
When this transformation is applied on the provided XML document:
<mux:Column Name="id"
DisplayMemberBinding="{Binding Path=Id, Mode=OneWay}"
Width="100" DisplayName="Header_Id"
Property="Id" DataType="s:String"
xmlns:mux="http://schemas.microsoft.com/SystemCenter/Common/UI/Views/GridView" />
the XPath expression is evaluated and the result of this evaluation is copied to the output:
Id