You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/04/01 05:59:35 UTC
svn commit: r1087575 [2/2] - in /myfaces/core/branches/2.1.x/impl/src:
main/java/org/apache/myfaces/config/
main/java/org/apache/myfaces/config/element/
main/java/org/apache/myfaces/config/impl/digester/
main/java/org/apache/myfaces/config/impl/digeste...
Added: myfaces/core/branches/2.1.x/impl/src/main/resources/org/apache/myfaces/resource/web-facesconfig_2_1.xsd
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/main/resources/org/apache/myfaces/resource/web-facesconfig_2_1.xsd?rev=1087575&view=auto
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/main/resources/org/apache/myfaces/resource/web-facesconfig_2_1.xsd (added)
+++ myfaces/core/branches/2.1.x/impl/src/main/resources/org/apache/myfaces/resource/web-facesconfig_2_1.xsd Fri Apr 1 03:59:34 2011
@@ -0,0 +1,676 @@
+<?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.
+-->
+
+<!--
+ ** This XSD contains only the programatic elements required for an implementation.
+ ** For the XSD from Sun that includes documentation and other copyrighted information
+ ** please refer to the latest XSD at :
+ ** http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd
+-->
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee" attributeFormDefault="unqualified"
+ elementFormDefault="qualified" targetNamespace="http://java.sun.com/xml/ns/javaee"
+ version="2.1">
+
+ <xsd:include schemaLocation="javaee_5.xsd"/>
+
+ <xsd:element name="faces-config" type="javaee:faces-configType">
+ <xsd:unique name="faces-config-converter-ID-uniqueness">
+ <xsd:selector xpath="javaee:converter"/>
+ <xsd:field xpath="javaee:converter-id"/>
+ </xsd:unique>
+ <xsd:unique name="faces-config-converter-for-class-uniqueness">
+ <xsd:selector xpath="javaee:converter"/>
+ <xsd:field xpath="javaee:converter-for-class"/>
+ </xsd:unique>
+ <xsd:unique name="faces-config-validator-ID-uniqueness">
+ <xsd:selector xpath="javaee:validator"/>
+ <xsd:field xpath="javaee:validator-id"/>
+ </xsd:unique>
+ <xsd:unique name="faces-config-managed-bean-name-uniqueness">
+ <xsd:selector xpath="javaee:managed-bean"/>
+ <xsd:field xpath="javaee:managed-bean-name"/>
+ </xsd:unique>
+ </xsd:element>
+
+ <xsd:complexType name="faces-configType">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="application" type="javaee:faces-config-applicationType"/>
+ <xsd:element name="ordering" type="javaee:faces-config-orderingType"/>
+ <xsd:element name="absolute-ordering" type="javaee:faces-config-absoluteOrderingType"/>
+ <xsd:element name="factory" type="javaee:faces-config-factoryType"/>
+ <xsd:element name="component" type="javaee:faces-config-componentType"/>
+ <xsd:element name="converter" type="javaee:faces-config-converterType"/>
+ <xsd:element name="managed-bean" type="javaee:faces-config-managed-beanType"/>
+ <xsd:element name="name" type="javaee:java-identifierType" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="navigation-rule" type="javaee:faces-config-navigation-ruleType"/>
+ <xsd:element name="referenced-bean" type="javaee:faces-config-referenced-beanType"/>
+ <xsd:element name="render-kit" type="javaee:faces-config-render-kitType"/>
+ <xsd:element name="lifecycle" type="javaee:faces-config-lifecycleType"/>
+ <xsd:element name="validator" type="javaee:faces-config-validatorType"/>
+ <xsd:element name="behavior" type="javaee:faces-config-behaviorType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="faces-config-extension"
+ type="javaee:faces-config-extensionType"/>
+ </xsd:choice>
+ <xsd:attribute name="metadata-complete" type="xsd:boolean" use="optional"></xsd:attribute>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ <xsd:attribute name="version" type="javaee:faces-config-versionType" use="required"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-applicationType">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="action-listener" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="default-render-kit-id" type="javaee:string"/>
+ <xsd:element name="message-bundle" type="javaee:string"/>
+ <xsd:element name="navigation-handler" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="view-handler" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="resource-handler" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="state-manager" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="el-resolver" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="property-resolver" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="variable-resolver" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="locale-config" type="javaee:faces-config-locale-configType"/>
+ <xsd:element name="resource-bundle"
+ type="javaee:faces-config-application-resource-bundleType"/>
+ <xsd:element name="default-validators" type="javaee:faces-config-default-validatorsType"/>
+ <xsd:element name="partial-traversal" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="system-event-listener" type="javaee:faces-config-system-event-listenerType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="application-extension"
+ type="javaee:faces-config-application-extensionType"/>
+ </xsd:choice>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-orderingType">
+ <xsd:sequence>
+ <xsd:element name="after" type="javaee:faces-config-ordering-orderingType" minOccurs="0" maxOccurs="1"/>
+ <xsd:element name="before" type="javaee:faces-config-ordering-orderingType" minOccurs="0" maxOccurs="1"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-ordering-orderingType">
+ <xsd:sequence>
+ <xsd:element name="name" type="javaee:java-identifierType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="others" type="javaee:faces-config-ordering-othersType" minOccurs="0" maxOccurs="1" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-ordering-othersType">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-absoluteOrderingType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="name" type="javaee:java-identifierType" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="others" type="javaee:faces-config-ordering-othersType" minOccurs="0" maxOccurs="1" />
+ </xsd:choice>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-application-resource-bundleType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="base-name" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="var" type="javaee:string"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-application-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-factoryType">
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="application-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="exception-handler-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="external-context-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="faces-context-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="facelet-cache-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="partial-view-context-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="lifecycle-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="view-declaration-language-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="tag-handler-delegate-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="render-kit-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="visit-context-factory" type="javaee:fully-qualified-classType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="factory-extension"
+ type="javaee:faces-config-factory-extensionType"/>
+ </xsd:choice>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-factory-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-attributeType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="attribute-name" type="javaee:string"/>
+ <xsd:element name="attribute-class" type="javaee:fully-qualified-classType"/>
+ <xsd:element minOccurs="0" name="default-value"
+ type="javaee:faces-config-default-valueType"/>
+ <xsd:element minOccurs="0" name="suggested-value"
+ type="javaee:faces-config-suggested-valueType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="attribute-extension"
+ type="javaee:faces-config-attribute-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-attribute-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-componentType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="component-type" type="javaee:string"/>
+ <xsd:element name="component-class" type="javaee:fully-qualified-classType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="facet"
+ type="javaee:faces-config-facetType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="attribute"
+ type="javaee:faces-config-attributeType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="property"
+ type="javaee:faces-config-propertyType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="component-extension"
+ type="javaee:faces-config-component-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-component-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-default-localeType">
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:faces-config-localeType">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-default-valueType">
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:simpleType name="faces-config-el-expressionType">
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value="#\{.*\}"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="faces-config-facetType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="facet-name" type="javaee:java-identifierType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="facet-extension"
+ type="javaee:faces-config-facet-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-facet-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-from-view-idType">
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-from-actionType">
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:faces-config-el-expressionType">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-converterType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:choice>
+ <xsd:element name="converter-id" type="javaee:string"/>
+ <xsd:element name="converter-for-class" type="javaee:fully-qualified-classType"/>
+ </xsd:choice>
+ <xsd:element name="converter-class" type="javaee:fully-qualified-classType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="attribute"
+ type="javaee:faces-config-attributeType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="property"
+ type="javaee:faces-config-propertyType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="converter-extension"
+ type="javaee:faces-config-converter-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-converter-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-lifecycleType">
+ <xsd:sequence>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="phase-listener"
+ type="javaee:fully-qualified-classType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="lifecycle-extension"
+ type="javaee:faces-config-lifecycle-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-lifecycle-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:simpleType name="faces-config-localeType">
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value="[a-z]{2}(_|-)?([\p{L}\-\p{Nd}]{2})?"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+ <xsd:complexType name="faces-config-locale-configType">
+ <xsd:sequence>
+ <xsd:element minOccurs="0" name="default-locale"
+ type="javaee:faces-config-default-localeType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="supported-locale"
+ type="javaee:faces-config-supported-localeType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-managed-beanType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="managed-bean-name" type="javaee:java-identifierType"/>
+ <xsd:element name="managed-bean-class" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="managed-bean-scope"
+ type="javaee:faces-config-managed-bean-scopeOrNoneType"/>
+ <xsd:choice>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="managed-property"
+ type="javaee:faces-config-managed-propertyType"/>
+ <xsd:element name="map-entries" type="javaee:faces-config-map-entriesType"/>
+ <xsd:element name="list-entries" type="javaee:faces-config-list-entriesType"/>
+ </xsd:choice>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="managed-bean-extension"
+ type="javaee:faces-config-managed-bean-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ <xsd:attribute name="eager" type="xsd:boolean" use="optional"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-managed-bean-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-managed-bean-scopeOrNoneType">
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string">
+ <xsd:enumeration value="request"/>
+ <xsd:enumeration value="session"/>
+ <xsd:enumeration value="application"/>
+ <xsd:enumeration value="none"/>
+ </xsd:restriction>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-managed-propertyType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="property-name" type="javaee:string"/>
+ <xsd:element minOccurs="0" name="property-class" type="javaee:java-typeType"/>
+ <xsd:choice>
+ <xsd:element name="map-entries" type="javaee:faces-config-map-entriesType"/>
+ <xsd:element name="null-value" type="javaee:faces-config-null-valueType"/>
+ <xsd:element name="value" type="javaee:faces-config-valueType"/>
+ <xsd:element name="list-entries" type="javaee:faces-config-list-entriesType"/>
+ </xsd:choice>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-map-entryType">
+ <xsd:sequence>
+ <xsd:element name="key" type="javaee:string"/>
+ <xsd:choice>
+ <xsd:element name="null-value" type="javaee:faces-config-null-valueType"/>
+ <xsd:element name="value" type="javaee:faces-config-valueType"/>
+ </xsd:choice>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-map-entriesType">
+ <xsd:sequence>
+ <xsd:element minOccurs="0" name="key-class" type="javaee:fully-qualified-classType"/>
+ <xsd:element minOccurs="0" name="value-class"
+ type="javaee:faces-config-value-classType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="map-entry"
+ type="javaee:faces-config-map-entryType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-navigation-caseType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element minOccurs="0" name="from-action"
+ type="javaee:faces-config-from-actionType"/>
+ <xsd:element minOccurs="0" name="from-outcome" type="javaee:string"/>
+ <xsd:element name="if" type="javaee:faces-config-ifType" minOccurs="0" />
+ <xsd:element name="to-view-id" type="javaee:string" />
+ <xsd:element minOccurs="0" name="redirect" type="javaee:faces-config-redirectType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-ifType">
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:faces-config-el-expressionType">
+ <xsd:attribute name="id" type="xsd:ID" />
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-navigation-ruleType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element minOccurs="0" name="from-view-id"
+ type="javaee:faces-config-from-view-idType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="navigation-case"
+ type="javaee:faces-config-navigation-caseType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="navigation-rule-extension"
+ type="javaee:faces-config-navigation-rule-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-navigation-rule-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-null-valueType">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-propertyType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="property-name" type="javaee:string"/>
+ <xsd:element name="property-class" type="javaee:java-typeType"/>
+ <xsd:element minOccurs="0" name="default-value"
+ type="javaee:faces-config-default-valueType"/>
+ <xsd:element minOccurs="0" name="suggested-value"
+ type="javaee:faces-config-suggested-valueType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="property-extension"
+ type="javaee:faces-config-property-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-property-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-redirectType">
+ <xsd:annotation>
+ <xsd:documentation>
+ The "redirect" element indicates that navigation to the specified "to-view-id" should be
+ accomplished by performing an HTTP redirect rather than the usual ViewHandler mechanisms.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="view-param" type="javaee:faces-config-redirect-viewParamType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ <xsd:attribute name="include-view-params" type="xsd:boolean" use="optional"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-redirect-viewParamType">
+ <xsd:annotation>
+ <xsd:documentation>
+ The "view-param" element, only valid within a "redirect" element, contains child
+ "name" and "value" elements that must be included in the redirect url when the
+ redirect is performed.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:sequence>
+ <xsd:element name="name" type="javaee:string" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="value" type="javaee:string" minOccurs="1" maxOccurs="1"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-referenced-beanType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="referenced-bean-name" type="javaee:java-identifierType"/>
+ <xsd:element name="referenced-bean-class" type="javaee:fully-qualified-classType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-render-kitType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element minOccurs="0" name="render-kit-id" type="javaee:string"/>
+ <xsd:element minOccurs="0" name="render-kit-class"
+ type="javaee:fully-qualified-classType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="renderer"
+ type="javaee:faces-config-rendererType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="client-behavior-renderer"
+ type="javaee:faces-config-client-behavior-rendererType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="render-kit-extension"
+ type="javaee:faces-config-render-kit-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-rendererType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="component-family" type="javaee:string"/>
+ <xsd:element name="renderer-type" type="javaee:string"/>
+ <xsd:element name="renderer-class" type="javaee:fully-qualified-classType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="facet"
+ type="javaee:faces-config-facetType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="attribute"
+ type="javaee:faces-config-attributeType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="renderer-extension"
+ type="javaee:faces-config-renderer-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-renderer-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-render-kit-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-suggested-valueType">
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:string"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-supported-localeType">
+ <xsd:simpleContent>
+ <xsd:extension base="javaee:faces-config-localeType">
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-validatorType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="validator-id" type="javaee:string"/>
+ <xsd:element name="validator-class" type="javaee:fully-qualified-classType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="attribute"
+ type="javaee:faces-config-attributeType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="property"
+ type="javaee:faces-config-propertyType"/>
+ <xsd:element maxOccurs="unbounded" minOccurs="0" name="validator-extension"
+ type="javaee:faces-config-validator-extensionType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-validator-extensionType">
+ <xsd:sequence>
+ <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##any" processContents="lax"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:simpleType name="faces-config-valueType">
+ <xsd:union memberTypes="javaee:faces-config-el-expressionType xsd:string"/>
+ </xsd:simpleType>
+
+ <xsd:complexType name="faces-config-value-classType">
+ <xsd:simpleContent>
+ <xsd:restriction base="javaee:fully-qualified-classType"/>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-list-entriesType">
+ <xsd:sequence>
+ <xsd:element minOccurs="0" name="value-class"
+ type="javaee:faces-config-value-classType"/>
+ <xsd:choice maxOccurs="unbounded" minOccurs="0">
+ <xsd:element name="null-value" type="javaee:faces-config-null-valueType"/>
+ <xsd:element name="value" type="javaee:faces-config-valueType"/>
+ </xsd:choice>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-default-validatorsType">
+ <xsd:sequence>
+ <xsd:element name="validator-id" type="javaee:string" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-system-event-listenerType">
+ <xsd:sequence>
+ <xsd:element name="system-event-listener-class"
+ type="javaee:fully-qualified-classType"/>
+ <xsd:element name="system-event-class"
+ type="javaee:fully-qualified-classType"/>
+ <xsd:element name="source-class"
+ type="javaee:fully-qualified-classType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-behaviorType">
+ <xsd:sequence>
+ <xsd:group ref="javaee:descriptionGroup"/>
+ <xsd:element name="behavior-id" type="javaee:string"/>
+ <xsd:element name="behavior-class" type="javaee:fully-qualified-classType"/>
+ <xsd:element name="attribute" type="javaee:faces-config-attributeType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="property" type="javaee:faces-config-propertyType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="behavior-extension" type="javaee:faces-config-behavior-extensionType"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:complexType name="faces-config-behavior-extensionType">
+ <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="faces-config-client-behavior-rendererType">
+ <xsd:sequence>
+ <xsd:element name="client-behavior-renderer-type" type="javaee:string"/>
+ <xsd:element name="client-behavior-renderer-class" type="javaee:fully-qualified-classType"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID"/>
+ </xsd:complexType>
+
+ <xsd:simpleType name="faces-config-versionType">
+ <xsd:restriction base="xsd:token">
+ <xsd:enumeration value="1.2"/>
+ <xsd:enumeration value="2.0"/>
+ <xsd:enumeration value="2.1"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+
+</xsd:schema>
Modified: myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java?rev=1087575&r1=1087574&r2=1087575&view=diff
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java (original)
+++ myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/FaceletTestCase.java Fri Apr 1 03:59:34 2011
@@ -19,6 +19,23 @@
package org.apache.myfaces.view.facelets;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.lang.reflect.Field;
+import java.net.URI;
+import java.net.URL;
+
+import javax.faces.FacesException;
+import javax.faces.FactoryFinder;
+import javax.faces.application.ProjectStage;
+import javax.faces.application.StateManager;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.RenderKitFactory;
+
import org.apache.myfaces.application.ApplicationFactoryImpl;
import org.apache.myfaces.application.ViewHandlerImpl;
import org.apache.myfaces.config.FacesConfigDispenser;
@@ -26,10 +43,10 @@ import org.apache.myfaces.config.FacesCo
import org.apache.myfaces.config.RuntimeConfig;
import org.apache.myfaces.config.element.Behavior;
import org.apache.myfaces.config.element.ClientBehaviorRenderer;
+import org.apache.myfaces.config.element.FacesConfig;
import org.apache.myfaces.config.element.Renderer;
import org.apache.myfaces.config.impl.digester.DigesterFacesConfigDispenserImpl;
import org.apache.myfaces.config.impl.digester.DigesterFacesConfigUnmarshallerImpl;
-import org.apache.myfaces.config.element.FacesConfig;
import org.apache.myfaces.context.PartialViewContextFactoryImpl;
import org.apache.myfaces.shared_impl.application.ViewHandlerSupport;
import org.apache.myfaces.shared_impl.util.ClassUtils;
@@ -41,22 +58,6 @@ import org.apache.myfaces.test.mock.visi
import org.apache.myfaces.view.facelets.mock.MockViewDeclarationLanguageFactory;
import org.apache.myfaces.view.facelets.tag.jsf.TagHandlerDelegateFactoryImpl;
-import javax.faces.FacesException;
-import javax.faces.FactoryFinder;
-import javax.faces.application.ProjectStage;
-import javax.faces.application.StateManager;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.render.RenderKitFactory;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.lang.reflect.Field;
-import java.net.URI;
-import java.net.URL;
-
public abstract class FaceletTestCase extends AbstractJsfConfigurableMockTestCase
{
private final String filePath = this.getDirectory();
Added: myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/JSPXFaceletsProcessingTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/JSPXFaceletsProcessingTestCase.java?rev=1087575&view=auto
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/JSPXFaceletsProcessingTestCase.java (added)
+++ myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/JSPXFaceletsProcessingTestCase.java Fri Apr 1 03:59:34 2011
@@ -0,0 +1,118 @@
+/*
+ * 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.
+ */
+
+package org.apache.myfaces.view.facelets.compiler;
+
+import java.io.StringWriter;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIPanel;
+import javax.faces.component.UISelectItem;
+import javax.faces.component.UISelectOne;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.component.html.HtmlPanelGrid;
+import javax.faces.component.html.HtmlSelectOneMenu;
+
+import junit.framework.Assert;
+
+import org.apache.myfaces.config.RuntimeConfig;
+import org.apache.myfaces.config.impl.digester.elements.FaceletsProcessing;
+import org.apache.myfaces.renderkit.html.HtmlFormRenderer;
+import org.apache.myfaces.renderkit.html.HtmlGridRenderer;
+import org.apache.myfaces.renderkit.html.HtmlMenuRenderer;
+import org.apache.myfaces.renderkit.html.HtmlTextRenderer;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.view.facelets.FaceletTestCase;
+import org.junit.Test;
+
+public class JSPXFaceletsProcessingTestCase extends FaceletTestCase {
+
+ @Override
+ protected void setupComponents() throws Exception
+ {
+ application.addComponent(UIViewRoot.COMPONENT_TYPE,
+ UIViewRoot.class.getName());
+ application.addComponent(HtmlForm.COMPONENT_TYPE,
+ HtmlForm.class.getName());
+ application.addComponent(HtmlPanelGrid.COMPONENT_TYPE,
+ HtmlPanelGrid.class.getName());
+ application.addComponent(HtmlSelectOneMenu.COMPONENT_TYPE,
+ HtmlSelectOneMenu.class.getName());
+ application.addComponent(UISelectItem.COMPONENT_TYPE,
+ UISelectItem.class.getName());
+ application.addComponent(HtmlOutputText.COMPONENT_TYPE,
+ HtmlOutputText.class.getName());
+ }
+
+ @Override
+ protected void setupRenderers() throws Exception
+ {
+ renderKit.addRenderer(UIForm.COMPONENT_FAMILY,
+ "javax.faces.Form", new HtmlFormRenderer());
+ renderKit.addRenderer(UIOutput.COMPONENT_FAMILY,
+ "javax.faces.Text", new HtmlTextRenderer());
+ renderKit.addRenderer(UISelectOne.COMPONENT_FAMILY,
+ "javax.faces.Menu", new HtmlMenuRenderer());
+ renderKit.addRenderer(UIPanel.COMPONENT_FAMILY,
+ "javax.faces.Grid", new HtmlGridRenderer());
+
+ }
+
+
+
+ @Override
+ protected void setUpExternalContext() throws Exception
+ {
+ super.setUpExternalContext();
+
+ FaceletsProcessing item = new FaceletsProcessing();
+ item.setFileExtension(".jspx");
+ item.setProcessAs(FaceletsProcessing.PROCESS_AS_JSPX);
+ RuntimeConfig.getCurrentInstance(externalContext).addFaceletProcessingConfiguration(FaceletsProcessing.PROCESS_AS_JSPX, item);
+ }
+
+ @Test
+ public void testJSPXProcessing1() throws Exception
+ {
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testJSPXProcessing1.jspx");
+
+ StringWriter sw = new StringWriter();
+ MockResponseWriter mrw = new MockResponseWriter(sw);
+ facesContext.setResponseWriter(mrw);
+
+ root.encodeAll(facesContext);
+
+ sw.flush();
+
+ String resp = sw.toString();
+
+ Assert.assertFalse("Response contains DOCTYPE declaration", resp.contains("<!DOCTYPE"));
+ Assert.assertFalse("Response contains xml declaration", resp.contains("<?xml"));
+ Assert.assertFalse("Response contains xml processing instructions", resp.contains("<?name"));
+ Assert.assertFalse("Response contains cdata section", resp.contains("<![CDATA["));
+ Assert.assertFalse("Response contains cdata section", resp.contains("cdata not consumed"));
+ Assert.assertTrue("Response does not escape characters", resp.contains("In this mode, if you put a double quote, it will NOT be replaced by " : \""));
+ Assert.assertFalse("Response contains comments", resp.contains("<!--"));
+
+ }
+}
Added: myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/XHTMLFaceletsProcessingTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/XHTMLFaceletsProcessingTestCase.java?rev=1087575&view=auto
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/XHTMLFaceletsProcessingTestCase.java (added)
+++ myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/XHTMLFaceletsProcessingTestCase.java Fri Apr 1 03:59:34 2011
@@ -0,0 +1,119 @@
+/*
+ * 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.
+ */
+
+package org.apache.myfaces.view.facelets.compiler;
+
+import java.io.StringWriter;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIPanel;
+import javax.faces.component.UISelectItem;
+import javax.faces.component.UISelectOne;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.component.html.HtmlPanelGrid;
+import javax.faces.component.html.HtmlSelectOneMenu;
+
+import junit.framework.Assert;
+
+import org.apache.myfaces.config.RuntimeConfig;
+import org.apache.myfaces.config.impl.digester.elements.FaceletsProcessing;
+import org.apache.myfaces.renderkit.html.HtmlFormRenderer;
+import org.apache.myfaces.renderkit.html.HtmlGridRenderer;
+import org.apache.myfaces.renderkit.html.HtmlMenuRenderer;
+import org.apache.myfaces.renderkit.html.HtmlTextRenderer;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.view.facelets.FaceletTestCase;
+import org.junit.Test;
+
+public class XHTMLFaceletsProcessingTestCase extends FaceletTestCase {
+
+ @Override
+ protected void setupComponents() throws Exception
+ {
+ application.addComponent(UIViewRoot.COMPONENT_TYPE,
+ UIViewRoot.class.getName());
+ application.addComponent(HtmlForm.COMPONENT_TYPE,
+ HtmlForm.class.getName());
+ application.addComponent(HtmlPanelGrid.COMPONENT_TYPE,
+ HtmlPanelGrid.class.getName());
+ application.addComponent(HtmlSelectOneMenu.COMPONENT_TYPE,
+ HtmlSelectOneMenu.class.getName());
+ application.addComponent(UISelectItem.COMPONENT_TYPE,
+ UISelectItem.class.getName());
+ application.addComponent(HtmlOutputText.COMPONENT_TYPE,
+ HtmlOutputText.class.getName());
+ }
+
+ @Override
+ protected void setupRenderers() throws Exception
+ {
+ renderKit.addRenderer(UIForm.COMPONENT_FAMILY,
+ "javax.faces.Form", new HtmlFormRenderer());
+ renderKit.addRenderer(UIOutput.COMPONENT_FAMILY,
+ "javax.faces.Text", new HtmlTextRenderer());
+ renderKit.addRenderer(UISelectOne.COMPONENT_FAMILY,
+ "javax.faces.Menu", new HtmlMenuRenderer());
+ renderKit.addRenderer(UIPanel.COMPONENT_FAMILY,
+ "javax.faces.Grid", new HtmlGridRenderer());
+
+ }
+
+
+
+ @Override
+ protected void setUpExternalContext() throws Exception
+ {
+ super.setUpExternalContext();
+ /*
+ FaceletsProcessing item = new FaceletsProcessing();
+ item.setFileExtension(".view.xml");
+ item.setProcessAs(FaceletsProcessing.PROCESS_AS_XML);
+ RuntimeConfig.getCurrentInstance(externalContext).addFaceletProcessingConfiguration(FaceletsProcessing.PROCESS_AS_XML, item);
+ */
+ }
+
+ @Test
+ public void testXHTMLProcessing1() throws Exception
+ {
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testXHTMLProcessing1.xhtml");
+
+ StringWriter sw = new StringWriter();
+ MockResponseWriter mrw = new MockResponseWriter(sw);
+ facesContext.setResponseWriter(mrw);
+
+ root.encodeAll(facesContext);
+
+ sw.flush();
+
+ String resp = sw.toString();
+
+ Assert.assertTrue("Response contains DOCTYPE declaration", resp.contains("<!DOCTYPE"));
+ Assert.assertTrue("Response contains xml declaration", resp.contains("<?xml"));
+ Assert.assertTrue("Response contains xml processing instructions", resp.contains("<?name"));
+ Assert.assertTrue("Response contains cdata section", resp.contains("<![CDATA["));
+ Assert.assertTrue("Response contains cdata section", resp.contains("cdata not consumed"));
+ Assert.assertTrue("Response does not escape characters", resp.contains("In this mode, if you put a double quote, it will be replaced by " : ""));
+ Assert.assertTrue("Response contains comments", resp.contains("<!--"));
+
+ }
+}
Added: myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/XMLFaceletsProcessingTestCase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/XMLFaceletsProcessingTestCase.java?rev=1087575&view=auto
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/XMLFaceletsProcessingTestCase.java (added)
+++ myfaces/core/branches/2.1.x/impl/src/test/java/org/apache/myfaces/view/facelets/compiler/XMLFaceletsProcessingTestCase.java Fri Apr 1 03:59:34 2011
@@ -0,0 +1,118 @@
+/*
+ * 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.
+ */
+
+package org.apache.myfaces.view.facelets.compiler;
+
+import java.io.StringWriter;
+
+import javax.faces.component.UIForm;
+import javax.faces.component.UIOutput;
+import javax.faces.component.UIPanel;
+import javax.faces.component.UISelectItem;
+import javax.faces.component.UISelectOne;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.html.HtmlForm;
+import javax.faces.component.html.HtmlOutputText;
+import javax.faces.component.html.HtmlPanelGrid;
+import javax.faces.component.html.HtmlSelectOneMenu;
+
+import junit.framework.Assert;
+
+import org.apache.myfaces.config.RuntimeConfig;
+import org.apache.myfaces.config.impl.digester.elements.FaceletsProcessing;
+import org.apache.myfaces.renderkit.html.HtmlFormRenderer;
+import org.apache.myfaces.renderkit.html.HtmlGridRenderer;
+import org.apache.myfaces.renderkit.html.HtmlMenuRenderer;
+import org.apache.myfaces.renderkit.html.HtmlTextRenderer;
+import org.apache.myfaces.test.mock.MockResponseWriter;
+import org.apache.myfaces.view.facelets.FaceletTestCase;
+import org.junit.Test;
+
+public class XMLFaceletsProcessingTestCase extends FaceletTestCase {
+
+ @Override
+ protected void setupComponents() throws Exception
+ {
+ application.addComponent(UIViewRoot.COMPONENT_TYPE,
+ UIViewRoot.class.getName());
+ application.addComponent(HtmlForm.COMPONENT_TYPE,
+ HtmlForm.class.getName());
+ application.addComponent(HtmlPanelGrid.COMPONENT_TYPE,
+ HtmlPanelGrid.class.getName());
+ application.addComponent(HtmlSelectOneMenu.COMPONENT_TYPE,
+ HtmlSelectOneMenu.class.getName());
+ application.addComponent(UISelectItem.COMPONENT_TYPE,
+ UISelectItem.class.getName());
+ application.addComponent(HtmlOutputText.COMPONENT_TYPE,
+ HtmlOutputText.class.getName());
+ }
+
+ @Override
+ protected void setupRenderers() throws Exception
+ {
+ renderKit.addRenderer(UIForm.COMPONENT_FAMILY,
+ "javax.faces.Form", new HtmlFormRenderer());
+ renderKit.addRenderer(UIOutput.COMPONENT_FAMILY,
+ "javax.faces.Text", new HtmlTextRenderer());
+ renderKit.addRenderer(UISelectOne.COMPONENT_FAMILY,
+ "javax.faces.Menu", new HtmlMenuRenderer());
+ renderKit.addRenderer(UIPanel.COMPONENT_FAMILY,
+ "javax.faces.Grid", new HtmlGridRenderer());
+
+ }
+
+
+
+ @Override
+ protected void setUpExternalContext() throws Exception
+ {
+ super.setUpExternalContext();
+
+ FaceletsProcessing item = new FaceletsProcessing();
+ item.setFileExtension(".view.xml");
+ item.setProcessAs(FaceletsProcessing.PROCESS_AS_XML);
+ RuntimeConfig.getCurrentInstance(externalContext).addFaceletProcessingConfiguration(FaceletsProcessing.PROCESS_AS_XML, item);
+ }
+
+ @Test
+ public void testXMLProcessing1() throws Exception
+ {
+ UIViewRoot root = facesContext.getViewRoot();
+ vdl.buildView(facesContext, root, "testXMLProcessing1.view.xml");
+
+ StringWriter sw = new StringWriter();
+ MockResponseWriter mrw = new MockResponseWriter(sw);
+ facesContext.setResponseWriter(mrw);
+
+ root.encodeAll(facesContext);
+
+ sw.flush();
+
+ String resp = sw.toString();
+
+ Assert.assertFalse("Response contains DOCTYPE declaration", resp.contains("<!DOCTYPE"));
+ Assert.assertFalse("Response contains xml declaration", resp.contains("<?xml"));
+ Assert.assertFalse("Response contains xml processing instructions", resp.contains("<?name"));
+ Assert.assertFalse("Response contains cdata section", resp.contains("<![CDATA["));
+ Assert.assertFalse("Response contains cdata section", resp.contains("cdata not consumed"));
+ Assert.assertTrue("Response does not escape characters", resp.contains("In this mode, if you put a double quote, it will be replaced by " : ""));
+ Assert.assertFalse("Response contains comments", resp.contains("<!--"));
+
+ }
+}
Added: myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testJSPXProcessing1.jspx
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testJSPXProcessing1.jspx?rev=1087575&view=auto
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testJSPXProcessing1.jspx (added)
+++ myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testJSPXProcessing1.jspx Fri Apr 1 03:59:34 2011
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<?name value="testXmlProcessing1"?>
+<!--
+ 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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+<head>
+</head>
+<body>
+<![CDATA[cdata not consumed]]>
+<h:panelGrid columns="1">
+ In this mode, if you put a double quote, it will NOT be replaced by &quot; : "
+</h:panelGrid>
+</body>
+</html>
Added: myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testXHTMLProcessing1.xhtml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testXHTMLProcessing1.xhtml?rev=1087575&view=auto
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testXHTMLProcessing1.xhtml (added)
+++ myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testXHTMLProcessing1.xhtml Fri Apr 1 03:59:34 2011
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<?name value="testXmlProcessing1"?>
+<!--
+ 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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+<head>
+</head>
+<body>
+<![CDATA[cdata not consumed]]>
+<h:panelGrid columns="1">
+ In this mode, if you put a double quote, it will be replaced by " : "
+</h:panelGrid>
+</body>
+</html>
Added: myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testXMLProcessing1.view.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testXMLProcessing1.view.xml?rev=1087575&view=auto
==============================================================================
--- myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testXMLProcessing1.view.xml (added)
+++ myfaces/core/branches/2.1.x/impl/src/test/resources/org/apache/myfaces/view/facelets/compiler/testXMLProcessing1.view.xml Fri Apr 1 03:59:34 2011
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<?name value="testXmlProcessing1"?>
+<!--
+ 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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+<head>
+</head>
+<body>
+<![CDATA[cdata not consumed]]>
+<h:panelGrid columns="1">
+ In this mode, if you put a double quote, it will be replaced by " : "
+</h:panelGrid>
+</body>
+</html>