<xsl:stylesheet xmlns:core="http://www.askemos.org/2000/CoreAPI" xmlns:d="http://www.askemos.org/2000/NameSpaceDSSSL" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsql="http://www.askemos.org/2006/XSQL/" version="1.0">
<state>
<query></query>
<update></update>
</state>
<xsl:variable name="query">
<d:copy-of select="
(literal (data (form-field 'query (current-node))))"></d:copy-of>
</xsl:variable>
<xsl:variable name="update">
<d:copy-of select="
(literal (data (form-field 'update (current-node))))"></d:copy-of>
</xsl:variable>
<xsl:variable name="state">
<d:copy-of select="
(children
(select-elements (children (grove-root (current-node))) 'state)) "></d:copy-of>
</xsl:variable>
<xsl:template match="*[@type="read"]">
<html>
<body bgcolor="white">
<h2>xsql test interface</h2>
<h3>Update</h3>
<d:form action="'()" method="POST">
<textarea cols="60" name="update" rows="10">
<d:copy-of select="(children (select-elements (xsl-variable "state") 'update))"></d:copy-of>
</textarea>
<h3>Query</h3>
<input type="submit"></input>
</d:form>
<d:form action="'()" method="POST">
<textarea cols="60" name="query" rows="10">
<d:copy-of select="(children (select-elements (xsl-variable "state") 'query))"></d:copy-of>
</textarea>
<br></br>
<input type="submit"></input>
</d:form>
<h3>Result</h3>
<xsl:variable name="result">
<xsql:query row-element="tr" rowset-element="table">
<d:copy-of select="(children (select-elements (xsl-variable "state") 'query))"></d:copy-of>
</xsql:query>
</xsl:variable>
<d:copy-of select="(guard (ex (else (literal ex))) (xsl-variable "result"))"></d:copy-of>
</body>
</html>
</xsl:template>
<xsl:template match="*[@type="write"]">
<d:if test="(service-level)">
<core:reply>
<d:if test="(not (equal? (data (form-field 'update (current-node))) ""))">
<core:update row-element="tr" rowset-element="table">
<d:copy-of select="(form-field 'update (current-node))"></d:copy-of>
</core:update>
</d:if>
<core:continue>
<d: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)
(let ((query (form-field 'query (current-node))))
(if (equal? (data query) "")
((sxpath '(query)) node)
query))
(let ((update (form-field 'update (current-node))))
(if (equal? (data update) "")
((sxpath '(update)) node)
update))))
(else node)))
;; The children of the root of the style sheet.
(children this-root)))))
</d:copy-of>
</core:continue>
</core:reply>
</d:if>
</xsl:template>
</xsl:stylesheet>
Diese Seite findet man von: overview, .
Letzte Modifikation:
Autor(en): jfw,
Dokument Nummer A67bb0753e1676f81983e0ecf3a15b391
geliefert an public
um Sun, 07 Sep 2008 19:29:40 +0200