You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2002/08/23 23:20:28 UTC
cvs commit: xml-xalan/c/src/XMLSupport XalanHTMLElementsProperties.cpp XalanHTMLElementsProperties.hpp
dbertoni 2002/08/23 14:20:28
Added: c/src/XMLSupport XalanHTMLElementsProperties.cpp
XalanHTMLElementsProperties.hpp
Log:
Initial revision.
Revision Changes Path
1.1 xml-xalan/c/src/XMLSupport/XalanHTMLElementsProperties.cpp
Index: XalanHTMLElementsProperties.cpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999-2002 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 <PlatformSupport/DOMStringHelper.hpp>
#include <PlatformSupport/XalanUnicode.hpp>
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;
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 },
{
{
{ 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 },
{
{
{ 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;
1.1 xml-xalan/c/src/XMLSupport/XalanHTMLElementsProperties.hpp
Index: XalanHTMLElementsProperties.hpp
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 1999-2002 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/>.
*/
#if !defined(XALANHTMLELEMENTSPROPERTIES_HEADER_GUARD_1357924680)
#define XALANHTMLELEMENTSPROPERTIES_HEADER_GUARD_1357924680
// Base include file. Must be first.
#include <XMLSupport/XMLSupportDefinitions.hpp>
#include <XalanDOM/XalanDOMString.hpp>
class XALAN_XMLSUPPORT_EXPORT XalanHTMLElementsProperties
{
public:
enum { eMaxAttributes = 6, eMaxAttributeName = 8, eMaxElementName = 10 };
enum eFlags
{
EMPTY = (1 << 1),
FLOW = (1 << 2),
BLOCK = (1 << 3),
BLOCKFORM = (1 << 4),
BLOCKFORMFIELDSET = (1 << 5),
CDATA = (1 << 6),
PCDATA = (1 << 7),
RAW = (1 << 8),
INLINE = (1 << 9),
INLINEA = (1 << 10),
INLINELABEL = (1 << 11),
FONTSTYLE = (1 << 12),
PHRASE = (1 << 13),
FORMCTRL = (1 << 14),
SPECIAL = (1 << 15),
ASPECIAL = (1 << 16),
HEADMISC = (1 << 17),
HEAD = (1 << 18),
LIST = (1 << 19),
PREFORMATTED = (1 << 20),
WHITESPACESENSITIVE = (1 << 21),
HEADELEM = (1 << 22),
ATTRURL = (1 << 1),
ATTREMPTY = (1 << 2)
};
struct InternalAttributeProperties
{
typedef unsigned char FlagsType;
XalanDOMChar m_name[eMaxAttributeName + 1];
FlagsType m_flags;
/**
* Check if particular properties are set for this
* instance. See the eFlag enum for the valid
* properties.
*
* @param theFlags The properties to check.
* @return true if the property is set, false if not
*/
bool
is(FlagsType theFlags) const
{
return m_flags & theFlags ? true : false;
}
};
struct InternalElementProperties
{
typedef InternalAttributeProperties::FlagsType AttributeFlagsType;
typedef unsigned int FlagsType;
/**
* Check if particular attribute properties are set
* for this instance. See the eFlag enum for the valid
* properties.
*
* @param theAttributeName The attribute name.
* @param theFlags The properties to check.
* @return true if the property is set, false if not
*/
bool
isAttribute(
const XalanDOMChar* theAttributeName,
AttributeFlagsType theFlags) const;
/**
* Check if particular properties are set for this
* instance. See the eFlag enum for the valid
* properties.
*
* @param theFlags The properties to check.
* @return true if the property is set, false if not
*/
bool
is(FlagsType theFlags) const
{
return m_flags & theFlags ? true : false;
}
// Data members...
XalanDOMChar m_name[eMaxElementName + 1];
FlagsType m_flags;
InternalAttributeProperties m_attributes[eMaxAttributes + 1];
/**
* Find an instance with the given attribute name.
*
* @param theAttributeName The attribute name.
* @return A reference to an instance.
*/
const InternalAttributeProperties&
findProperties(const XalanDOMChar* theAttributeName) const;
static const InternalAttributeProperties s_dummyProperties;
};
/**
* This class acts as a proxy for and InternalElementProperties
* instance.
*/
class XALAN_XMLSUPPORT_EXPORT ElementProperties
{
public:
typedef InternalElementProperties::AttributeFlagsType AttributeFlagsType;
typedef InternalElementProperties::FlagsType FlagsType;
/**
* Constructor
* @param theProperties The instance for which this one is a proxy.
*/
ElementProperties(const InternalElementProperties* theProperties = 0) :
m_properties(theProperties)
{
}
/**
* Copy constructor
* @param theSource The source instance for the copy.
*/
ElementProperties(const ElementProperties& theSource) :
m_properties(theSource.m_properties)
{
}
/**
* Determine if this is a non-null instance. You
* must call this before calling any member functions,
* if you think the instance may be null.
*
* @return true if the instance is null, false if not
*/
bool
null() const
{
return m_properties == 0 ? true : false;
}
/**
* Check if particular properties are set for this
* instance. See the eFlag enum for the valid
* properties.
*
* @param theFlags The properties to check.
* @return true if the property is set, false if not
*/
bool
is(FlagsType theFlags) const
{
return m_properties->is(theFlags);
}
/**
* Check if particular attribute properties are set
* for this instance. See the eFlag enum for the valid
* properties.
*
* @param theAttributeName The attribute name.
* @param theFlags The properties to check.
* @return true if the property is set, false if not
*/
bool
isAttribute(
const XalanDOMChar* theAttributeName,
AttributeFlagsType theFlags) const
{
return m_properties->isAttribute(theAttributeName, theFlags);
}
private:
const InternalElementProperties* m_properties;
};
/**
* Find an instance with the given name.
*
* @param theElementName The element name.
* @return A reference to an instance.
*/
static ElementProperties
find(const XalanDOMChar* theElementName);
private:
/**
* Find an instance with the given name.
*
* @param theElementName The element name.
* @return A reference to an instance.
*/
static const InternalElementProperties&
findProperties(const XalanDOMChar* theElementName);
// The order of these is significant!!!
// The array of properties...
static const InternalElementProperties s_elementProperties[];
// This point to the last of the real propeties in the array.
static const InternalElementProperties* const s_lastProperties;
// This point to the last of the properties in the array, which is
// a dummy instance we return when an instance that matches the
// element name cannot be found.
static const InternalElementProperties* const s_dummyProperties;
// These are undefined...
XalanHTMLElementsProperties();
~XalanHTMLElementsProperties();
XalanHTMLElementsProperties&
operator=(const XalanHTMLElementsProperties&);
};
#endif // XALANHTMLELEMENTSPROPERTIES_HEADER_GUARD_1357924680
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org