<xsl:stylesheet xmlns:dsssl="http://www.askemos.org/2000/NameSpaceDSSSL" xmlns:mind="http://www.askemos.org/2000/CoreAPI" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<state>
<query></query>
<result></result>
</state>
<xsl:variable name="query">
<dsssl:copy-of select="
(literal (data (form-field 'query (current-node))))"></dsssl:copy-of>
</xsl:variable>
<xsl:variable name="state">
<dsssl:copy-of select="
(children
(select-elements (children (grove-root (current-node))) 'state)) "></dsssl:copy-of>
</xsl:variable>
<xsl:template match="*[@type="read"]">
<html>
<body bgcolor="white">
<h2>xsql test interface</h2>
<h3>Query</h3>
<dsssl:form action="'()" method="POST">
<textarea cols="60" name="query" rows="10">
<dsssl:copy-of select="(children (select-elements (xsl-variable "state") 'query))"></dsssl:copy-of>
</textarea>
<br></br>
<input type="submit"></input>
</dsssl:form>
<h3>Result</h3>
<dsssl:copy-of select="(children (select-elements (xsl-variable "state") 'result))"></dsssl:copy-of>
</body>
</html>
</xsl:template>
<xsl:template match="*[@type="write"]">
<dsssl:if test="(service-level)">
<mind:reply>
<xsl:variable name="result">
<result>
<query xmlns="urn:mysql-xsql" connection="demo" row-element="tr" rowset-element="table">
<dsssl:copy-of select="(form-field 'query (current-node))"></dsssl:copy-of>
</query>
</result>
</xsl:variable>
<dsssl:copy-of select="#CONTENT">
(root
(let ((this-root (document-element (grove-root (current-node)))))
(make element
gi: (gi this-root) ns: (ns this-root)
attributes: (copy-attributes this-root)
(node-list-map
(lambda (node)
(cond
((match-element? 'state node)
(make element
gi: (gi node) ns: (ns node)
(form-field 'query (current-node))
(xsl-variable "result")))
(else node)))
;; The children of the root of the style sheet.
(children this-root)))))
</dsssl:copy-of>
</mind:reply>
</dsssl:if>
</xsl:template>
</xsl:stylesheet>
Diese Seite findet man von: overview, .