home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / ExampleCustom.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  1.9 KB  |  52 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <html xmlns:osm="http://osmosis.gr/osml/1.0">
  18.   <head>
  19.     <osm:pageTitle>
  20.       <osm:text>Custom Example</osm:text>
  21.     </osm:pageTitle>
  22.   </head>
  23.   <body contentID="content">
  24.     <p class="title">
  25.       <osm:text>Custom Example</osm:text>
  26.     </p>
  27.     <p class="paratitle">Custom elements</p>
  28.     <p>It is possible to create any custom element. This element have to belong to osm: namespace</p>
  29.     <p class="paratitle">For example</p>
  30.     <p>We want to create an element that display an alert msg on click.</p>
  31.     <p>The element:</p>
  32.     <pre><![CDATA[<button caption="click here" msg="this is an alert message!!!"/> ]]></pre>
  33.     <p>The xslt transformation saved in custombutton.xsl [osml/plugins/custombuttom.xsl]</p>
  34.     <pre><![CDATA[
  35.   <xsl:template match="osm:custombutton">
  36.     <input type="button">
  37.     <xsl:attribute name="value"><xsl:value-of select="@caption"/></xsl:attribute>
  38.     <xsl:attribute name="onclick">alert('<xsl:value-of select="@msg"/>')</xsl:attribute>
  39.     </input>
  40.   </xsl:template>
  41.     ]]></pre>
  42.     <p>and our button:</p>
  43.     <osm:custombutton caption="click here" msg="this is an alert message!!!"/>
  44.     <p>to include these transformation instructions to othello we have to modify core.xsl</p>
  45.     <pre><![CDATA[
  46.   ...
  47.   <xsl:include href="../plugins/custombutton.xsl"/>    
  48.   ...
  49.   ]]></pre>
  50.   </body>
  51. </html>
  52.