XAML support for local-name () in XPath

I want to bind to the element name node in mine XmlDataProvider. I cannot get local-name () to work in my XPath expression. Does XAML support local-name ()?

<TextBlock Text="{Binding XPath=local-name()}" />
+5
source share
1 answer

I am trying to do the same, and I am sure that it is not supported in one step.

Binding.XPath help says The XmlNode :: SelectNodes method processes XPath expressions from the XPath property. XPath functions are not supported.

but

- , DataContext, XPath, LocalName , , , :

<StackPanel Grid.Row="20" Grid.Column="1" 
    DataContext="{Binding XPath=r:Result/r:LIC1}">
    <TextBlock Text="{Binding Path=LocalName}" />
</StackPanel>

:

<TextBlock Grid.Row="20" Grid.Column="1" 
    Text="{Binding XPath=r:Result/r:LIC1/local-name\(\)}" /> 
+1

All Articles