Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

XSLT error: Unexpected token '{' in the expression. Converting to XAML/WPF data binding

$
0
0

 

Im having difficulties converting XSLT into a WPF data binding object. Because of the '{' character that I need in the data binding, XSLT ends up choking on it and throwing an error when it tries doing the conversion. Here is the partial code of what it looks like:

 

<

xsl:elementname="GroupBox">

<

xsl:attributename="Visibility">

<xsl:value-ofselect="{Binding IsChecked, ElementName=advancedPushButton, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter={xTongue Tiedtatic l:BoolToVisibilityConverter.TrueToCollapsed}}"></xsl:value-of>

</

xsl:attribute>

</

xsl:element>

 

I can enclose the entire select statement with single quotes ( ' ) inside of the double quotes, to get it to pass it as a full text string and that works. It bypasses resolving the namespaces this way though, and if it does not put in the namespaces, then it will not work. Is there a way to get it not to choke on the curly brackets { } and still have it add the namespaces? I tried manually adding namespace attributes, but when I set an attribute name to something like xmlns:l it see's the ':' character and does not like it and wont do it. Apparently I cannot use that character in the name of an attribute.

 

 

The following has the single quotes and will work, but will not add the namespaces then:

<xsl:elementname="GroupBox">

<

xsl:attributename="Visibility">

<xsl:value-ofselect="'{Binding IsChecked, ElementName=advancedPushButton, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter={xTongue Tiedtatic l:BoolToVisibilityConverter.TrueToCollapsed}}'"></xsl:value-of>

</

xsl:attribute>

</

xsl:element>

Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>