XSLTEdit

<html> <head><title>Brussels 7th Mai 2003: From Legal Wordplay to Granted Software Patents</title> </head> <body bgcolor="white"> <h1>From Legal Wordplay to Granted Software Patents</h1> <p>7th Mai 2003; Brussels, Dorint Hotel <a href="http://swpat.ffii.org/termine/2003/europarl/05/07/index.en.html" >[program]</a>.</p> <p>Plenary "Civil Liberties under Overlapping Property Regimes"</p> <img src="/A96911edb0812bd2b9ad3aca41d14f914" alt="photo from planary"/> <p>Left to right: Jörg F. Wittenberger, Hartmuth Pilch, MEP? Piia-Noora Kauppi, Prof. Lawrence Lessig, Kiesewetter?</p> </body> </html> text/html (grove-root (current-node)) ;;((sxpath '(p)) (current-node)) access denied

access denied

I'm sorry to inform you, that you are not allowed to access this place.

softeyes web site

softeyes web site

Data:

Result:

(make element gi: 'pre (literal (xml-format (guard (exception (else (literal exception))) ((eval `(lambda (current-node grove-root) ,(read (data (select-elements (xsl-variable "state") 'expression))))) (let ((value (xml-parse (data (select-elements (xsl-variable "state") 'body))))) (lambda () value)) grove-root)))))

Sorry, no edit mode for content type (node-list (literal "\"" (data (select-elements (xsl-variable "state") 'content-type)) "\" please use ") (make element gi: 'a attributes: `((href ,(read-locator (msg 'location-format) (list "index.html" (me 'get 'id))))) (literal "external editor")) (literal "."))

softeyes web site

softeyes web site



Edit the parsed version. First save! You may use HTTP?-PUT? (behind the save or publish publish button of you browser/editor) to commit your changes there. Bug: when you use the create button, changes will be saved, but the old values will be used to actually create the document.

expression -- dbg .



Create New Place
Action Data read from
using
Protection initialize (optional)

To:

Type:

Content-Type:

picture content

File upload

(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: 'state ns: 'urn:editor (cond ;; Direct write of the message body at "index.html". ((equal? (let ((dst (msg 'destination))) (and (not (null? dst)) (car dst))) "index.html") (node-list-map (lambda (n) (if (eq? (gi n) 'body) (make element gi: (gi n) ns: (ns n) attributes: '() (literal (msg 'mind-body))) n)) (children node))) ;; The file upload box. ((and (node-list-empty? (form-field 'content-type (current-node))) (not (node-list-empty? (form-field 'body (current-node))))) (node-list-map (lambda (n) (if (eq? (gi n) 'body) (form-field 'body (current-node)) n)) (children node))) ;; All form fields (else (node-list-map (lambda (node) (let ((ff (form-field (gi node) (current-node)))) (if (node-list-empty? ff) node ff))) ((sxpath '(state *)) (grove-root (current-node)))))))) (else node))) ;; The children of the root of the style sheet. (children this-root))))) ((eval `(lambda (current-node grove-root) ,(read (data (select-elements (xsl-variable "state") 'expression))))) (let ((value (xml-parse (data (select-elements (xsl-variable "state") 'body))))) (lambda () value)) grove-root)

Source code:

<xsl:stylesheet xmlns:d="http://www.askemos.org/2000/NameSpaceDSSSL" xmlns:editor="urn:editor" xmlns:mind="http://www.askemos.org/2000/CoreAPI" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <editor:state>
  <body>&lt;html&gt;&#x0D;
 &lt;head&gt;&lt;title&gt;Brussels 7th Mai 2003: From Legal Wordplay to Granted Software Patents&lt;/title&gt;&#x0D;
 &lt;/head&gt;&#x0D;
 &lt;body bgcolor="white"&gt;&#x0D;
  &lt;h1&gt;From Legal Wordplay to Granted Software Patents&lt;/h1&gt;&#x0D;
  &lt;p&gt;7th Mai 2003; Brussels, Dorint Hotel&#x0D;
&lt;a href="<a href="http://swpat.ffii.org/termine/2003/europarl/05/07/index.en.html&quot;">http://swpat.ffii.org/termine/2003/europarl/05/07/index.en.html"</a>&#x0D;
&gt;[program]&lt;/a&gt;.&lt;/p&gt;&#x0D;
  &lt;p&gt;Plenary "Civil Liberties under Overlapping Property Regimes"&lt;/p&gt;&#x0D;
  &lt;img src="/A96911edb0812bd2b9ad3aca41d14f914" alt="photo from planary"/&gt;&#x0D;
  &lt;p&gt;Left to right:&#x0D;
Jörg F. Wittenberger,&#x0D;
Hartmuth Pilch,&#x0D;MEP Piia-Noora Kauppi,&#x0D;
Prof. Lawrence Lessig,&#x0D;
Kiesewetter?&lt;/p&gt;&#x0D;
 &lt;/body&gt;&#x0D;
&lt;/html&gt;</body>
  <content-type>text/html</content-type>
  <expression> (grove-root (current-node)) &#x0D;
;;((sxpath '(p)) (current-node))</expression>
  <to></to>
  <type></type>
 </editor:state>
 <initial xmlns="urn:editor">
  <body></body>
  <content-type></content-type>
  <expression></expression>
  <to></to>
  <type></type>
 </initial>
 <xsl:variable name="state">
  <d:copy-of select="((sxpath &apos;(state *)) (grove-root (current-node)))"></d:copy-of>
 </xsl:variable>
 <xsl:template match="request[@type=&quot;read&quot;]">
  <xsl:choose>
   <d:when test="(not (service-level (me &apos;get &apos;id)))">
    <html>
     <head>
      <title>access denied</title>
     </head>
     <body>
      <h1>access denied</h1>
      <p>I'm sorry to inform you,
that you are not allowed to access this place.</p>
     </body>
    </html>
   </d:when>
   <d:when test="(equal? (let ((dst (msg &apos;destination)))
                                (and (not (null? dst)) (car dst)))
                            &quot;index.html&quot;)">
    <xsl:choose>
     <d:when test="
  (match-element?
   &apos;output
   (node-list-first (children (node-list-first
                               (select-elements
                                (xsl-variable &quot;state&quot;) &apos;body)))))
">
<!--
      This version is functionally equivalent to the next (at least
      for the purpose here) and it's somewhat more readable.
      Knowledge about optimizations in mechanism/tree.scm motivates
      the more complicated form below.  Reason: the "data" function
      returns the string from a xml literal if applied to a node list
      of just one literal.  For a list of xml elements (like the
      result of select-elements here) it will apply string-append
      recursivly to compute the value.  This is not nessesary, we know
      there's just one string.

      <d:copy-of
        select='(xml-parse (data (select-elements
                                  (xsl-variable "state") &apos;body)))' />
-->
      <d:copy-of select="(node-list-first
                 (children (node-list-first
                            (select-elements
                             (xsl-variable &quot;state&quot;) &apos;body))))"></d:copy-of>
     </d:when>
     <d:when test="(string=? (data (select-elements
                                        (xsl-variable &quot;state&quot;)
                                        &apos;content-type))
                               &quot;text/xml&quot;)">
      <d:copy-of select="
 (xml-parse
  (data (select-elements (xsl-variable &quot;state&quot;) &apos;body)))"></d:copy-of>
     </d:when>
     <d:when test="(string=? (data (select-elements
                                        (xsl-variable &quot;state&quot;)
                                        &apos;content-type))
                               &quot;text/html&quot;)">
      <d:copy-of select="
(xml-parse (data (select-elements (xsl-variable &quot;state&quot;) &apos;body))
mode: &apos;html)"></d:copy-of>
     </d:when>
     <xsl:otherwise>
      <output method="text">
       <xsl:attribute name="media-type">
        <d:copy-of select="(data (select-elements
                         (xsl-variable &quot;state&quot;) &apos;content-type))"></d:copy-of>
       </xsl:attribute>
       <d:copy-of select="(literal (data (node-list-first
                  (children (node-list-first
                             (select-elements
                              (xsl-variable &quot;state&quot;) &apos;body))))))"></d:copy-of>
      </output>
     </xsl:otherwise>
    </xsl:choose>
   </d:when>
   <d:when test="(is-meta-form? msg)">
    <d:copy-of select="(message-body (metaview me msg))"></d:copy-of>
   </d:when>
   <d:when test="(equal? (data (form-field &apos;template (current-node)))
                         &quot;expression&quot;)">
    <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
      <title>softeyes web site</title>
      <meta content="text/html" http-equiv="Content-Type"></meta>
     </head>
     <body bgcolor="white">
      <h1>softeyes web site</h1>
      <xsl:choose>
       <d:when test="(member (data (select-elements
                                      (xsl-variable &quot;state&quot;)
                                      &apos;content-type))
         &apos;(&quot;text/xml&quot; &quot;text/html&quot;))">
        <d:form action="&apos;()" method="post">
         <input name="action" type="submit" value="save"></input>
         <textarea cols="72" name="expression" rows="10">
          <d:copy-of select="#CONTENT">
    (literal
   (data (children (select-elements (xsl-variable "state") 'expression))))
       </d:copy-of>
         </textarea>
        </d:form>
        <h2>Data:</h2>
        <d:copy-of select="
(make element gi: &apos;pre
  (literal (data (select-elements (xsl-variable &quot;state&quot;) &apos;body))))"></d:copy-of>
        <h2>Result:</h2>
        <d:copy-of select="#CONTENT">
(make element gi: 'pre
  (literal (xml-format
 (guard
  (exception (else (literal exception)))
  ((eval `(lambda (current-node grove-root)
          ,(read (data (select-elements (xsl-variable "state") 'expression)))))
  (let ((value (xml-parse (data (select-elements (xsl-variable "state") 'body)))))
 (lambda () value))
 grove-root)))))
</d:copy-of>
       </d:when>
       <xsl:otherwise>
        <p>Sorry, no edit mode for content type <d:copy-of select="#CONTENT">
 (node-list
  (literal "\""
   (data (select-elements (xsl-variable "state") 'content-type))
   "\" please use ")
  (make element gi: 'a
    attributes: `((href ,(read-locator (msg 'location-format)
                          (list "index.html" (me 'get 'id)))))
    (literal "external editor"))
  (literal "."))
 </d:copy-of></p>
       </xsl:otherwise>
      </xsl:choose>
     </body>
    </html>
   </d:when>
   <xsl:otherwise>
    <html xmlns="http://www.w3.org/1999/xhtml">
     <head>
      <title>softeyes web site</title>
      <meta content="text/html" http-equiv="Content-Type"></meta>
     </head>
     <body bgcolor="white">
      <h1>softeyes web site</h1>
      <d:form action="&apos;()" method="post">
       <input name="action" type="submit" value="save"></input>
       <input name="action" type="submit" value="send"></input>
       <input name="action" type="submit" value="create"></input>
       <br></br>
       <p>Edit the <d:a d:href="(read-locator (msg &apos;location-format)
                                  (cons &quot;index.html&quot; (msg &apos;location)))">parsed version</d:a>.
   <small>First save! You may use HTTP-PUT (behind the <code>save</code>
          or publish <code>publish</code> button of you browser/editor)
          to commit your changes there.</small>
Bug: when you use the <code>create</code> button, changes
will be saved, but the <em>old</em> values will be used to actually
create the document.</p>
       <p><d:a d:href="
(read-locator (msg &apos;location-format)
  (list body: &quot;xmlns=urn:editor&amp;template=expression&quot;
       (me &apos;get &apos;id)))
">expression</d:a>
-- <d:a d:href="
(read-locator (msg &apos;location-format)
  (list body: &quot;xmlns=mind&quot; (me &apos;get &apos;id)))
">dbg</d:a>
.</p>
       <p>
<!-- fold-links gibt eine Funktion mit zwei Parametern,
einem Kombinator und einem Initialwert.  Der Kombinator
wird für alle Links auf den Link und den akkumulierten Initialwert
andgewendet, d.h. ergibt den neuen Initialwert für den nächsten Link.
Hier, im einfachsten Fall, wird als Kombinator 'cons' verwendet
und die leere Liste als Initalwert.  Damit wird jeder Link
vor die Liste gehängt, mithin erhalten wir eine Liste aller Links.
Braucht man nur einige, dann ist 'cons' entsprechend zu ersetzen.
 -->
        <d:for-each select="((me &apos;fold-links) cons &apos;())">
         <d:a d:href="(read-locator (msg &apos;location-format)
  (list (me (data (current-node)))))">
          <d:copy-of select="(current-node)"></d:copy-of>
         </d:a>
         <br></br>
        </d:for-each>
       </p>
       <d:form action="&apos;()" method="post">
        <table bgcolor="silver" border="0" cellpadding="5" cellspacing="1">
         <thead>Create New Place</thead>
         <tbody>
          <tr>
           <td>Action</td>
           <td>
            <input name="newaction" type="text" value="Af051fe01ba259f25aae185d500b3d6a2"></input>
           </td>
           <td>Data read from</td>
           <td>
            <d:input name="read" type="text" d:value="
 (read-locator (msg &apos;location-format)
               (list &quot;index.html&quot; (oid-&gt;string (me &apos;get &apos;id))))"></d:input>
           </td>
          </tr>
          <tr>
           <td colspan="4" valing="top">using
     <textarea cols="50" name="body" rows="3"></textarea></td>
          </tr>
          <tr>
           <td>Protection</td>
           <td>
            <input name="protection" type="text" value="Af051fe01ba259f25aae185d500b3d6a2"></input>
           </td>
           <td>initialize (optional)</td>
           <td>
            <input name="initialize" type="text" value=""></input>
           </td>
          </tr>
          <tr>
           <td colspan="2">
            <input name="action" type="submit" value="new"></input>
           </td>
          </tr>
         </tbody>
        </table>
       </d:form>
       <p>
   To: <input name="to" size="30" type="text"><xsl:attribute name="value"><d:copy-of select="(select-elements (xsl-variable &quot;state&quot;) &apos;to)"></d:copy-of></xsl:attribute></input><br></br>
   Type: <input name="type" size="30" type="text"><xsl:attribute name="value"><d:copy-of select="(select-elements (xsl-variable &quot;state&quot;) &apos;type)"></d:copy-of></xsl:attribute></input><br></br><span>Content-Type: </span><input name="content-type" type="text"><xsl:attribute name="value"><d:copy-of select="(data (select-elements (xsl-variable &quot;state&quot;)
                                                    &apos;content-type))"></d:copy-of></xsl:attribute></input><br></br><xsl:choose><d:when test="
  (match-element?
   &apos;output
   (node-list-first (children (node-list-first
                               (select-elements
                                (xsl-variable &quot;state&quot;) &apos;body)))))
"><img alt="picture content"><xsl:attribute name="src"><d:copy-of select="(read-locator
                   (msg &apos;location-format)
                   (list &quot;index.html&quot; (me &apos;get &apos;id)))"></d:copy-of></xsl:attribute></img><input name="body" type="hidden" value=""></input></d:when><xsl:otherwise><textarea cols="72" name="body" rows="25"><d:copy-of select="#CONTENT">
    (literal
     (let ((body (node-list-first
                  (select-elements (xsl-variable "state") 'body))))
       (cond
         ((node-list-empty? body) "")
         (else (data (children body))))))
       </d:copy-of></textarea></xsl:otherwise></xsl:choose></p>
      </d:form>
      <p>
File upload
   <d:form action="&apos;()" enctype="multipart/form-data" method="post"><input name="body" type="file"></input><input name="action" type="submit" value="save"></input></d:form></p>
     </body>
    </html>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
 <xsl:template match="request[@type=&quot;write&quot;]">
  <xsl:choose>
   <d:when test="(not (or (service-level (me &apos;get &apos;id)) (error &quot;privat property&quot;)))"></d:when>
   <d:when test="(is-meta-form? msg)">
    <d:copy-of select="(message-body (metactrl me msg))"></d:copy-of>
   </d:when>
   <xsl:otherwise>
    <mind:reply>
<!--
TODO see that dsssl define's work to make that a bit more reader friendly.
-->
     <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: 'state ns: 'urn:editor
               (cond
                  ;; Direct write of the message body at "index.html".
                  ((equal? (let ((dst (msg 'destination)))
                             (and (not (null? dst)) (car dst)))
                           "index.html")
                   (node-list-map
                    (lambda (n)
                      (if (eq? (gi n) 'body)
                          (make element
                            gi: (gi n) ns: (ns n) attributes: '()
                            (literal (msg 'mind-body)))
                          n))
                    (children node)))
                  ;; The file upload box.
                  ((and (node-list-empty?
                         (form-field 'content-type (current-node)))
                        (not (node-list-empty?
                         (form-field 'body (current-node)))))
                   (node-list-map
                    (lambda (n)
                      (if (eq? (gi n) 'body)
                          (form-field 'body (current-node))
                          n))
                    (children node)))
                  ;; All form fields
                  (else
                   (node-list-map
                    (lambda (node)
                      (let ((ff (form-field (gi node) (current-node))))
                       (if (node-list-empty? ff) node ff)))
                     ((sxpath '(state *)) (grove-root (current-node))))))))
            (else node)))
         ;; The children of the root of the style sheet.
         (children this-root)))))
   </d:copy-of>
     <d:if test="(equal? (data (form-field &quot;action&quot; (current-node))) &quot;send&quot;)">
      <mind:send>
       <xsl:attribute name="type">
        <d:copy-of select="(data (select-elements (xsl-variable &quot;state&quot;) &apos;type))"></d:copy-of>
       </xsl:attribute>
       <to>
        <d:copy-of select="(string-append (oid-&gt;string (msg &apos;dc-creator))
                            &quot;/&quot;
                            (data (select-elements (xsl-variable &quot;state&quot;)
                                                   &apos;to)))"></d:copy-of>
       </to>
       <Body>
        <d:copy-of select="(xml-parse (data (node-list-first
                                  (select-elements
                                   (xsl-variable &quot;state&quot;) &apos;body))))"></d:copy-of>
       </Body>
      </mind:send>
     </d:if>
     <d:if test="(equal? (data (form-field &quot;action&quot; (current-node))) &quot;create&quot;)">
      <mind:link name="last">
       <mind:new>
        <xsl:attribute name="action">
         <d:copy-of select="(oid-&gt;string (me &apos;mind-action-document))"></d:copy-of>
        </xsl:attribute>
        <xsl:attribute name="protection">
         <d:copy-of select="(right-&gt;string (me &apos;protection))"></d:copy-of>
        </xsl:attribute>
<!--
        <xsl:attribute name="initialize">true</xsl:attribute>-->
        <d:copy-of select="#CONTENT">
((eval `(lambda (current-node grove-root)
          ,(read (data (select-elements (xsl-variable "state") 'expression)))))
  (let ((value (xml-parse (data (select-elements (xsl-variable "state") 'body)))))
 (lambda () value))
 grove-root)
</d:copy-of>
       </mind:new>
      </mind:link>
     </d:if>
     <d:if test="
              (equal? &quot;new&quot; (data (form-field &apos;action (current-node))))
    ">
      <mind:link name="last">
       <mind:new>
        <xsl:attribute name="action">
         <d:copy-of select="(data (form-field &quot;newaction&quot; (current-node)))"></d:copy-of>
        </xsl:attribute>
        <xsl:attribute name="protection">
         <d:copy-of select="(data (form-field &quot;protection&quot; (current-node)))"></d:copy-of>
        </xsl:attribute>
        <xsl:attribute name="initialize">
         <d:copy-of select="(data (form-field &quot;initialize&quot; (current-node)))"></d:copy-of>
        </xsl:attribute>
        <d:copy-of select="
 (fetch (parsed-locator (data (form-field &quot;read&quot; (current-node))))
        body: (xml-parse (data (children (document-element (form-field &quot;body&quot; (current-node)))))))
"></d:copy-of>
       </mind:new>
      </mind:link>
     </d:if>
     <mind:output method="xml"></mind:output>
    </mind:reply>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:template>
</xsl:stylesheet>

Diese Seite findet man von: overview, .




Letzte Modifikation: Tue, 20 May 2003 12:09:23 +0200

Autor(en): jfw,

Dokument Nummer A67bb0753e1676f81983e0ecf3a15b391 geliefert an public um Thu, 20 Nov 2008 12:38:21 +0100