<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<fd:library xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
            xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
  <fd:widgets>
  
  	<!-- macro -->
    <fd:class id="class1">
      <fd:widgets>
        <fd:field id="field1">
          <fd:label>Field1:</fd:label>
          <fd:datatype base="string"/>          
        </fd:field>
      </fd:widgets>
    </fd:class>
    
    <!-- simple field -->
    <fd:field id="field2">
      <fd:label>Field2:</fd:label>
      <fd:datatype base="string"/> 
      <fd:help>
        This is help text set by the library.
        <small>Anyway, the point of all this was to show a popup help with mixed html content.</small>
      </fd:help>       
    </fd:field>
    
    <!-- field - validator inheritance -->
    <fd:field id="email">
      <fd:datatype base="string"/>
      <fd:validation>
        <fd:email/>
      </fd:validation>
      <fd:label>Enter an <b>email</b> address:</fd:label>
      <fd:help>
				global email adress
      </fd:help>
    </fd:field>   
    
    <!-- field - selection list inheritance -->
    <fd:field id="account">
      <fd:label>Indicate the size of your bank account (in m<sup>3</sup>):</fd:label>
      <fd:datatype base="long"/>
      <fd:selection-list>
        <fd:item value="1"/>
        <fd:item value="2"/>
        <fd:item value="3">
          <fd:label>three</fd:label>
        </fd:item>
        <fd:item value="4"/>
        <fd:item value="5"/>
      </fd:selection-list>
    </fd:field>    
    
    <!-- multi value field -->
    <fd:multivaluefield id="drinks">
      <fd:label>Indicate which 2 of the following drinks you'd like to receive:</fd:label>
      <fd:datatype base="string"/>
      <!--fd:validation>
        <fd:value-count exact="2"/>
      </fd:validation-->
      <fd:selection-list>
        <fd:item value="Maes"/>
        <fd:item value="Jupiler"/>
        <fd:item value="Leffe"/>
        <fd:item value="Hoegaarden"/>
        <fd:item value="Coca Cola"/>
      </fd:selection-list>
    </fd:multivaluefield>    

    <fd:submit id="cancel" validate="false">
      <fd:label>Cancel</fd:label>
    </fd:submit>

  </fd:widgets>
</fd:library>
