tags:

views:

9

answers:

1

MSDN says http://msdn.microsoft.com/en-us/library/ms256086.aspx

degree[@from != "Harvard"] - All elements where the from attribute is not equal to "Harvard".

but when trying to implement this in my xaml code it causes an error because in XAML syntax all the value elements should be placed in quotes, how can i workaround this?

<ComboBox ItemTemplate="{StaticResource rolelistTemplate}" ItemsSource="{Binding XPath=/EssenceList/Essence[@Type="Role"]}" IsSynchronizedWithCurrentItem="True"/>

i've also tried this, but it also gives me syntax errors

 <ComboBox ItemTemplate="{StaticResource rolelistTemplate}"  ItemsSource="{Binding XPath=/EssenceList/Essence[@Type='Role']}" IsSynchronizedWithCurrentItem="True" /> 
+1  A: 

First, enclose your whole XPath with ' so that the XAML parser does not try to interpret @Type= as a syntax error. Then, use the standard XML entity &quot; to represent a double quote:

{Binding XPath='/EssenceList/Essence[@Type=&quot;Role&quot;]'}
Julien Lebosquain
Great! that works! thank you!