/*
 * The Apache Software License, Version 1.1
 *
 *
 * Copyright (c) 1999-2004 The Apache Software Foundation.  All rights 
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer. 
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:  
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Xalan" and "Apache Software Foundation" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written 
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache",
 *    nor may "Apache" appear in their name, without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation and was
 * originally based on software copyright (c) 1999, International
 * Business Machines, Inc., http://www.ibm.com.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */
#include "XalanHTMLElementsProperties.hpp"



#include <xalanc/PlatformSupport/DOMStringHelper.hpp>
#include <xalanc/PlatformSupport/XalanUnicode.hpp>




XALAN_CPP_NAMESPACE_BEGIN



XalanHTMLElementsProperties::XalanHTMLElementsProperties()
{
}



XalanHTMLElementsProperties::ElementProperties
XalanHTMLElementsProperties::find(const XalanDOMChar*	theElementName)
{
	const InternalElementProperties&	theProperties =
		findProperties(theElementName);

	return ElementProperties(&theProperties);
}



bool
XalanHTMLElementsProperties::InternalElementProperties::isAttribute(
				const XalanDOMChar*		theAttributeName,
				AttributeFlagsType		theFlags) const
{
	const InternalAttributeProperties&	theProperties =
				findProperties(theAttributeName);

	return theProperties.is(theFlags);
}



const XalanHTMLElementsProperties::InternalAttributeProperties&
XalanHTMLElementsProperties::InternalElementProperties::findProperties(const XalanDOMChar*	theAttributeName) const
{
	const InternalAttributeProperties*	theCurrent = m_attributes;

	for(;;)
	{
		if (theCurrent->m_name[0] == 0)
		{
			return s_dummyProperties;
		}

		const int	theResult = compareIgnoreCaseASCII(theAttributeName, theCurrent->m_name);

		if (theResult == 0)
		{
			break;
		}
		else if (theResult < 0)
		{
			return s_dummyProperties;
		}
		else
		{
			++theCurrent;
		}
	}

	assert(theCurrent != 0);

	return *theCurrent;
}



const XalanHTMLElementsProperties::InternalAttributeProperties	XalanHTMLElementsProperties::InternalElementProperties::s_dummyProperties =
				 { { 0 }, 0 };



const XalanHTMLElementsProperties::InternalElementProperties&
XalanHTMLElementsProperties::findProperties(const XalanDOMChar*		theElementName)
{
	assert(theElementName != 0);

	// Find the InternalElementProperties instance, if any...
	const InternalElementProperties*	theFirst = s_elementProperties;
	const InternalElementProperties*	theLast = s_lastProperties;

	while(theFirst <= theLast)
	{
		const InternalElementProperties*	theCurrent = theFirst + (theLast - theFirst) / 2;
		assert(theCurrent->m_name[0] != 0);

		const int	theResult = compareIgnoreCaseASCII(theElementName, theCurrent->m_name);

		if (theResult < 0)
		{
			theLast = theCurrent - 1;
		}
		else if (theResult > 0)
		{
			theFirst = theCurrent + 1;
		}
		else
		{
			return *theCurrent;
		}
	}

	return *s_dummyProperties;
}



typedef XalanHTMLElementsProperties		ElemDesc;

const XalanHTMLElementsProperties::InternalElementProperties	XalanHTMLElementsProperties::s_elementProperties[] =
{
	// Note that these are in a particular order, which is not a collation order.  It is
	// the ordering that is imposed by the function compareIgnoreCaseASCII().  Basically,
	// strings are first collated by length, and the by their characters.  Additions
	// must obey the same rules, or the code will not work correctly.

	// Also, should new entries be added, you must make sure that all static sizes are
	// still adequate to hold the additions.  You must consider the length of the
	// name of the element or attribute, and the number of attributes.  There are enums
	// defined in the header file which indicate the maximum size of each.
	{
		{ XalanUnicode::charLetter_A, 0 },
		ElemDesc::SPECIAL,
		{
			{
				{ XalanUnicode::charLetter_H, XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, XalanUnicode::charLetter_F, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_N, XalanUnicode::charLetter_A, XalanUnicode::charLetter_M, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTRURL,
			},
			// This is a dummy entry and it must be the last one!!! Each array of
			// InternalAttributesProperties must be terminated by a dummy entry.
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_B, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_I, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_P, 0 },
		ElemDesc::BLOCK | ElemDesc::BLOCKFORM | ElemDesc::BLOCKFORMFIELDSET,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_Q, 0 },
		ElemDesc::SPECIAL | ElemDesc::ASPECIAL,
		{
			{
			
				{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_I, XalanUnicode::charLetter_T, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_U, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_B, XalanUnicode::charLetter_R, 0 },
		ElemDesc::EMPTY | ElemDesc::BLOCK | ElemDesc::SPECIAL | ElemDesc::ASPECIAL,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_D, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_L, 0 },
		ElemDesc::BLOCK | ElemDesc::BLOCKFORM | ElemDesc::BLOCKFORMFIELDSET,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_T, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_E, XalanUnicode::charLetter_M, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_H, XalanUnicode::charDigit_1, 0 },
		ElemDesc::BLOCK | ElemDesc::HEAD,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_H, XalanUnicode::charDigit_2, 0 },
		ElemDesc::BLOCK | ElemDesc::HEAD,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_H, XalanUnicode::charDigit_3, 0 },
		ElemDesc::BLOCK | ElemDesc::HEAD,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_H, XalanUnicode::charDigit_4, 0 },
		ElemDesc::BLOCK | ElemDesc::HEAD,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_H, XalanUnicode::charDigit_5, 0 },
		ElemDesc::BLOCK | ElemDesc::HEAD,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_H, XalanUnicode::charDigit_6, 0 },
		ElemDesc::BLOCK | ElemDesc::HEAD,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_H, XalanUnicode::charLetter_R, 0 },
		ElemDesc::EMPTY | ElemDesc::BLOCK | ElemDesc::BLOCKFORM | ElemDesc::BLOCKFORMFIELDSET,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_L, XalanUnicode::charLetter_I, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_O, XalanUnicode::charLetter_L, 0 },
		ElemDesc::BLOCK | ElemDesc::LIST,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_D, 0 },
		0,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_H, 0 },
		0,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_R, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_T, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_U, XalanUnicode::charLetter_L, 0 },
		ElemDesc::BLOCK | ElemDesc::LIST,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_B, XalanUnicode::charLetter_D, XalanUnicode::charLetter_O, 0 },
		ElemDesc::SPECIAL | ElemDesc::ASPECIAL,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_B, XalanUnicode::charLetter_I, XalanUnicode::charLetter_G, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_O, XalanUnicode::charLetter_L, 0 },
		ElemDesc::EMPTY | ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_E, XalanUnicode::charLetter_L, 0 },
		0,
		{
			{
			
				{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_I, XalanUnicode::charLetter_T, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_F, XalanUnicode::charLetter_N, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_I, XalanUnicode::charLetter_R, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_I, XalanUnicode::charLetter_V, 0 },
		ElemDesc::BLOCK | ElemDesc::BLOCKFORM | ElemDesc::BLOCKFORMFIELDSET,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_I, XalanUnicode::charLetter_M, XalanUnicode::charLetter_G, 0 },
		ElemDesc::EMPTY | ElemDesc::SPECIAL | ElemDesc::ASPECIAL | ElemDesc::WHITESPACESENSITIVE,
		{
			{
			
				{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_R, XalanUnicode::charLetter_C, 0 },
				ElemDesc::ATTRURL,
			},
			{
			
				{ XalanUnicode::charLetter_I, XalanUnicode::charLetter_S, XalanUnicode::charLetter_M, XalanUnicode::charLetter_A, XalanUnicode::charLetter_P, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
			
				{ XalanUnicode::charLetter_U, XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, XalanUnicode::charLetter_M, XalanUnicode::charLetter_A, XalanUnicode::charLetter_P, 0 },
				ElemDesc::ATTRURL,
			},
			{
			
				{ XalanUnicode::charLetter_L, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, XalanUnicode::charLetter_G, XalanUnicode::charLetter_D, XalanUnicode::charLetter_E, XalanUnicode::charLetter_S, XalanUnicode::charLetter_C, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_I, XalanUnicode::charLetter_N, XalanUnicode::charLetter_S, 0 },
		0,
		{
			{
				{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_I, XalanUnicode::charLetter_T, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_K, XalanUnicode::charLetter_B, XalanUnicode::charLetter_D, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_M, XalanUnicode::charLetter_A, XalanUnicode::charLetter_P, 0 },
		ElemDesc::BLOCK | ElemDesc::SPECIAL | ElemDesc::ASPECIAL,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_P, XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, 0 },
		ElemDesc::BLOCK | ElemDesc::PREFORMATTED,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_U, XalanUnicode::charLetter_B, 0 },
		ElemDesc::SPECIAL | ElemDesc::ASPECIAL,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_U, XalanUnicode::charLetter_P, 0 },
		ElemDesc::SPECIAL | ElemDesc::ASPECIAL,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_V, XalanUnicode::charLetter_A, XalanUnicode::charLetter_R, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_A, XalanUnicode::charLetter_B, XalanUnicode::charLetter_B, XalanUnicode::charLetter_R, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_A, XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, XalanUnicode::charLetter_A, 0 },
		ElemDesc::EMPTY | ElemDesc::BLOCK,
		{
			{
				{ XalanUnicode::charLetter_H, XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, XalanUnicode::charLetter_F, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_N, XalanUnicode::charLetter_O, XalanUnicode::charLetter_H, XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, XalanUnicode::charLetter_F, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_B, XalanUnicode::charLetter_A, XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, 0 },
		ElemDesc::EMPTY | ElemDesc::BLOCK,
		{
			{
				{ XalanUnicode::charLetter_H, XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, XalanUnicode::charLetter_F, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_B, XalanUnicode::charLetter_O, XalanUnicode::charLetter_D, XalanUnicode::charLetter_Y, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_I, XalanUnicode::charLetter_T, XalanUnicode::charLetter_E, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_O, XalanUnicode::charLetter_D, XalanUnicode::charLetter_E, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_F, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, XalanUnicode::charLetter_T, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_F, XalanUnicode::charLetter_O, XalanUnicode::charLetter_R, XalanUnicode::charLetter_M, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ XalanUnicode::charLetter_A, XalanUnicode::charLetter_C, XalanUnicode::charLetter_T, XalanUnicode::charLetter_I, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_H, XalanUnicode::charLetter_E, XalanUnicode::charLetter_A, XalanUnicode::charLetter_D, 0 },
		ElemDesc::BLOCK | ElemDesc::HEADELEM,
		{
			{
				{ XalanUnicode::charLetter_P, XalanUnicode::charLetter_R, XalanUnicode::charLetter_O, XalanUnicode::charLetter_F, XalanUnicode::charLetter_I, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_H, XalanUnicode::charLetter_T, XalanUnicode::charLetter_M, XalanUnicode::charLetter_L, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_L, XalanUnicode::charLetter_I, XalanUnicode::charLetter_N, XalanUnicode::charLetter_K, 0 },
		ElemDesc::EMPTY | ElemDesc::BLOCK | ElemDesc::HEADMISC,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_M, XalanUnicode::charLetter_E, XalanUnicode::charLetter_N, XalanUnicode::charLetter_U, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_M, XalanUnicode::charLetter_E, XalanUnicode::charLetter_T, XalanUnicode::charLetter_A, 0 },
		ElemDesc::EMPTY | ElemDesc::BLOCK | ElemDesc::HEADMISC,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_N, XalanUnicode::charLetter_O, XalanUnicode::charLetter_B, XalanUnicode::charLetter_R, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_A, XalanUnicode::charLetter_M, XalanUnicode::charLetter_P, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_P, XalanUnicode::charLetter_A, XalanUnicode::charLetter_N, 0 },
		ElemDesc::SPECIAL | ElemDesc::ASPECIAL,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_F, XalanUnicode::charLetter_R, XalanUnicode::charLetter_A, XalanUnicode::charLetter_M, XalanUnicode::charLetter_E, 0 },
		ElemDesc::EMPTY | ElemDesc::BLOCK,
		{
			{
				{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_R, XalanUnicode::charLetter_C, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_I, XalanUnicode::charLetter_N, XalanUnicode::charLetter_P, XalanUnicode::charLetter_U, XalanUnicode::charLetter_T, 0 },
		ElemDesc::EMPTY | ElemDesc::INLINELABEL | ElemDesc::FORMCTRL,
		{
			{
				{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_R, XalanUnicode::charLetter_C, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_I, XalanUnicode::charLetter_S, XalanUnicode::charLetter_M, XalanUnicode::charLetter_A, XalanUnicode::charLetter_P, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ XalanUnicode::charLetter_U, XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, XalanUnicode::charLetter_M, XalanUnicode::charLetter_A, XalanUnicode::charLetter_P, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_H, XalanUnicode::charLetter_E, XalanUnicode::charLetter_C, XalanUnicode::charLetter_K, XalanUnicode::charLetter_E, XalanUnicode::charLetter_D, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_I, XalanUnicode::charLetter_S, XalanUnicode::charLetter_A, XalanUnicode::charLetter_B, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_D, 0 },
				ElemDesc::ATTREMPTY,
				},
			{
				{ XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, XalanUnicode::charLetter_A, XalanUnicode::charLetter_D, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, XalanUnicode::charLetter_L, XalanUnicode::charLetter_Y, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_L, XalanUnicode::charLetter_A, XalanUnicode::charLetter_B, XalanUnicode::charLetter_E, XalanUnicode::charLetter_L, 0 },
		ElemDesc::FORMCTRL,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_P, XalanUnicode::charLetter_A, XalanUnicode::charLetter_R, XalanUnicode::charLetter_A, XalanUnicode::charLetter_M, 0 },
		ElemDesc::EMPTY,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_M, XalanUnicode::charLetter_A, XalanUnicode::charLetter_L, XalanUnicode::charLetter_L, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_T, XalanUnicode::charLetter_Y, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, 0 },
		ElemDesc::BLOCK | ElemDesc::RAW | ElemDesc::HEADMISC | ElemDesc::STYLEELEM,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_A, XalanUnicode::charLetter_B, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, 0 },
		ElemDesc::BLOCK | ElemDesc::BLOCKFORM | ElemDesc::BLOCKFORMFIELDSET,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_B, XalanUnicode::charLetter_O, XalanUnicode::charLetter_D, XalanUnicode::charLetter_Y, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_F, XalanUnicode::charLetter_O, XalanUnicode::charLetter_O, XalanUnicode::charLetter_T, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_H, XalanUnicode::charLetter_E, XalanUnicode::charLetter_A, XalanUnicode::charLetter_D, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_I, XalanUnicode::charLetter_T, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_A, XalanUnicode::charLetter_P, XalanUnicode::charLetter_P, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_T, 0 },
		ElemDesc::WHITESPACESENSITIVE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_B, XalanUnicode::charLetter_U, XalanUnicode::charLetter_T, XalanUnicode::charLetter_T, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, 0 },
		ElemDesc::INLINELABEL | ElemDesc::FORMCTRL,
		{
			{
			
				{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_I, XalanUnicode::charLetter_S, XalanUnicode::charLetter_A, XalanUnicode::charLetter_B, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_D, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_E, XalanUnicode::charLetter_N, XalanUnicode::charLetter_T, XalanUnicode::charLetter_E, XalanUnicode::charLetter_R, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_G, XalanUnicode::charLetter_E, XalanUnicode::charLetter_N, XalanUnicode::charLetter_D, 0 },
		0,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_O, XalanUnicode::charLetter_B, XalanUnicode::charLetter_J, XalanUnicode::charLetter_E, XalanUnicode::charLetter_C, XalanUnicode::charLetter_T, 0 },
		ElemDesc::SPECIAL | ElemDesc::ASPECIAL | ElemDesc::HEADMISC | ElemDesc::WHITESPACESENSITIVE,
		{
			{
				{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_A, XalanUnicode::charLetter_T, XalanUnicode::charLetter_A, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_U, XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, XalanUnicode::charLetter_M, XalanUnicode::charLetter_A, XalanUnicode::charLetter_P, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_A, XalanUnicode::charLetter_R, XalanUnicode::charLetter_C, XalanUnicode::charLetter_H, XalanUnicode::charLetter_I, XalanUnicode::charLetter_V, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_L, XalanUnicode::charLetter_A, XalanUnicode::charLetter_S, XalanUnicode::charLetter_S, XalanUnicode::charLetter_I, XalanUnicode::charLetter_D, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_E, XalanUnicode::charLetter_C, XalanUnicode::charLetter_L, XalanUnicode::charLetter_A, XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_O, XalanUnicode::charLetter_D, XalanUnicode::charLetter_E, XalanUnicode::charLetter_B, XalanUnicode::charLetter_A, XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_O, XalanUnicode::charLetter_P, XalanUnicode::charLetter_T, XalanUnicode::charLetter_I, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, 0 },
		0,
		{
			{
				{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_I, XalanUnicode::charLetter_S, XalanUnicode::charLetter_A, XalanUnicode::charLetter_B, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_D, 0 },
				ElemDesc::ATTREMPTY,
			},
			{	
				{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_C, XalanUnicode::charLetter_T, XalanUnicode::charLetter_E, XalanUnicode::charLetter_D, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_C, XalanUnicode::charLetter_R, XalanUnicode::charLetter_I, XalanUnicode::charLetter_P, XalanUnicode::charLetter_T, 0 },
		ElemDesc::RAW | ElemDesc::SPECIAL | ElemDesc::ASPECIAL | ElemDesc::HEADMISC | ElemDesc::SCRIPTELEM,
		{
			{
				{ XalanUnicode::charLetter_F, XalanUnicode::charLetter_O, XalanUnicode::charLetter_R, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_R, XalanUnicode::charLetter_C, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_E, XalanUnicode::charLetter_F, XalanUnicode::charLetter_E, XalanUnicode::charLetter_R, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_C, XalanUnicode::charLetter_T, 0 },
		ElemDesc::INLINELABEL | ElemDesc::FORMCTRL,
		{
			{
			
				{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_I, XalanUnicode::charLetter_S, XalanUnicode::charLetter_A, XalanUnicode::charLetter_B, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_D, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
			
				{ XalanUnicode::charLetter_M, XalanUnicode::charLetter_U, XalanUnicode::charLetter_L, XalanUnicode::charLetter_T, XalanUnicode::charLetter_I, XalanUnicode::charLetter_P, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_T, XalanUnicode::charLetter_R, XalanUnicode::charLetter_I, XalanUnicode::charLetter_K, XalanUnicode::charLetter_E, 0 },
		ElemDesc::FONTSTYLE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_S, XalanUnicode::charLetter_T, XalanUnicode::charLetter_R, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, XalanUnicode::charLetter_G, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_A, XalanUnicode::charLetter_C, XalanUnicode::charLetter_R, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, XalanUnicode::charLetter_Y, XalanUnicode::charLetter_M, 0 },
		ElemDesc::PHRASE,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_A, XalanUnicode::charLetter_D, XalanUnicode::charLetter_D, XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, XalanUnicode::charLetter_S, XalanUnicode::charLetter_S, 0 },
		ElemDesc::BLOCK | ElemDesc::BLOCKFORM | ElemDesc::BLOCKFORMFIELDSET,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_A, XalanUnicode::charLetter_P, XalanUnicode::charLetter_T, XalanUnicode::charLetter_I, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_I, XalanUnicode::charLetter_S, XalanUnicode::charLetter_I, XalanUnicode::charLetter_N, XalanUnicode::charLetter_D, XalanUnicode::charLetter_E, XalanUnicode::charLetter_X, 0 },
		ElemDesc::EMPTY | ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_B, XalanUnicode::charLetter_A, XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, XalanUnicode::charLetter_F, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, XalanUnicode::charLetter_T, 0 },
		ElemDesc::EMPTY,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_O, XalanUnicode::charLetter_L, XalanUnicode::charLetter_G, XalanUnicode::charLetter_R, XalanUnicode::charLetter_O, XalanUnicode::charLetter_U, XalanUnicode::charLetter_P, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_F, XalanUnicode::charLetter_I, XalanUnicode::charLetter_E, XalanUnicode::charLetter_L, XalanUnicode::charLetter_D, XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, XalanUnicode::charLetter_T, 0 },
		ElemDesc::BLOCK | ElemDesc::BLOCKFORM,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_F, XalanUnicode::charLetter_R, XalanUnicode::charLetter_A, XalanUnicode::charLetter_M, XalanUnicode::charLetter_E, XalanUnicode::charLetter_S, XalanUnicode::charLetter_E, XalanUnicode::charLetter_T, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_N, XalanUnicode::charLetter_O, XalanUnicode::charLetter_F, XalanUnicode::charLetter_R, XalanUnicode::charLetter_A, XalanUnicode::charLetter_M, XalanUnicode::charLetter_E, XalanUnicode::charLetter_S, 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_N, XalanUnicode::charLetter_O, XalanUnicode::charLetter_S, XalanUnicode::charLetter_C, XalanUnicode::charLetter_R, XalanUnicode::charLetter_I, XalanUnicode::charLetter_P, XalanUnicode::charLetter_T, 0 },
		ElemDesc::BLOCK | ElemDesc::BLOCKFORM | ElemDesc::BLOCKFORMFIELDSET,
		{
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_O, XalanUnicode::charLetter_P, XalanUnicode::charLetter_T, XalanUnicode::charLetter_G, XalanUnicode::charLetter_R, XalanUnicode::charLetter_O, XalanUnicode::charLetter_U, XalanUnicode::charLetter_P, 0 },
		0,
		{
			{
				{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_I, XalanUnicode::charLetter_S, XalanUnicode::charLetter_A, XalanUnicode::charLetter_B, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_D, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_T, XalanUnicode::charLetter_E, XalanUnicode::charLetter_X, XalanUnicode::charLetter_T, XalanUnicode::charLetter_A, XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, XalanUnicode::charLetter_A, 0 },
		ElemDesc::INLINELABEL | ElemDesc::FORMCTRL,
		{
			{
				{ XalanUnicode::charLetter_D, XalanUnicode::charLetter_I, XalanUnicode::charLetter_S, XalanUnicode::charLetter_A, XalanUnicode::charLetter_B, XalanUnicode::charLetter_L, XalanUnicode::charLetter_E, XalanUnicode::charLetter_D, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ XalanUnicode::charLetter_R, XalanUnicode::charLetter_E, XalanUnicode::charLetter_A, XalanUnicode::charLetter_D, XalanUnicode::charLetter_O, XalanUnicode::charLetter_N, XalanUnicode::charLetter_L, XalanUnicode::charLetter_Y, 0 },
				ElemDesc::ATTREMPTY,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	{
		{ XalanUnicode::charLetter_B, XalanUnicode::charLetter_L, XalanUnicode::charLetter_O, XalanUnicode::charLetter_C, XalanUnicode::charLetter_K, XalanUnicode::charLetter_Q, XalanUnicode::charLetter_U, XalanUnicode::charLetter_O, XalanUnicode::charLetter_T, XalanUnicode::charLetter_E, 0 },
		ElemDesc::BLOCK | ElemDesc::BLOCKFORM | ElemDesc::BLOCKFORMFIELDSET,
		{
			{
			
				{ XalanUnicode::charLetter_C, XalanUnicode::charLetter_I, XalanUnicode::charLetter_T, XalanUnicode::charLetter_E, 0 },
				ElemDesc::ATTRURL,
			},
			{
				{ 0 },
				0,
			},
		},
	},
	// This is a dummy entry and it must be the last one!!!
	{
		{ 0 },
		ElemDesc::BLOCK,
		{
			{
				{ 0 },
				0,
			},
		},
	},
};



const XalanHTMLElementsProperties::InternalElementProperties* const		XalanHTMLElementsProperties::s_lastProperties =
			s_elementProperties + (sizeof(s_elementProperties) / sizeof(s_elementProperties[0]) - 2);

const XalanHTMLElementsProperties::InternalElementProperties* const		XalanHTMLElementsProperties::s_dummyProperties =
			s_lastProperties + 1;



XALAN_CPP_NAMESPACE_END
