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

<!--
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

 Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.

 The contents of this file are subject to the terms of either the GNU
 General Public License Version 2 only ("GPL") or the Common Development
 and Distribution License("CDDL") (collectively, the "License").  You
 may not use this file except in compliance with the License. You can obtain
 a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
 or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
 language governing permissions and limitations under the License.

 When distributing the software, include this License Header Notice in each
 file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
 Sun designates this particular file as subject to the "Classpath" exception
 as provided by Sun in the GPL Version 2 section of the License file that
 accompanied this code.  If applicable, add the following below the License
 Header, with the fields enclosed by brackets [] replaced by your own
 identifying information: "Portions Copyrighted [year]
 [name of copyright owner]"

 Contributor(s):

 If you wish your version of this file to be governed by only the CDDL or
 only the GPL Version 2, indicate your decision by adding "[Contributor]
 elects to include this software in this distribution under the [CDDL or GPL
 Version 2] license."  If you don't indicate a single choice of license, a
 recipient has the option to distribute your version of this file under
 either the CDDL, the GPL Version 2 or to extend the choice of license to
 its licensees as provided above.  However, if you add GPL Version 2 code
 and therefore, elected the GPL Version 2 license, then the option applies
 only if the new code is made subject to such option by the copyright
 holder.
-->
<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:xsdNMTOKENType"/>
            <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: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:element name="method-signature"
                             type="javaee:string"
                             minOccurs="0">
                    <xsd:annotation>
                        <xsd:documentation>

                            Defines the method signature for a MethodExpression-
                            enabled attribute.

                        </xsd:documentation>
                    </xsd:annotation>
                </xsd:element>
            </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>
