<?xml version = "1.0" encoding = "UTF-8"?>
<!--

    Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<xsd:schema
     targetNamespace="http://java.sun.com/xml/ns/javaee"
     xmlns:javaee="http://java.sun.com/xml/ns/javaee"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
     version="2.0">
    <xsd:include schemaLocation="javaee_5.xsd"/>
    <xsd:element name="facelet-taglib" type="javaee:facelet-taglibType">
        <xsd:unique name="facelet-taglib-tagname-uniqueness">
            <xsd:annotation>
                <xsd:documentation>

                    tag-names must be unique within a document.
                </xsd:documentation>
            </xsd:annotation>
            <xsd:selector xpath="javaee:tag"/>
            <xsd:field    xpath="javaee:tag-name"/>
        </xsd:unique>
        <xsd:unique name="faces-config-behavior-ID-uniqueness">
            <xsd:annotation>
                <xsd:documentation>

                    Behavior IDs must be unique within a document.
                </xsd:documentation>
            </xsd:annotation>
            <xsd:selector xpath="javaee:behavior"/>
            <xsd:field    xpath="javaee:behavior-id"/>
        </xsd:unique>
        <xsd:unique name="faces-config-converter-ID-uniqueness">
            <xsd:annotation>
                <xsd:documentation>

                    Converter IDs must be unique within a document.
                </xsd:documentation>
            </xsd:annotation>
            <xsd:selector xpath="javaee:converter"/>
            <xsd:field    xpath="javaee:converter-id"/>
        </xsd:unique>
        <xsd:unique name="faces-config-validator-ID-uniqueness">
            <xsd:annotation>
                <xsd:documentation>

                    Validator IDs must be unique within a document.
                </xsd:documentation>
            </xsd:annotation>
            <xsd:selector xpath="javaee:validator"/>
            <xsd:field    xpath="javaee:validator-id"/>
        </xsd:unique>
    </xsd:element>
    <xsd:complexType name="facelet-taglibType">
	<xsd:annotation>
	  <xsd:documentation>
            The top level XML element in a facelet tag library XML file.
	  </xsd:documentation>
	</xsd:annotation>
        <xsd:sequence>
            <xsd:group ref="javaee:descriptionGroup"/>
	    <xsd:choice>
		<xsd:element name="library-class"
			     type="javaee:fully-qualified-classType"/>
                <xsd:sequence>
                    <xsd:element name="namespace" type="javaee:string"/>
                    <xsd:element minOccurs="0" maxOccurs="1"
                                 name="composite-library-name"
                                 type="javaee:fully-qualified-classType"/>
                    <xsd:choice minOccurs="0" maxOccurs="unbounded">
                        <xsd:element name="tag"
                                     type="javaee:facelet-taglib-tagType"/>
                        <xsd:element name="function"
                                     type="javaee:facelet-taglib-functionType"/>

                    </xsd:choice>
                </xsd:sequence>
	    </xsd:choice>
            <xsd:element name="taglib-extension"
                         type="javaee:facelet-taglib-extensionType"
                         minOccurs="0"
                         maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="id" type="xsd:ID"/>
        <xsd:attribute name="version"
                       type="javaee:facelet-taglib-versionType"
                       use="required"/>
    </xsd:complexType>
    <xsd:complexType name="facelet-taglib-extensionType">
        <xsd:annotation>
            <xsd:documentation>
                Extension element for facelet-taglib. It may contain 
                implementation specific content.
            </xsd:documentation>
        </xsd:annotation>

        <xsd:sequence>
            <xsd:any namespace="##any"
                     processContents="lax"
                     minOccurs="0"
                     maxOccurs="unbounded" />
         </xsd:sequence>
         <xsd:attribute name="id" type="xsd:ID"/>
    </xsd:complexType>

    <xsd:complexType name="facelet-taglib-tagType">
	<xsd:annotation>
	  <xsd:documentation>
            If the tag library XML file contains individual tag
            declarations rather than pointing to a library-class or a
            declaring a composite-library name, the individual tags are
            enclosed in tag elements.
	  </xsd:documentation>
	</xsd:annotation>
        <xsd:sequence>
            <xsd:group ref="javaee:descriptionGroup"/>
            <xsd:element name="tag-name" type="javaee:facelet-taglib-canonical-nameType"/>
            <xsd:choice>
                <xsd:element name="handler-class"
                             type="javaee:fully-qualified-classType"/>
                <xsd:element name="behavior"
                             type="javaee:facelet-taglib-tag-behaviorType"/>
                <xsd:element name="component"
                             type="javaee:facelet-taglib-tag-componentType"/>
                <xsd:element name="converter"
                             type="javaee:facelet-taglib-tag-converterType"/>
                <xsd:element name="validator"
                             type="javaee:facelet-taglib-tag-validatorType"/>
                <xsd:element name="source" type="javaee:string"/>
            </xsd:choice>
            <xsd:element name="attribute"
                         type="javaee:facelet-taglib-tag-attributeType"
                         minOccurs="0"
                         maxOccurs="unbounded"/>
            <xsd:element name="tag-extension"
                         type="javaee:facelet-taglib-tag-extensionType"
                         minOccurs="0"
                         maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

<!-- **************************************************** -->

  <xsd:complexType name="facelet-taglib-tag-attributeType">
    <xsd:annotation>
      <xsd:documentation>

	The attribute element defines an attribute for the nesting
	tag.  The attribute element may have several subelements
	defining:

	description     a description of the attribute

	name            the name of the attribute

	required        whether the attribute is required or
			optional

	type            the type of the attribute

      </xsd:documentation>
    </xsd:annotation>

    <xsd:sequence>
      <xsd:group ref="javaee:descriptionGroup"/>
      <xsd:element name="name"
		   type="javaee:java-identifierType"/>
      <xsd:element name="required"
		   type="javaee:generic-booleanType"
		   minOccurs="0">
	<xsd:annotation>
	  <xsd:documentation>

	    Defines if the nesting attribute is required or
	    optional.

	    If not present then the default is "false", i.e
	    the attribute is optional.

	  </xsd:documentation>
	</xsd:annotation>
      </xsd:element>
      <xsd:choice>
	<xsd:sequence>
          <xsd:sequence minOccurs="0">
	    <xsd:element name="type"
		         type="javaee:fully-qualified-classType"
		         minOccurs="0">
	      <xsd:annotation>
	        <xsd:documentation>

		  Defines the Java type of the attributes value.
                  If this element is omitted, the expected type is
                  assumed to be "java.lang.Object".

	        </xsd:documentation>
	      </xsd:annotation>
	    </xsd:element>
	  </xsd:sequence>

        </xsd:sequence>

      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="id" type="xsd:ID"/>
  </xsd:complexType>


    <xsd:complexType name="facelet-taglib-tag-extensionType">
        <xsd:annotation>
            <xsd:documentation>
                Extension element for tag  It may contain 
                implementation specific content.
            </xsd:documentation>
        </xsd:annotation>

        <xsd:sequence>
            <xsd:any namespace="##any"
                     processContents="lax"
                     minOccurs="0"
                     maxOccurs="unbounded" />
         </xsd:sequence>
         <xsd:attribute name="id" type="xsd:ID"/>
    </xsd:complexType>
    
    <xsd:complexType name="facelet-taglib-functionType">
	<xsd:annotation>
	  <xsd:documentation>
            If the tag library XML file contains individual function
            declarations rather than pointing to a library-class or a
            declaring a composite-library name, the individual functions are
            enclosed in function elements.
	  </xsd:documentation>
	</xsd:annotation>
        <xsd:sequence>
            <xsd:group ref="javaee:descriptionGroup"/>
            <xsd:element name="function-name" type="javaee:string"/>
            <xsd:element name="function-class"
                         type="javaee:fully-qualified-classType"/>
            <xsd:element name="function-signature" type="javaee:string"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="facelet-taglib-tag-behaviorType">
        <xsd:annotation>
          <xsd:documentation>
            Within a tag element, the behavior element encapsulates
            information specific to a JSF Behavior.
          </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:group ref="javaee:descriptionGroup"/>
            <xsd:element minOccurs="1" maxOccurs="1"
                         name="behavior-id" type="javaee:string"/>
            <xsd:element minOccurs="0" maxOccurs="1"
                         name="handler-class" type="javaee:fully-qualified-classType"/>
            <xsd:element name="behavior-extension"
                         type="javaee:facelet-taglib-tag-behavior-extensionType"
                         minOccurs="0"
                         maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="facelet-taglib-tag-behavior-extensionType">
        <xsd:annotation>
            <xsd:documentation>
                Extension element for behavior. It may contain
                implementation specific content.
            </xsd:documentation>
        </xsd:annotation>

        <xsd:sequence>
            <xsd:any namespace="##any"
                     processContents="lax"
                     minOccurs="0"
                     maxOccurs="unbounded" />
         </xsd:sequence>
         <xsd:attribute name="id" type="xsd:ID"/>
    </xsd:complexType>
    <xsd:complexType name="facelet-taglib-tag-componentType">
	<xsd:annotation>
	  <xsd:documentation>
            Within a tag element, the component element encapsulates
            information specific to a JSF UIComponent.
	  </xsd:documentation>
	</xsd:annotation>
        <xsd:sequence>
            <xsd:group ref="javaee:descriptionGroup"/>
            <xsd:element name="component-type" type="javaee:string"/>
            <xsd:element minOccurs="0" maxOccurs="1"
                         name="renderer-type" type="javaee:string"/>
            <xsd:element minOccurs="0" maxOccurs="1"
                         name="handler-class"
                         type="javaee:fully-qualified-classType"/>
            <xsd:element name="component-extension"
                         type="javaee:facelet-taglib-tag-component-extensionType"
                         minOccurs="0"
                         maxOccurs="unbounded"/>
                         
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="facelet-taglib-tag-component-extensionType">
        <xsd:annotation>
            <xsd:documentation>
                Extension element for component  It may contain 
                implementation specific content.
            </xsd:documentation>
        </xsd:annotation>

        <xsd:sequence>
            <xsd:any namespace="##any"
                     processContents="lax"
                     minOccurs="0"
                     maxOccurs="unbounded" />
         </xsd:sequence>
         <xsd:attribute name="id" type="xsd:ID"/>
    </xsd:complexType>
    
    <xsd:complexType name="facelet-taglib-tag-converterType">
	<xsd:annotation>
	  <xsd:documentation>
            Within a tag element, the converter element encapsulates
            information specific to a JSF Converter.
	  </xsd:documentation>
	</xsd:annotation>
        <xsd:sequence>
            <xsd:group ref="javaee:descriptionGroup"/>
            <xsd:element minOccurs="1" maxOccurs="1"
                         name="converter-id" type="javaee:string"/>
            <xsd:element minOccurs="0" maxOccurs="1" 
                         name="handler-class" type="javaee:fully-qualified-classType"/>
            <xsd:element name="converter-extension"
                         type="javaee:facelet-taglib-tag-converter-extensionType"
                         minOccurs="0"
                         maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="facelet-taglib-tag-converter-extensionType">
        <xsd:annotation>
            <xsd:documentation>
                Extension element for converter  It may contain 
                implementation specific content.
            </xsd:documentation>
        </xsd:annotation>

        <xsd:sequence>
            <xsd:any namespace="##any"
                     processContents="lax"
                     minOccurs="0"
                     maxOccurs="unbounded" />
         </xsd:sequence>
         <xsd:attribute name="id" type="xsd:ID"/>
    </xsd:complexType>
    
    <xsd:complexType name="facelet-taglib-tag-validatorType">
	<xsd:annotation>
	  <xsd:documentation>
            Within a tag element, the validator element encapsulates
            information specific to a JSF Validator.
	  </xsd:documentation>
	</xsd:annotation>
        <xsd:sequence>
            <xsd:group ref="javaee:descriptionGroup"/>
            <xsd:element minOccurs="1" maxOccurs="1"
                         name="validator-id" type="javaee:string"/>
            <xsd:element minOccurs="0" maxOccurs="1" 
                         name="handler-class" type="javaee:fully-qualified-classType"/>
            <xsd:element name="validator-extension"
                         type="javaee:facelet-taglib-tag-validator-extensionType"
                         minOccurs="0"
                         maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="facelet-taglib-tag-validator-extensionType">
        <xsd:annotation>
            <xsd:documentation>
                Extension element for validator  It may contain 
                implementation specific content.
            </xsd:documentation>
        </xsd:annotation>

        <xsd:sequence>
            <xsd:any namespace="##any"
                     processContents="lax"
                     minOccurs="0"
                     maxOccurs="unbounded" />
         </xsd:sequence>
         <xsd:attribute name="id" type="xsd:ID"/>
    </xsd:complexType>
    
    <!-- **************************************************** -->
    <xsd:simpleType name="facelet-taglib-versionType">
        <xsd:annotation>
            <xsd:documentation>
                This type contains the recognized versions of
                facelet-taglib supported.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:token">
            <xsd:enumeration value="2.0"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="facelet-taglib-canonical-nameType">

      <xsd:annotation>
        <xsd:documentation>
   
         Defines the canonical name of a tag or attribute being
         defined.

         The name must conform to the lexical rules for an NCName

	</xsd:documentation>
    </xsd:annotation>

    <xsd:simpleContent>
      <xsd:extension base="xsd:NCName">
        <xsd:attribute name="id" type="xsd:ID"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

</xsd:schema>
