[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: About time cursor in XSLT
Chuck: Sounds great, very promising. About some of the challenges you mention below: >difficult to implement the concept of a time cursor in xsl. I suspect (not sure) that a 2-pass compiling may do the trick, which is possible in a single execution of XSLT2 by using temp trees. In an XSLT implementation, assuming that: - all the events are already in store (i.e. we do "testing", not "monitoring" as Dale would say), - there is no event-based communication between asynchronous concurrent scriplets. A first pass would generate xsl "blocks" as you do for every etsm statement inside a scriplet. But in addition, at the end of each xsl block, it would also generate some timecursor variable declaration just after each block. This $timecursor variable would also be used as "starting time" for the next xsl block. But because a different variable name has to be used for each block (these var declarations are at the same level) - and referenced in the next block, we need two passes. The second pass would rename properly the $timecursor variables. This would amount to doing implicitly what you do explicitly with your @following attribute. That may be worth investigating, for a more natural scripting from user. So a sequence like: <scriplet S1> <Catch (e1)/> <If (condition)> < Catch (e2)/> </if> <Start scriplet S2 (synchronously) /> <Catch (e3)/> </scriplet> Would ultimately (after the 2 passes) be translated in something like this: <xsl:template name="S1"> <xsl:param name="timecursor"/> ... <xsl:variable name="e1">(select event(s) starting from $timecursor)</xsl:variable> <xsl:variable name="timecursor1" select="$e1/(laste date) or $timecursor (whichever is latest)"/> <xsl:variable name="temp2"> <xsl:if test=(condition)> <xsl:variable name="e2"> <xsl:variable name="catchresult">(select event(s) starting from $timecursor1)</xsl:variable> </xsl:variable> </xsl:if> </xsl:variable> <xsl:variable name="timecursor2" select="$temp2/(laste date) or $timecursor1 (whichever is latest)"/> <xsl:variable name="temp3"> <xsl:call-template name="S2">...with param timecursor = $timecursor2 ... </xsl:call-template> </xsl:variable> <xsl:variable name="timecursor3" select="$temp3/(laste date) or $timecursor2 (whichever is latest)"/> ... <xsl:variable name="e3">(select event(s) starting from $timecursor3)</xsl:variable> <xsl:variable name="timecursor4" select="$e3/(laste date) or $timecursor3 (whichever is latest)"/> ... <scripletlatest><xsl:value-of select="timecursor4"/></scripletlatest> </xsl:template> It does not seem possible to generate this in just one pass, due to different naming of timecursor vars, and also each block has to know about the timecursor variable used in the previous block. (or maybe by using position() info?) But this is manageable in two passes. My example is not proof however - I may miss some other aspects of this problem. Jacques -----Original Message----- From: Morris, Chuck E (IS) [mailto:chuck.morris@ngc.com] Sent: Wednesday, July 29, 2009 3:35 PM To: tamie@lists.oasis-open.org Subject: RE: [tamie] Groups - etsm_translator.zip uploaded I've just uploaded a new eTSM to XSL translator. This version supports all of the core use cases in the wiki, plus a few others that aren't there yet. It at least partially covers most of the language features we've defined: loops, including nested loops if, decide/if/elseif/else var, eval exit - can be used just about anywhere, even inside loops, but do not bubble up eTSM functions message start scriplets (but not asynchronously) catch (simple conditions only, and must indicate start time or previous event id) That last one in particular needs some explanation. I found it would be very difficult to implement the concept of a time cursor in xsl. As an alternative, you can either provide a start attribute to indicate the start time of the window you want to use to select events, or you can provide a following attribute and set it to the event id of a previous event to indicate that you want to select only events following that event. See the catch.etsm use case in the translator archive for an example. - Chuck -----Original Message----- From: chuck.morris@ngc.com [mailto:chuck.morris@ngc.com] Sent: Wednesday, July 29, 2009 4:58 PM To: tamie@lists.oasis-open.org Subject: [tamie] Groups - etsm_translator.zip uploaded The document named etsm_translator.zip has been submitted by Mr. Chuck Morris to the OASIS Testing and Monitoring Internet Exchanges (TaMIE) TC document repository. Document Description: eTSM to XSL translator View Document Details: http://www.oasis-open.org/committees/document.php?document_id=33588 Download Document: http://www.oasis-open.org/committees/download.php/33588/etsm_translator. zip PLEASE NOTE: If the above links do not work for you, your email application may be breaking the link into two pieces. You may be able to copy and paste the entire link address into the address field of your web browser. -OASIS Open Administration --------------------------------------------------------------------- To unsubscribe from this mail list, you must leave the OASIS TC that generates this mail. Follow this link to all your TCs in OASIS at: https://www.oasis-open.org/apps/org/workgroup/portal/my_workgroups.php
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]