http://sparkviewengine.com/documentation/bindings
--
You received this message because you are subscribed to the Google Groups "Spark View Engine Dev" group.
To post to this group, send email to spar...@googlegroups.com.
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spark-dev?hl=en.
Like Rob said, blog posts help fill that gap. The other question - contrasting macro vs partial vs binding - would also be a great topic of a post.
To unsubscribe from this group, send email to spark-dev+...@googlegroups.com.
It's xml escaping - the bindings file is parsed as a normal xdocument. The information is needed before spark parses a template, which is why the bindings file itself isn't a .spark file.
But there are a small number of grammer rules used to locate the terms in the replacement text. I added [[ and ]] to < and > replacement in those rules.
1. Just that, or with an at like @innerText, @innerHtml?
The @attr is in the spirit of using an xpath-like syntax for bindings... So that's where the child::* came from - it's an xpath axes - http://www.w3schools.com/xpath/xpath_axes.asp
Thing with text/html is it's not always html output, and innerText in the dom carries the sense you're stripping markup... Plus the code isn't text or html, really.
@innerText
@innerHtml
@innerContent
@childContent
@child
@content
@inner
Problem is the nicer (shorter) ones are most likely to conflict with an attribute name someone would want to use... Maybe something that doesn't use the @ at all?
[child]
[inner]
:child
Or something that's entirely punctuation?
@**
@@*
@.
@:
@+
Maybe it's because I've been exposed to it and xpath before... I still lean towards 'child::*' as fairly clear...
If you wanted to vary the bindings per view file you could also pass the path along as an argument to the binding provider... Starting around ViewLoader.cs line 147 where it calls FindBinding() you could add a string viewPath argument along down to the IBindingProvider.GetBindings call.
If you had that, and your themes live in different paths, something you could do is look for bindings.xml in each of the folders from the view's location back down to the root. The DefaultBindingProvider.cs implementation is very simplistic.
And yes, I know... DefaultBindingProvider provides the file location strategy and it inherits from BindingProvider which provides the default parsing strategy. "Favor composition over inheritance" - they should be separate classes with an IBindingParser interface between them. My bad. :)
-----Original Message-----
From: spar...@googlegroups.com [mailto:spar...@googlegroups.com] On Behalf Of James R
Sent: Monday, August 02, 2010 4:56 AM
To: Spark View Engine Dev
Subject: Re: Binding
Cheers,
James
--