Commit | Line | Data |
---|---|---|
9c04968f | 1 | <?xml version="1.0" encoding="UTF-8"?> |
e4882d7d A |
2 | <!-- A way to keep a process waiting until we signal it --> |
3 | <!-- In order to have a process pool that executes our queries faster --> | |
fd99084c A |
4 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:readline="READLINE" version="3.0" xmlns:err="http://www.w3.org/2005/xqt-errors" exclude-result-prefixes="readline err"> |
5 | <xsl:import href="step9_try.inc.xslt"/> | |
6 | <xsl:import href="readline.xslt"/> | |
7 | <xsl:template match="/"> | |
8 | <xsl:variable name="ctx" select="."/> | |
9 | <xsl:variable name="in_repl" select="empty($ctx/mal/no_repl)"></xsl:variable> | |
10 | <xsl:iterate select="1 to (if ($in_repl) then 100000000 else 1)"> | |
11 | <xsl:param name="val" select="$ctx"/> | |
12 | <xsl:on-completion> | |
13 | <xsl:sequence select="$val/*"/> | |
14 | </xsl:on-completion> | |
15 | <xsl:variable name="line" select="readline:readline('user> ')"/> | |
16 | <xsl:variable name="ctx"> | |
17 | <mal> | |
18 | <stdin> | |
19 | <xsl:value-of select="$line"/> | |
20 | </stdin> | |
21 | <xsl:sequence select="$val/mal/argv"/> | |
22 | <xsl:sequence select="$val/mal/state"/> | |
23 | </mal> | |
24 | </xsl:variable> | |
25 | <xsl:variable name="val"> | |
26 | <xsl:try> | |
27 | <xsl:for-each select="$ctx/mal"> | |
28 | <xsl:call-template name="rep"> | |
29 | <xsl:with-param name="display" select="true()"/> | |
30 | </xsl:call-template> | |
31 | </xsl:for-each> | |
32 | <xsl:catch errors="*"> | |
33 | <xsl:message> | |
34 | <request kind="display" value="Error: {$err:description}"/> | |
35 | </xsl:message> | |
36 | <xsl:sequence select="$ctx"/> | |
37 | </xsl:catch> | |
38 | </xsl:try> | |
39 | </xsl:variable> | |
40 | <xsl:next-iteration> | |
41 | <xsl:with-param name="val" select="$val"/> | |
42 | </xsl:next-iteration> | |
43 | </xsl:iterate> | |
44 | </xsl:template> | |
45 | </xsl:stylesheet> |