RE: Interactive XSLT [was RE: James Clark: XML versus theWeb]
Following on from the initial assertion that: 'The idea that you'd have a stream of events, represented as XML, that were matched by specific templates is a fascinating one...' It would be interesting to consider what you'd be matching in your xsl:template. Were you to standardise on Remote Events in XML (REX), which I don't think you can because it got stopped by some patent issues, so I'll say something like REX then you'd end up with a template match like: <xsl:template match="rex:event[@name='DOMActivate']"> ... </xsl:template> but, would it not be more convenient to have a 'listen' function and use it thus: <xsl:template match="ev:listen('DOMActivate')"> ... </xsl:template> and then from within the transform you'd have an 'event' function, like the one that exists with XForms, that'd allow you to extract context information from the event in the same way you can from the DOM Events API. Then, to get further refinement in your matches you'd probably want a 'path' into the event's context information: <xsl:template match="ev:listen('click')/ev:shiftKey"> ... </xsl:template> You would also have to think about how you'd pass the event on for further processing: <xsl:apply-templates select="ev:event()"/> where the event function with no arguments returns the context event. How that all plays with the normal understanding of event bubbling and cancelling I haven't really thought. Oh, and one other thing, how do you go about despatching new events - that's the stuff of side-effects is it not?. <xsl:despatch event="DOMActivate" target="id('submit')"/> Side-effects are something XSLT has worked hard to avoid. Actually, this is all starting to look a bit like XML Events <http://www.w3.org/TR/2007/WD-xml-events-20070216/>. Of course this might all be the stuff of fantasy too? Regards Philip Fennell Consultant MarkLogic Corporation 88 Wood Street, London. EC2V 7RS Mobile: +44 (0) 7824 830 866 emailÂ Philip.Fennell@marklogic.com webÂ Â Â www.marklogic.com -----Original Message----- From: Philip Fennell [mailto:Philip.Fennell@marklogic.com] Sent: 02 December, 2010 9:43 AM To: Michael Kay; email@example.com Subject: RE: Interactive XSLT [was RE: James Clark: XML versus the Web] Michael, > What I'm trying to imagine is some kind of way of associating > XSLT templates with user interface events so the dialog > structure is user-controlled. Where I've been involved in similar exercises in the past, where XSLT was used to apply transformation to the data model, we connected the events in the view (UI) to actions (XSLT templates) upon the model by using SMIL's declarative event listeners to dispatch events that were listened for by the controller. The controller would package the event up in an XML representation al-la Remote Events in XML (REX) <http://www.w3.org/TR/rex> and invoked a transform that matched specific classes of event with specific template matches. And, yes, XForms can, in effect, do things like this with the proposed xf:transform action but only so far as invoking a transform based upon a specific event rather than processing events with XSLT. I've also worked upon an stand-alone XSLT implementation of a REX processor. It's also worth underlining the fact that the SMIL Animation module, as used in SVG, provides for simple 'transformations' (changing attribute values) in the view, or for that matter in a data model embedded in the view, and that may be it is an evolution of, for example, svg:set to svg:transform (not in the matrix sense, but as an XSLT transform) that would allow transformation of complex types. The idea that you'd have a stream of events, represented as XML, that were matched by specific templates is a fascinating one and not just applicable to UIs but has a more general application to messaging and request processing. Regards Philip Fennell Consultant MarkLogic Corporation 88 Wood Street, London. EC2V 7RS Mobile: +44 (0) 7824 830 866 emailÂ Philip.Fennell@marklogic.com webÂ Â Â www.marklogic.com -----Original Message----- From: Michael Kay [mailto:firstname.lastname@example.org] Sent: 02 December, 2010 12:19 AM To: email@example.com Subject: Re: Interactive XSLT [was RE: James Clark: XML versus the Web] On 01/12/2010 23:51, Dimitre Novatchev wrote: > > We just need a standard F& O function for this. > > See how this was done in the "XSLT calculator" 7 years ago: :) > > http://fxsl.sourceforge.net/articles/xslCalculator/The%20FXSL%20Calculator.html#6._Putting_it_All_Together_-_the_XSLT_Calculator > > Although this is a desktop app, the same design can be applied towards > a browser scripting application. > But this looks to me like a conversational user interface where the program asks the user a question and waits for a reply. This is very different from an event-based user interface where the sequence of events is controlled by the user. What I'm trying to imagine is some kind of way of associating XSLT templates with user interface events so the dialog structure is user-controlled. Of course this raises question about how state is maintained; I don't have any well-formulated thoughts on this. There must be some relationship with XForms here, but I'm not sure what it is. Michael Kay Saxonica _______________________________________________________________________ XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting. [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/ Or unsubscribe: firstname.lastname@example.org subscribe: email@example.com List archive: http://lists.xml.org/archives/xml-dev/ List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format