XSQLTest

xsql test interface

Query



Result

(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)))))

Source code:

<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 &apos;query (current-node))))"></dsssl:copy-of>
 </xsl:variable>
 <xsl:variable name="state">
  <dsssl:copy-of select="
  (children
   (select-elements (children (grove-root (current-node))) &apos;state)) "></dsssl:copy-of>
 </xsl:variable>
 <xsl:template match="*[@type=&quot;read&quot;]">
  <html>
   <body bgcolor="white">
    <h2>xsql test interface</h2>
    <h3>Query</h3>
    <dsssl:form action="&apos;()" method="POST">
     <textarea cols="60" name="query" rows="10">
      <dsssl:copy-of select="(children (select-elements (xsl-variable &quot;state&quot;) &apos;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 &quot;state&quot;) &apos;result))"></dsssl:copy-of>
   </body>
  </html>
 </xsl:template>
 <xsl:template match="*[@type=&quot;write&quot;]">
  <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 &apos;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, .




Letzte Modifikation: Thu, 06 Feb 2003 14:44:59 +0100

Autor(en):

Dokument Nummer A67bb0753e1676f81983e0ecf3a15b391 geliefert an public um Wed, 09 Jul 2008 06:04:33 +0200