You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2001/02/27 19:48:24 UTC

cvs commit: xml-xerces/c/src/validators/schema Makefile.in SchemaAttDef.cpp SchemaAttDef.hpp SchemaAttDefList.cpp SchemaAttDefList.hpp SchemaElementDecl.cpp SchemaElementDecl.hpp

tng         01/02/27 10:48:23

  Modified:    c/Projects/OS2/VACPP40 xerces_validators.icc
               c/Projects/Win32/VC6/xerces-all/XercesLib XercesLib.dsp
               c/scripts packageBinaries.pl
               c/src    Makefile.in configure configure.in
               c/src/framework XMLAttDef.cpp XMLAttDef.hpp
  Added:       c/src/validators Makefile.in
               c/src/validators/schema Makefile.in SchemaAttDef.cpp
                        SchemaAttDef.hpp SchemaAttDefList.cpp
                        SchemaAttDefList.hpp SchemaElementDecl.cpp
                        SchemaElementDecl.hpp
  Log:
  Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
  
  Revision  Changes    Path
  1.4       +8 -5      xml-xerces/c/Projects/OS2/VACPP40/xerces_validators.icc
  
  Index: xerces_validators.icc
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/Projects/OS2/VACPP40/xerces_validators.icc,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- xerces_validators.icc	2001/02/27 14:48:19	1.3
  +++ xerces_validators.icc	2001/02/27 18:48:14	1.4
  @@ -1,9 +1,4 @@
   group xerces_validators =
  -    BASE_DIR "\\src\\validators\\DTD\\DTDAttDef.cpp",
  -    BASE_DIR "\\src\\validators\\DTD\\DTDAttDefList.cpp",
  -    BASE_DIR "\\src\\validators\\DTD\\DTDElementDecl.cpp",
  -    BASE_DIR "\\src\\validators\\DTD\\DTDValidator.cpp",
  -    BASE_DIR "\\src\\validators\\DTD\\DTDValidator2.cpp",
       BASE_DIR "\\src\\validators\\common\\CMAnyOp.cpp",
       BASE_DIR "\\src\\validators\\common\\CMBinaryOp.cpp",
       BASE_DIR "\\src\\validators\\common\\CMUnaryOp.cpp",
  @@ -12,3 +7,11 @@
       BASE_DIR "\\src\\validators\\common\\DFAContentModel.cpp",
       BASE_DIR "\\src\\validators\\common\\MixedContentModel.cpp",
       BASE_DIR "\\src\\validators\\common\\SimpleContentModel.cpp"
  +    BASE_DIR "\\src\\validators\\DTD\\DTDAttDef.cpp",
  +    BASE_DIR "\\src\\validators\\DTD\\DTDAttDefList.cpp",
  +    BASE_DIR "\\src\\validators\\DTD\\DTDElementDecl.cpp",
  +    BASE_DIR "\\src\\validators\\DTD\\DTDValidator.cpp",
  +    BASE_DIR "\\src\\validators\\DTD\\DTDValidator2.cpp",
  +    BASE_DIR "\\src\\validators\\schema\\SchemaAttDef.cpp"
  +    BASE_DIR "\\src\\validators\\schema\\SchemaAttDefList.cpp"
  +    BASE_DIR "\\src\\validators\\schema\\SchemaElementDecl.cpp"
  
  
  
  1.51      +31 -3     xml-xerces/c/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp
  
  Index: XercesLib.dsp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/Projects/Win32/VC6/xerces-all/XercesLib/XercesLib.dsp,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- XercesLib.dsp	2001/02/27 18:23:55	1.50
  +++ XercesLib.dsp	2001/02/27 18:48:15	1.51
  @@ -1398,6 +1398,18 @@
   SOURCE=..\..\..\..\..\src\validators\common\SimpleContentModel.hpp
   # End Source File
   # End Group
  +# Begin Group "datatype"
  +
  +# PROP Default_Filter "*.cpp, *.hpp"
  +# Begin Source File
  +
  +SOURCE=..\..\..\..\..\src\validators\datatype\InvalidDatatypeFacetException.hpp
  +# End Source File
  +# Begin Source File
  +
  +SOURCE=..\..\..\..\..\src\validators\datatype\InvalidDatatypeValueException.hpp
  +# End Source File
  +# End Group
   # Begin Group "DTD"
   
   # PROP Default_Filter "*.cpp, *.hpp"
  @@ -1446,16 +1458,32 @@
   SOURCE=..\..\..\..\..\src\validators\DTD\DTDValidator2.cpp
   # End Source File
   # End Group
  -# Begin Group "datatype"
  +# Begin Group "schema"
   
   # PROP Default_Filter "*.cpp, *.hpp"
   # Begin Source File
   
  -SOURCE=..\..\..\..\..\src\validators\datatype\InvalidDatatypeFacetException.hpp
  +SOURCE=..\..\..\..\..\src\validators\schema\SchemaAttDef.hpp
   # End Source File
   # Begin Source File
   
  -SOURCE=..\..\..\..\..\src\validators\datatype\InvalidDatatypeValueException.hpp
  +SOURCE=..\..\..\..\..\src\validators\schema\SchemaAttDef.cpp
  +# End Source File
  +# Begin Source File
  +
  +SOURCE=..\..\..\..\..\src\validators\schema\SchemaAttDefList.hpp
  +# End Source File
  +# Begin Source File
  +
  +SOURCE=..\..\..\..\..\src\validators\schema\SchemaAttDefList.cpp
  +# End Source File
  +# Begin Source File
  +
  +SOURCE=..\..\..\..\..\src\validators\schema\SchemaElementDecl.hpp
  +# End Source File
  +# Begin Source File
  +
  +SOURCE=..\..\..\..\..\src\validators\schema\SchemaElementDecl.cpp
   # End Source File
   # End Group
   # End Group
  
  
  
  1.46      +4 -1      xml-xerces/c/scripts/packageBinaries.pl
  
  Index: packageBinaries.pl
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/scripts/packageBinaries.pl,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- packageBinaries.pl	2001/02/16 14:58:54	1.45
  +++ packageBinaries.pl	2001/02/27 18:48:16	1.46
  @@ -212,7 +212,8 @@
           validators
           validators/common
           validators/datatype
  -        validators/DTD';
  +        validators/DTD
  +        validators/schema';
   
       foreach $dir (@headerDirectories) {
           $inclDir = "include/$dir";
  @@ -483,6 +484,7 @@
       psystem ("mkdir $targetdir/include/validators/common");
       psystem ("mkdir $targetdir/include/validators/datatype");
       psystem ("mkdir $targetdir/include/validators/DTD");
  +    psystem ("mkdir $targetdir/include/validators/schema");
       psystem ("mkdir $targetdir/samples");
       psystem ("mkdir $targetdir/samples/data");
       psystem ("mkdir $targetdir/samples/SAXCount");
  @@ -623,6 +625,7 @@
       psystem("cp -Rf $XERCESCROOT/src/validators/common/*.hpp $targetdir/include/validators/common");
       psystem("cp -Rf $XERCESCROOT/src/validators/datatype/*.hpp $targetdir/include/validators/datatype");
       psystem("cp -Rf $XERCESCROOT/src/validators/DTD/*.hpp $targetdir/include/validators/DTD");
  +    psystem("cp -Rf $XERCESCROOT/src/validators/schema/*.hpp $targetdir/include/validators/schema");
   
       if (length($ICUROOT) > 0) {
           print "\nICU files are being copied from \'$ICUROOT\'";
  
  
  
  1.26      +9 -27     xml-xerces/c/src/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/Makefile.in,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Makefile.in	2001/02/16 14:58:54	1.25
  +++ Makefile.in	2001/02/27 18:48:17	1.26
  @@ -54,7 +54,7 @@
   # <http://www.apache.org/>.
   #
   #
  -# $Id: Makefile.in,v 1.25 2001/02/16 14:58:54 tng Exp $
  +# $Id: Makefile.in,v 1.26 2001/02/27 18:48:17 tng Exp $
   #
   
   ###################################################################
  @@ -84,9 +84,7 @@
   FRAMEWORK_DIR = framework
   DOM_DIR = dom
   PARSERS_DIR = parsers
  -VALIDATORS_DTD_DIR = validators/DTD
  -VALIDATORS_DATATYPE_DIR = validators/datatype
  -VALIDATORS_COMMON_DIR = validators/common
  +VALIDATORS_DIR = validators
   
   LIBNAME = libxerces-c
   THISLIB = ${XML_LIB_DIR}/${LIBNAME}
  @@ -103,9 +101,9 @@
   PRODUCTVERSION=${VER}
   BINTARGETDIR=${HOME}/${PRODUCTNAME}-c-${PLATFORM}-${CXX}-${PRODUCTVERSION}
   
  -all:: Prepare Util Sax Internal Framework Parsers Sax2 Dom Validators Datatype Common ${THISLIB}${VER}${SHLIBSUFFIX}
  +all:: Prepare Util Sax Internal Framework Parsers Sax2 Dom Validators ${THISLIB}${VER}${SHLIBSUFFIX}
   
  -compile:: Prepare Util Sax Internal Framework Parsers Sax2 Dom Validators Datatype Common
  +compile:: Prepare Util Sax Internal Framework Parsers Sax2 Dom Validators
   
   lib:: compile ${THISLIB}${VER}${SHLIBSUFFIX}
   
  @@ -119,9 +117,7 @@
   	${CD} $(INTERNAL_DIR) ; $(MAKE) includes ; ${CD} ..
   	${CD} $(FRAMEWORK_DIR) ; $(MAKE) includes ; ${CD} ..
   	${CD} $(PARSERS_DIR) ; $(MAKE) includes ; ${CD} ..
  -	${CD} $(VALIDATORS_DTD_DIR) ; $(MAKE) includes ; ${CD} ../..
  -	${CD} $(VALIDATORS_DATATYPE_DIR) ; $(MAKE) includes ; ${CD} ../..
  -	${CD} $(VALIDATORS_COMMON_DIR) ; $(MAKE) includes ; ${CD} ../..
  +	${CD} $(VALIDATORS_DIR) ; $(MAKE) includes ; ${CD} ..
   	${CD} $(DOM_DIR) ; $(MAKE) includes ; ${CD} ..
   
   Util::
  @@ -155,16 +151,8 @@
   
   Validators::
   	@echo Building "validators"
  -	${CD} $(VALIDATORS_DTD_DIR) ; $(MAKE) $(MAKE_FLAGS) ; ${CD} ../..
  +	${CD} $(VALIDATORS_DIR) ; $(MAKE) $(MAKE_FLAGS) ; ${CD} ..
   
  -Datatype::
  -	@echo Building "datatype"
  -	${CD} $(VALIDATORS_DATATYPE_DIR) ; $(MAKE) $(MAKE_FLAGS) ; ${CD} ../..
  -
  -Common::
  -	@echo Building "common"
  -	${CD} $(VALIDATORS_COMMON_DIR) ; $(MAKE) $(MAKE_FLAGS) ; ${CD} ../..
  -
   ${THISLIB}${VER}${SHLIBSUFFIX}::
   	@echo Building ${THISLIB}${VER}${SHLIBSUFFIX}
   	${CD} $(XML_OBJ_DIR)/.. ; $(MAKE) -k $(MAKE_FLAGS) ; ${CD} ..
  @@ -177,9 +165,7 @@
   	${CD} $(FRAMEWORK_DIR) && $(MAKE) $@ && ${CD} ..
   	${CD} $(PARSERS_DIR) && $(MAKE) $@ && ${CD} ..
   	${CD} $(DOM_DIR) && $(MAKE) $@ && ${CD} ..
  -	${CD} $(VALIDATORS_DTD_DIR) && $(MAKE) $@ && ${CD} ../..
  -	${CD} $(VALIDATORS_DATATYPE_DIR) && $(MAKE) $@ && ${CD} ../..
  -	${CD} $(VALIDATORS_COMMON_DIR) && $(MAKE) $@ && ${CD} ../..
  +	${CD} $(VALIDATORS_DIR) && $(MAKE) $@ && ${CD} ..
   	${CD} $(XML_OBJ) && $(MAKE) $@ && ${CD} ..
   
   clean::
  @@ -190,9 +176,7 @@
   	${CD} $(FRAMEWORK_DIR) && $(MAKE) $@ && ${CD} ..
   	${CD} $(PARSERS_DIR) && $(MAKE) $@ && ${CD} ..
   	${CD} $(DOM_DIR) && $(MAKE) $@ && ${CD} ..
  -	${CD} $(VALIDATORS_DTD_DIR) && $(MAKE) $@ && ${CD} ../..
  -	${CD} $(VALIDATORS_DATATYPE_DIR) && $(MAKE) $@ && ${CD} ../..
  -	${CD} $(VALIDATORS_COMMON_DIR) && $(MAKE) $@ && ${CD} ../..
  +	${CD} $(VALIDATORS_DIR) && $(MAKE) $@ && ${CD} ..
   	${CD} $(XML_OBJ) && $(MAKE) $@ && ${CD} ..
   
   distclean::
  @@ -203,9 +187,7 @@
   	${CD} $(FRAMEWORK_DIR) && $(MAKE) $@ && ${CD} ..
   	${CD} $(PARSERS_DIR) && $(MAKE) $@ && ${CD} ..
   	${CD} $(DOM_DIR) && $(MAKE) $@ && ${CD} ..
  -	${CD} $(VALIDATORS_DTD_DIR) && $(MAKE) $@ && ${CD} ../..
  -	${CD} $(VALIDATORS_DATATYPE_DIR) && $(MAKE) $@ && ${CD} ../..
  -	${CD} $(VALIDATORS_COMMON_DIR) && $(MAKE) $@ && ${CD} ../..
  +	${CD} $(VALIDATORS_DIR) && $(MAKE) $@ && ${CD} ..
   	${CD} $(XML_OBJ) && $(MAKE) $@ && ${CD} ..
   	rm -f Makefile config.cache config.log config.status
   	find . -name Makefile -print -exec rm -f {} \;
  
  
  
  1.24      +4 -0      xml-xerces/c/src/configure
  
  Index: configure
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/configure,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- configure	2001/02/16 14:58:54	1.23
  +++ configure	2001/02/27 18:48:18	1.24
  @@ -1491,9 +1491,11 @@
   util/MsgLoaders/MsgCatalog/Makefile \
   util/MsgLoaders/MsgFile/Makefile \
   util/NetAccessors/Socket/Makefile \
  +validators/Makefile \
   validators/common/Makefile \
   validators/datatype/Makefile \
   validators/DTD/Makefile \
  +validators/schema/Makefile \
   framework/Makefile \
   dom/Makefile \
   parsers/Makefile \
  @@ -1621,9 +1623,11 @@
   util/MsgLoaders/MsgCatalog/Makefile \
   util/MsgLoaders/MsgFile/Makefile \
   util/NetAccessors/Socket/Makefile \
  +validators/Makefile \
   validators/common/Makefile \
   validators/datatype/Makefile \
   validators/DTD/Makefile \
  +validators/schema/Makefile \
   framework/Makefile \
   dom/Makefile \
   parsers/Makefile \
  
  
  
  1.20      +2 -0      xml-xerces/c/src/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/configure.in,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- configure.in	2001/02/16 14:58:55	1.19
  +++ configure.in	2001/02/27 18:48:18	1.20
  @@ -111,9 +111,11 @@
   util/MsgLoaders/MsgCatalog/Makefile \
   util/MsgLoaders/MsgFile/Makefile \
   util/NetAccessors/Socket/Makefile \
  +validators/Makefile \
   validators/common/Makefile \
   validators/datatype/Makefile \
   validators/DTD/Makefile \
  +validators/schema/Makefile \
   framework/Makefile \
   dom/Makefile \
   parsers/Makefile \
  
  
  
  1.6       +24 -13    xml-xerces/c/src/framework/XMLAttDef.cpp
  
  Index: XMLAttDef.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/framework/XMLAttDef.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XMLAttDef.cpp	2000/11/30 18:22:38	1.5
  +++ XMLAttDef.cpp	2001/02/27 18:48:20	1.6
  @@ -1,37 +1,37 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  + *
    * Copyright (c) 1999-2000 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. 
  - * 
  + *    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:  
  + *    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 "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    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
  @@ -45,7 +45,7 @@
    * 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
  @@ -55,7 +55,7 @@
    */
   
   /**
  - * $Id: XMLAttDef.cpp,v 1.5 2000/11/30 18:22:38 andyh Exp $
  + * $Id: XMLAttDef.cpp,v 1.6 2001/02/27 18:48:20 tng Exp $
    */
   
   
  @@ -91,6 +91,12 @@
       , XMLUni::fgNmTokensString
       , XMLUni::fgNotationString
       , XMLUni::fgEnumerationString
  +    , XMLUni::fgCDATAString
  +    , XMLUni::fgCDATAString
  +    , XMLUni::fgCDATAString
  +    , XMLUni::fgCDATAString
  +    , XMLUni::fgCDATAString
  +
   };
   
   const XMLCh* const gDefAttTypeStrings[XMLAttDef::DefAttTypes_Count] =
  @@ -99,6 +105,11 @@
       , XMLUni::fgRequiredString
       , XMLUni::fgImpliedString
       , XMLUni::fgFixedString
  +    , XMLUni::fgImpliedString
  +    , XMLUni::fgImpliedString
  +    , XMLUni::fgImpliedString
  +    , XMLUni::fgImpliedString
  +    , XMLUni::fgImpliedString
   };
   
   
  
  
  
  1.9       +36 -23    xml-xerces/c/src/framework/XMLAttDef.hpp
  
  Index: XMLAttDef.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/framework/XMLAttDef.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XMLAttDef.hpp	2000/12/14 18:49:56	1.8
  +++ XMLAttDef.hpp	2001/02/27 18:48:20	1.9
  @@ -1,37 +1,37 @@
   /*
    * The Apache Software License, Version 1.1
  - * 
  + *
    * Copyright (c) 1999-2000 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. 
  - * 
  + *    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:  
  + *    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 "Xerces" and "Apache Software Foundation" must
    *    not be used to endorse or promote products derived from this
  - *    software without prior written permission. For written 
  + *    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
  @@ -45,7 +45,7 @@
    * 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
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: XMLAttDef.hpp,v $
  + * Revision 1.9  2001/02/27 18:48:20  tng
  + * Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
  + *
    * Revision 1.8  2000/12/14 18:49:56  tng
    * Fix API document generation warning: "Warning: end of member group without matching begin"
    *
  @@ -119,7 +122,7 @@
       //
       //  AttTypes
       //      The list of possible types that an attribute can have, according
  -    //      to the XML 1.0 spec.
  +    //      to the XML 1.0 spec and schema.
       //
       //  DefAttTypes
       //      The modifiers that an attribute decl can have, which indicates
  @@ -142,23 +145,33 @@
           , NmTokens          = 7
           , Notation          = 8
           , Enumeration       = 9
  +        , Simple            = 10
  +        , Any_Any           = 11
  +        , Any_Other         = 12
  +        , Any_Local         = 13
  +        , Any_List          = 14
   
           , AttTypes_Count
           , AttTypes_Min      = 0
  -        , AttTypes_Max      = 9
  +        , AttTypes_Max      = 14
           , AttTypes_Unknown  = -1
   	};
   
       enum DefAttTypes
       {
  -        Default             = 0
  -        , Required          = 1
  -        , Implied           = 2
  -        , Fixed             = 3
  +        Default                  = 0
  +        , Required               = 1
  +        , Implied                = 2
  +        , Fixed                  = 3
  +        , Prohibited             = 4
  +        , Required_And_Fixed     = 5
  +        , ProcessContents_Strict = 6
  +        , ProcessContents_Lax    = 7
  +        , ProcessContents_Skip   = 8
   
           , DefAttTypes_Count
           , DefAttTypes_Min   = 0
  -        , DefAttTypes_Max   = 3
  +        , DefAttTypes_Max   = 8
           , DefAttTypes_Unknown = -1
   	};
   
  @@ -188,7 +201,7 @@
         *
         * @param attrType The attribute type value to get the string for.
         *
  -      * @return A const pointer to the static string that holds the text 
  +      * @return A const pointer to the static string that holds the text
         *         description of the passed type.
         */
       static const XMLCh* getAttTypeString(const AttTypes attrType);
  @@ -200,7 +213,7 @@
         *
         * @param attrType The default attribute type value to get the string for.
         *
  -      * @return A const pointer to the static string that holds the text 
  +      * @return A const pointer to the static string that holds the text
         *         description of the passed default type.
         */
       static const XMLCh* getDefAttTypeString(const DefAttTypes attrType);
  @@ -342,7 +355,7 @@
         * This method sets the default attribute type for this attribute.
         * This setting controls whether the attribute is required, fixed,
         * implied, etc...
  -      * 
  +      *
         * @param  The new default attribute to set
         */
       void setDefaultType(const XMLAttDef::DefAttTypes newValue);
  @@ -459,7 +472,7 @@
       //  fProvided
       //      This field is really for use by the scanner. It is used to track
       //      which of the attributes of an element were provided. Any marked
  -    //      as not provided (after scanning the start tag) and having a 
  +    //      as not provided (after scanning the start tag) and having a
       //      default type of Required, is in error.
       //
       //  fType
  
  
  
  1.1                  xml-xerces/c/src/validators/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  #
  # The Apache Software License, Version 1.1
  #
  # Copyright (c) 1999-2000 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 "Xerces" 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/>.
  #
  #
  # $Log: Makefile.in,v $
  # Revision 1.1  2001/02/27 18:48:22  tng
  # Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
  #
  #
  #
  
  PLATFORM = @platform@
  CC  = @cc@
  CXX = @cxx@
  CXXFLAGS = @cxxflags@
  CFLAGS = @cflags@
  PREFIX = @prefix@
  LDFLAGS = @ldflags@
  LIBS = @libs@
  OSVER = @osver@
  USELIBWWW = @uselibwww@
  MESSAGELOADER = @messageloader@
  TRANSCODER = @transcoder@
  NETACCESSOR = @netaccessor@
  
  MODULE = validators
  
  include ../Makefile.incl
  
  VALIDATORS_CPP_PUBHEADERS =
  
  VALIDATORS_CPP_PRIVHEADERS =
  
  VALIDATORS_C_FILES =
  
  VALIDATORS_CPP_OBJECTS =
  
  all:: includes $(VALIDATORS_CPP_OBJECTS) common datatype DTD schema
  
  includes:: pubheaders $(VALIDATORS_C_FILES)
  	cd common ; $(MAKE) $@ ; cd ..
  	cd datatype ; $(MAKE) $@ ; cd ..
  	cd DTD ; $(MAKE) $@ ; cd ..
  	cd schema ; $(MAKE) $@ ; cd ..
  
  
  common::
  	cd common ; $(MAKE) ; cd ..
  
  
  datatype::
  	cd datatype ; $(MAKE) ; cd ..
  
  
  DTD::
  	cd DTD ; $(MAKE) ; cd ..
  
  
  schema::
  	cd schema ; $(MAKE) ; cd ..
  
  
  pubheaders::
  	-mkdir -p $(XML_INC_DIR)/$(MODULE)
  
  
  # this may generate unnecessary dependencies, but it makes life easier
  depend:: includes
  	$(MAKE_DEPEND) $(XML_INCL)  *.cpp > $(DEPFILE)
  
  
  clean::
  	@echo "Making clean in $(MODULE) ..."
  	$(RM2) $(addprefix $(XML_OBJ_DIR)/,$(VALIDATORS_CPP_OBJECTS))
  	cd common ; $(MAKE) $@ ; cd ..
  	cd datatype ; $(MAKE) $@ ; cd ..
  	cd DTD ; $(MAKE) $@ ; cd ..
  	cd schema ; $(MAKE) $@ ; cd ..
  
  
  
  distclean:: clean
  	$(RM) Makefile $(DEPFILE)
  	@echo "Removing all $(MODULE) header files ..."
  	$(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/,$(VALIDATORS_CPP_PUBHEADERS))
  	$(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/,$(VALIDATORS_C_FILES))
  	cd common ; $(MAKE) $@ ; cd ..
  	cd datatype ; $(MAKE) $@ ; cd ..
  	cd DTD ; $(MAKE) $@ ; cd ..
  	cd schema ; $(MAKE) $@ ; cd ..
  
  
  install::
  	-mkdir -p $(PREFIX)/$(MODULE)
  	cd common ; $(MAKE) $@ ; cd ..
  	cd datatype ; $(MAKE) $@ ; cd ..
  	cd DTD ; $(MAKE) $@ ; cd ..
  	cd schema ; $(MAKE) $@ ; cd ..
  
  
  
  
  1.1                  xml-xerces/c/src/validators/schema/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  #
  # The Apache Software License, Version 1.1
  #
  # Copyright (c) 1999 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 "Xerces" 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/>.
  #
  #
  # $Log: Makefile.in,v $
  # Revision 1.1  2001/02/27 18:48:22  tng
  # Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
  #
  #
  
  PLATFORM = @platform@
  CC  = @cc@
  CXX = @cxx@
  CXXFLAGS = @cxxflags@
  CFLAGS = @cflags@
  PREFIX = @prefix@
  LDFLAGS = @ldflags@
  LIBS = @libs@
  OSVER = @osver@
  USELIBWWW = @uselibwww@
  MESSAGELOADER = @messageloader@
  TRANSCODER = @transcoder@
  
  include ../../Makefile.incl
  
  MODULE = validators
  SUBMODULE = schema
  
  VALIDATORS_SCHEMA_CPP_PUBHEADERS = \
  	SchemaAttDef.hpp \
  	SchemaAttDefList.hpp \
  	SchemaElementDecl.hpp
  
  VALIDATORS_SCHEMA_CPP_PRIVHEADERS =
  
  VALIDATORS_SCHEMA_C_FILES =
  
  VALIDATORS_SCHEMA_CPP_OBJECTS = \
  	SchemaAttDef.$(TO) \
  	SchemaAttDefList.$(TO) \
  	SchemaElementDecl.$(TO)
  
  all::	includes $(VALIDATORS_SCHEMA_CPP_OBJECTS)
  
  includes::	pubheaders $(VALIDATORS_SCHEMA_C_FILES)
  
  pubheaders::
  	-mkdir -p $(XML_INC_DIR)/$(MODULE)/$(SUBMODULE)
  	$(CP) $(VALIDATORS_SCHEMA_CPP_PUBHEADERS) $(VALIDATORS_SCHEMA_C_FILES) $(XML_INC_DIR)/$(MODULE)/$(SUBMODULE)
  
  # this may generate unnecessary dependencies, but it makes life easier
  depend:: includes
  	$(MAKE_DEPEND) $(XML_INCL)  *.cpp > $(DEPFILE)
  
  clean::
  	@echo "Making clean in $(MODULE)/$(SUBMODULE) ..."
  	$(RM2) $(addprefix $(XML_OBJ_DIR)/,$(VALIDATORS_SCHEMA_CPP_OBJECTS))
  
  distclean::	clean
  	$(RM) Makefile $(DEPFILE)
  	@echo "Removing all $(MODULE)/$(SUBMODULE) header files ..."
  	$(RM2) $(addprefix $(XML_INC_DIR)/$(MODULE)/$(SUBMODULE)/,$(VALIDATORS_SCHEMA_CPP_PUBHEADERS))
  
  install::
  	-mkdir -p $(PREFIX)/$(MODULE)/$(SUBMODULE)
  	$(CP) $(VALIDATORS_SCHEMA_CPP_PUBHEADERS) $(VALIDATORS_SCHEMA_C_FILES) $(PREFIX)/$(MODULE)/$(SUBMODULE)
  
  
  
  1.1                  xml-xerces/c/src/validators/schema/SchemaAttDef.cpp
  
  Index: SchemaAttDef.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2000 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 "Xerces" 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/>.
   */
  
  /*
   * $Log: SchemaAttDef.cpp,v $
   * Revision 1.1  2001/02/27 18:48:22  tng
   * Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
   *
   */
  
  
  // ---------------------------------------------------------------------------
  //  Includes
  // ---------------------------------------------------------------------------
  #include <framework/XMLElementDecl.hpp>
  #include <validators/schema/SchemaAttDef.hpp>
  
  // ---------------------------------------------------------------------------
  //  SchemaAttDef: Implementation of the XMLAttDef interface
  // ---------------------------------------------------------------------------
  const XMLCh* SchemaAttDef::getFullName() const
  {
     return fAttName->getRawName();
  }
  
  // ---------------------------------------------------------------------------
  //  SchemaAttDef: Constructors and Destructor
  // ---------------------------------------------------------------------------
  SchemaAttDef::SchemaAttDef() :
      fElemId(XMLElementDecl::fgInvalidElemId)
      , fAttName(0)
      , fDatatypeValidator(0)
  {
  }
  
  SchemaAttDef::SchemaAttDef( const XMLCh* const                     prefix
                            , const XMLCh* const                     localPart
                            , const int                              uriId
                            , const XMLAttDef::AttTypes              type
                            , const XMLAttDef::DefAttTypes           defType) :
      XMLAttDef(type, defType)
      , fElemId(XMLElementDecl::fgInvalidElemId)
      , fDatatypeValidator(0)
  {
      fAttName = new QName(prefix, localPart, uriId);
  }
  
  SchemaAttDef::SchemaAttDef( const XMLCh* const                     prefix
                            , const XMLCh* const                     localPart
                            , const int                              uriId
                            , const XMLCh* const                     attValue
                            , const XMLAttDef::AttTypes              type
                            , const XMLAttDef::DefAttTypes           defType
                            , const XMLCh* const                     enumValues) :
  
      XMLAttDef(attValue, type, defType, enumValues)
      , fElemId(XMLElementDecl::fgInvalidElemId)
  {
      fAttName = new QName(prefix, localPart, uriId);
  }
  
  SchemaAttDef::~SchemaAttDef()
  {
     delete fAttName;
  }
  
  
  // ---------------------------------------------------------------------------
  //  SchemaAttDef: Setter methods
  // ---------------------------------------------------------------------------
  void SchemaAttDef::setAttName(const XMLCh* const        prefix
                              , const XMLCh* const        localPart
                              , const int                 uriId )
  {
     fAttName->setName(prefix, localPart, uriId);
  }
  
  
  
  1.1                  xml-xerces/c/src/validators/schema/SchemaAttDef.hpp
  
  Index: SchemaAttDef.hpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2000 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 "Xerces" 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/>.
   */
  
  /*
   * $Log: SchemaAttDef.hpp,v $
   * Revision 1.1  2001/02/27 18:48:22  tng
   * Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
   *
   */
  #if !defined(SCHEMAATTDEF_HPP)
  #define SCHEMAATTDEF_HPP
  
  #include <util/XMLString.hpp>
  #include <framework/XMLAttDef.hpp>
  
  class DatatypeValidator;
  
  //
  //  This class is a derivative of the core XMLAttDef class. This class adds
  //  any Schema specific data members and provides Schema specific implementations
  //  of any underlying attribute def virtual methods.
  //
  class VALIDATORS_EXPORT SchemaAttDef : public XMLAttDef
  {
  public :
  
      // -----------------------------------------------------------------------
      //  Constructors and Destructors
      // -----------------------------------------------------------------------
      SchemaAttDef();
      SchemaAttDef
      (
            const XMLCh* const                     prefix
          , const XMLCh* const                     localPart
          , const int                              uriId
          , const XMLAttDef::AttTypes              type = CData
          , const XMLAttDef::DefAttTypes           defType = Implied
      );
      SchemaAttDef
      (
            const XMLCh* const                     prefix
          , const XMLCh* const                     localPart
          , const int                              uriId
          , const XMLCh* const                     attValue
          , const XMLAttDef::AttTypes              type
          , const XMLAttDef::DefAttTypes           defType
          , const XMLCh* const                     enumValues = 0
      );
      ~SchemaAttDef();
  
      // -----------------------------------------------------------------------
      //  Implementation of the XMLAttDef interface
      // -----------------------------------------------------------------------
      virtual const XMLCh* getFullName() const;
  
  
      // -----------------------------------------------------------------------
      //  Getter methods
      // -----------------------------------------------------------------------
      unsigned int getElemId() const;
      QName* getAttName() const;
      DatatypeValidator* getDatatypeValidator() const;
  
  
      // -----------------------------------------------------------------------
      //  Setter methods
      // -----------------------------------------------------------------------
      void setElemId(const unsigned int newId);
      void setAttName
      (
          const XMLCh* const        prefix
         ,const XMLCh* const        localPart
         ,const int                 uriId = -1
      );
      void setDatatypeValidator(DatatypeValidator* newDatatypeValidator);
  
  
  private :
      // -----------------------------------------------------------------------
      //  Private data members
      //
      //  fElemId
      //      This is the id of the element (the id is into the element decl
      //      pool) of the element this attribute def said it belonged to.
      //      This is used later to link back to the element, mostly for
      //      validation purposes.
      //
      //  fAttName
      //      This is the name of the attribute.
      //
      //  fDatatypeValidator
      //      The DatatypeValidator used to validate this attribute type.
      //
      // -----------------------------------------------------------------------
      unsigned int       fElemId;
      QName*             fAttName;
      DatatypeValidator* fDatatypeValidator;
  };
  
  
  // ---------------------------------------------------------------------------
  //  SchemaAttDef: Getter methods
  // ---------------------------------------------------------------------------
  inline unsigned int SchemaAttDef::getElemId() const
  {
      return fElemId;
  }
  
  
  inline QName* SchemaAttDef::getAttName() const
  {
      return fAttName;
  }
  
  inline DatatypeValidator* SchemaAttDef::getDatatypeValidator() const
  {
      return fDatatypeValidator;
  }
  
  
  // ---------------------------------------------------------------------------
  //  SchemaAttDef: Setter methods
  // ---------------------------------------------------------------------------
  inline void SchemaAttDef::setElemId(const unsigned int newId)
  {
      fElemId = newId;
  }
  
  inline void SchemaAttDef::setDatatypeValidator(DatatypeValidator* newDatatypeValidator)
  {
     fDatatypeValidator = newDatatypeValidator;
  }
  
  #endif
  
  
  
  1.1                  xml-xerces/c/src/validators/schema/SchemaAttDefList.cpp
  
  Index: SchemaAttDefList.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2000 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 "Xerces" 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/>.
   */
  
  /*
   * $Log: SchemaAttDefList.cpp,v $
   * Revision 1.1  2001/02/27 18:48:22  tng
   * Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
   *
   */
  
  
  // ---------------------------------------------------------------------------
  //  Includes
  // ---------------------------------------------------------------------------
  #include <validators/schema/SchemaAttDefList.hpp>
  
  
  // ---------------------------------------------------------------------------
  //  SchemaAttDefList: Constructors and Destructor
  // ---------------------------------------------------------------------------
  SchemaAttDefList::SchemaAttDefList(RefHash2KeysTableOf<SchemaAttDef>* const listToUse) :
  
      fEnum(0)
      , fList(listToUse)
  {
      fEnum = new RefHash2KeysTableOfEnumerator<SchemaAttDef>(listToUse);
  }
  
  SchemaAttDefList::~SchemaAttDefList()
  {
      delete fEnum;
  }
  
  
  // ---------------------------------------------------------------------------
  //  SchemaAttDefList: Implementation of the virtual interface
  // ---------------------------------------------------------------------------
  bool SchemaAttDefList::hasMoreElements() const
  {
      return fEnum->hasMoreElements();
  }
  
  
  bool SchemaAttDefList::isEmpty() const
  {
      return fList->isEmpty();
  }
  
  
  XMLAttDef* SchemaAttDefList::findAttDef(const  unsigned long   uriID
                                      , const XMLCh* const    attName)
  {
     QName tempAtt(attName, uriID);
     return fList->get((void*)tempAtt.getLocalPart(), uriID);
  }
  
  
  const XMLAttDef*
  SchemaAttDefList::findAttDef(  const   unsigned long   uriID
                              , const XMLCh* const    attName) const
  {
     QName tempAtt(attName, uriID);
     return fList->get((void*)tempAtt.getLocalPart(), uriID);
  }
  
  
  XMLAttDef* SchemaAttDefList::findAttDef(   const   XMLCh* const    attURI
                                          , const XMLCh* const    attName)
  {
     //need numeric URI id to locate the attribute, that's how it was stored
     ThrowXML(RuntimeException, XMLExcepts::Pool_InvalidId);
     return 0;
  }
  
  
  const XMLAttDef*
  SchemaAttDefList::findAttDef( const   XMLCh* const    attURI
                              , const XMLCh* const    attName) const
  {
     //need numeric URI id to locate the attribute, that's how it was stored
     ThrowXML(RuntimeException, XMLExcepts::Pool_InvalidId);
     return 0;
  }
  
  
  XMLAttDef& SchemaAttDefList::nextElement()
  {
      return fEnum->nextElement();
  }
  
  
  void SchemaAttDefList::Reset()
  {
      fEnum->Reset();
  }
  
  
  
  1.1                  xml-xerces/c/src/validators/schema/SchemaAttDefList.hpp
  
  Index: SchemaAttDefList.hpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2000 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 "Xerces" 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/>.
   */
  
  /*
   * $Log: SchemaAttDefList.hpp,v $
   * Revision 1.1  2001/02/27 18:48:22  tng
   * Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
   *
   */
  
  
  #if !defined(SCHEMAATTDEFLIST_HPP)
  #define SCHEMAATTDEFLIST_HPP
  
  #include <util/RefHash2KeysTableOf.hpp>
  #include <validators/schema/SchemaElementDecl.hpp>
  
  
  //
  //  This is a derivative of the framework abstract class which defines the
  //  interface to a list of attribute defs that belong to a particular
  //  element. The scanner needs to be able to get a list of the attributes
  //  that an element supports, for use during the validation process and for
  //  fixed/default attribute processing.
  //
  //  For us, we just wrap the RefHash2KeysTableOf collection that the SchemaElementDecl
  //  class uses to store the attributes that belong to it.
  //
  //  This class does not adopt the hash table, it just references it. The
  //  hash table is owned by the element decl it is a member of.
  //
  class SchemaAttDefList : public XMLAttDefList
  {
  public :
      // -----------------------------------------------------------------------
      //  Constructors and Destructor
      // -----------------------------------------------------------------------
      SchemaAttDefList
      (
          RefHash2KeysTableOf<SchemaAttDef>* const    listToUse
      );
  
      ~SchemaAttDefList();
  
  
      // -----------------------------------------------------------------------
      //  Implementation of the virtual interface
      // -----------------------------------------------------------------------
      virtual bool hasMoreElements() const;
      virtual bool isEmpty() const;
      virtual XMLAttDef* findAttDef
      (
          const   unsigned long       uriID
          , const XMLCh* const        attName
      );
      virtual const XMLAttDef* findAttDef
      (
          const   unsigned long       uriID
          , const XMLCh* const        attName
      )   const;
      virtual XMLAttDef* findAttDef
      (
          const   XMLCh* const        attURI
          , const XMLCh* const        attName
      );
      virtual const XMLAttDef* findAttDef
      (
          const   XMLCh* const        attURI
          , const XMLCh* const        attName
      )   const;
      virtual XMLAttDef& nextElement();
      virtual void Reset();
  
  
  private :
      // -----------------------------------------------------------------------
      //  Private data members
      //
      //  fEnum
      //      This is an enumerator for the list that we use to do the enumerator
      //      type methods of this class.
      //
      //  fList
      //      The list of SchemaAttDef objects that represent the attributes that
      //      a particular element supports.
      // -----------------------------------------------------------------------
      RefHash2KeysTableOfEnumerator<SchemaAttDef>*    fEnum;
      RefHash2KeysTableOf<SchemaAttDef>*              fList;
  };
  
  #endif
  
  
  
  1.1                  xml-xerces/c/src/validators/schema/SchemaElementDecl.cpp
  
  Index: SchemaElementDecl.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2000 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 "Xerces" 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/>.
   */
  
  /*
   * $Log: SchemaElementDecl.cpp,v $
   * Revision 1.1  2001/02/27 18:48:22  tng
   * Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
   *
   */
  
  
  // ---------------------------------------------------------------------------
  //  Includes
  // ---------------------------------------------------------------------------
  #include <util/XMLString.hpp>
  #include <util/XMLUniDefs.hpp>
  #include <util/XMLUni.hpp>
  #include <framework/XMLBuffer.hpp>
  #include <validators/common/DFAContentModel.hpp>
  #include <validators/common/ContentSpecNode.hpp>
  #include <validators/common/MixedContentModel.hpp>
  #include <validators/common/SimpleContentModel.hpp>
  #include <validators/schema/SchemaAttDefList.hpp>
  #include <validators/schema/SchemaElementDecl.hpp>
  
  // ---------------------------------------------------------------------------
  //  SchemaElementDecl: Constructors and Destructor
  // ---------------------------------------------------------------------------
  SchemaElementDecl::SchemaElementDecl() :
  
      fAttDefs(0)
      , fAttList(0)
      , fContentSpec(0)
      , fModelType(Any)
      , fDatatypeValidator(0)
      , fEnclosingScope(-1)
  {
  }
  
  SchemaElementDecl::SchemaElementDecl(const XMLCh* const                  prefix
                                     , const XMLCh* const                  localPart
                                     , const int                           uriId
                                     , const SchemaElementDecl::ModelTypes type
                                     , const int                           enclosingScope
                                     ) :
      fAttDefs(0)
      , fAttList(0)
      , fContentSpec(0)
      , fModelType(type)
      , fDatatypeValidator(0)
      , fEnclosingScope(enclosingScope)
  {
      fElementName = new QName(prefix, localPart, uriId);
  }
  
  SchemaElementDecl::~SchemaElementDecl()
  {
      delete fAttDefs;
      delete fAttList;
      delete fContentSpec;
      delete fElementName;
  }
  
  
  // ---------------------------------------------------------------------------
  //  SchemaElementDecl: XMLElementDecl virtual interface implementation
  // ---------------------------------------------------------------------------
  XMLAttDef* SchemaElementDecl::findAttr(const XMLCh* const    qName
                                       , const unsigned int    uriId
                                       , const XMLCh* const    baseName
                                       , const XMLCh* const    prefix
                                       , const LookupOpts      options
                                       , bool&           wasAdded) const
  {
      SchemaAttDef* retVal = 0;
  
      // If no att list faulted in yet, then it cannot exist
      if (fAttDefs)
          retVal = fAttDefs->get(baseName, uriId);
  
      // Fault it in if not found and ask to add it
      if (!retVal && (options == XMLElementDecl::AddIfNotFound))
      {
          // Fault in the list itself if not already
          if (!fAttDefs)
              faultInAttDefList();
  
          // And add a default attribute for this name
          retVal = new SchemaAttDef(prefix, baseName, uriId);
          retVal->setElemId(getId());
          fAttDefs->put((void*)baseName, uriId, retVal);
  
          wasAdded = true;
      }
       else
      {
          wasAdded = false;
      }
      return retVal;
  }
  
  
  XMLAttDefList& SchemaElementDecl::getAttDefList() const
  {
      if (!fAttList)
      {
          // If the att def list is not made yet, then fault it in too
          if (!fAttDefs)
              faultInAttDefList();
  
          ((SchemaElementDecl*)this)->fAttList = new SchemaAttDefList(fAttDefs);
      }
  
      // Reset it before we return it
      fAttList->Reset();
      return *fAttList;
  }
  
  
  const XMLCh* SchemaElementDecl::getBaseName() const
  {
      return fElementName->getLocalPart();
  }
  
  
  XMLElementDecl::CharDataOpts SchemaElementDecl::getCharDataOpts() const
  {
      XMLElementDecl::CharDataOpts retVal;
      switch(fModelType)
      {
          case Children :
              retVal = XMLElementDecl::SpacesOk;
              break;
  
          case Empty :
              retVal = XMLElementDecl::NoCharData;
              break;
  
          default :
              retVal = XMLElementDecl::AllCharData;
              break;
      }
      return retVal;
  }
  
  
  bool SchemaElementDecl::hasAttDefs() const
  {
      // If the collection hasn't been faulted in, then no att defs
      if (!fAttDefs)
          return false;
  
      return !fAttDefs->isEmpty();
  }
  
  
  bool SchemaElementDecl::resetDefs()
  {
      // If the collection hasn't been faulted in, then no att defs
      if (!fAttDefs)
          return false;
  
      //
      //  Ok, run through them and clear the 'provided' flag on each of them.
      //  This lets the scanner use them to track which has been provided and
      //  which have not.
      //
      RefHash2KeysTableOfEnumerator<SchemaAttDef> enumDefs(fAttDefs);
      while (enumDefs.hasMoreElements())
          enumDefs.nextElement().setProvided(false);
      return true;
  }
  
  void
  SchemaElementDecl::setContentSpec(ContentSpecNode* toAdopt)
  {
      delete fContentSpec;
      fContentSpec = toAdopt;
  }
  
  // ---------------------------------------------------------------------------
  //  SchemaElementDecl: Getter methods
  // ---------------------------------------------------------------------------
  const SchemaAttDef* SchemaElementDecl::getAttDef(const XMLCh* const baseName, const int uriId) const
  {
      // If no list, then return a null
      if (!fAttDefs)
          return 0;
  
      return fAttDefs->get(baseName, uriId);
  }
  
  SchemaAttDef* SchemaElementDecl::getAttDef(const XMLCh* const baseName, const int uriId)
  {
      // If no list, then return a null
      if (!fAttDefs)
          return 0;
  
      return fAttDefs->get(baseName, uriId);
  }
  
  
  // ---------------------------------------------------------------------------
  //  SchemaElementDecl: Implementation of the protected virtual interface
  // ---------------------------------------------------------------------------
  void SchemaElementDecl::addAttDef(SchemaAttDef* const toAdd)
  {
      // Fault in the att list if required
      if (!fAttDefs)
              faultInAttDefList();
  
      // Tell this guy the element id of its parent (us)
      toAdd->setElemId(getId());
  
      fAttDefs->put((void*)(toAdd->getAttName()->getLocalPart()), toAdd->getAttName()->getURI(), toAdd);
  }
  
  
  // ---------------------------------------------------------------------------
  //  SchemaElementDecl: Implementation of the protected virtual interface
  // ---------------------------------------------------------------------------
  XMLCh*
  SchemaElementDecl::formatContentModel(const XMLValidator& validator) const
  {
      XMLCh* newValue = 0;
      if (fModelType == Any)
      {
          newValue = XMLString::replicate(XMLUni::fgAnyString);
      }
       else if (fModelType == Empty)
      {
          newValue = XMLString::replicate(XMLUni::fgEmptyString);
      }
       else
      {
          //
          //  Use a temp XML buffer to format into. Content models could be
          //  pretty long, but very few will be longer than one K. The buffer
          //  will expand to handle the more pathological ones.
          //
          XMLBuffer bufFmt;
          fContentSpec->formatSpec(validator, bufFmt);
          newValue = XMLString::replicate(bufFmt.getRawBuffer());
      }
      return newValue;
  }
  
  XMLContentModel* SchemaElementDecl::makeContentModel() const
  {
      XMLContentModel* cmRet = 0;
      if (fModelType == Simple) {
         // just return nothing
      }
       else if (fModelType == Mixed)
      {
          //
          //  Just create a mixel content model object. This type of
          //  content model is optimized for mixed content validation.
          //
          cmRet = new MixedContentModel(*this);
      }
       else if (fModelType == Children)
      {
          //
          //  This method will create an optimal model for the complexity
          //  of the element's defined model. If its simple, it will create
          //  a SimpleContentModel object. If its a simple list, it will
          //  create a SimpleListContentModel object. If its complex, it
          //  will create a DFAContentModel object.
          //
          cmRet = createChildModel();
      }
       else
      {
          ThrowXML(RuntimeException, XMLExcepts::CM_MustBeMixedOrChildren);
      }
      return cmRet;
  }
  
  
  
  // ---------------------------------------------------------------------------
  //  SchemaElementDecl: Private helper methods
  // ---------------------------------------------------------------------------
  XMLContentModel* SchemaElementDecl::createChildModel() const
  {
      // Get the content spec node of the element
      const ContentSpecNode* specNode = getContentSpec();
  
      //
      //  Do a sanity check that the node is does not have a PCDATA id. Since,
      //  if it was, it should have already gotten taken by the Mixed model.
      //
      if (specNode->getElemId() == XMLElementDecl::fgPCDataElemId)
          ThrowXML(RuntimeException, XMLExcepts::CM_NoPCDATAHere);
  
      //
      //  According to the type of node, we will create the correct type of
      //  content model.
      //
      if ((specNode->getType() == ContentSpecNode.Any) ||
         (specNode->getType() == ContentSpecNode.Any_Other) ||
         (specNode->getType() == ContentSpecNode.Any_Local)) {
         // let fall through to build a DFAContentModel
      }
       else if (specNode->getType() == ContentSpecNode::Leaf)
      {
          // Create a simple content model
          return new SimpleContentModel
          (
              specNode->getElemId()
              , XMLElementDecl::fgInvalidElemId
              , ContentSpecNode::Leaf
          );
      }
       else if ((specNode->getType() == ContentSpecNode::Choice)
            ||  (specNode->getType() == ContentSpecNode::Sequence))
      {
          //
          //  Lets see if both of the children are leafs. If so, then it has to
          //  be a simple content model
          //
          if ((specNode->getFirst()->getType() == ContentSpecNode::Leaf)
          &&  (specNode->getSecond()->getType() == ContentSpecNode::Leaf))
          {
              return new SimpleContentModel
              (
                  specNode->getFirst()->getElemId()
                  , specNode->getSecond()->getElemId()
                  , specNode->getType()
              );
          }
      }
       else if ((specNode->getType() == ContentSpecNode::OneOrMore)
            ||  (specNode->getType() == ContentSpecNode::ZeroOrMore)
            ||  (specNode->getType() == ContentSpecNode::ZeroOrOne))
      {
          //
          //  Its a repetition, so see if its one child is a leaf. If so its a
          //  repetition of a single element, so we can do a simple content
          //  model for that.
          //
          if (specNode->getFirst()->getType() == ContentSpecNode::Leaf)
          {
              return new SimpleContentModel
              (
                  specNode->getFirst()->getElemId()
                  , XMLElementDecl::fgInvalidElemId
                  , specNode->getType()
              );
          }
      }
       else
      {
          ThrowXML(RuntimeException, XMLExcepts::CM_UnknownCMSpecType);
      }
  
      // Its not any simple type of content, so create a DFA based content model
      return new DFAContentModel(*this);
  }
  
  
  void SchemaElementDecl::faultInAttDefList() const
  {
      // Use a hash modulus of 29 and tell it owns its elements
      ((SchemaElementDecl*)this)->fAttDefs = new RefHash2KeysTableOf<SchemaAttDef>(29, true);
  }
  
  
  
  1.1                  xml-xerces/c/src/validators/schema/SchemaElementDecl.hpp
  
  Index: SchemaElementDecl.hpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2000 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 "Xerces" 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/>.
   */
  
  /*
   * $Log: SchemaElementDecl.hpp,v $
   * Revision 1.1  2001/02/27 18:48:23  tng
   * Schema: Add SchemaAttDef, SchemaElementDecl, SchemaAttDefList.
   *
   */
  
  
  #if !defined(SCHEMAELEMENTDECL_HPP)
  #define SCHEMAELEMENTDECL_HPP
  
  #include <util/RefHash2KeysTableOf.hpp>
  #include <util/QName.hpp>
  #include <framework/XMLElementDecl.hpp>
  #include <validators/schema/SchemaAttDef.hpp>
  
  class ContentSpecNode;
  class SchemaAttDefList;
  class DatatypeValidator;
  
  
  //
  //  This class is a derivative of the basic element decl. This one implements
  //  the virtuals so that they work for a Schema.
  //
  class VALIDATORS_EXPORT SchemaElementDecl : public XMLElementDecl
  {
  public :
      // -----------------------------------------------------------------------
      //  Class specific types
      //
      //  ModelTypes
      //      Indicates the type of content model that an element has. This
      //      indicates how the content model is represented and validated.
      // -----------------------------------------------------------------------
      enum ModelTypes
      {
          Empty
          , Any
          , Mixed
          , Children
          , Simple
  
          , ModelTypes_Count
      };
  
  
      // -----------------------------------------------------------------------
      //  Constructors and Destructor
      // -----------------------------------------------------------------------
      SchemaElementDecl();
  
      SchemaElementDecl
      (
          const XMLCh* const       prefix
        , const XMLCh* const       localPart
        , const int                uriId
        , const ModelTypes         modelType = Any
        , const int                enclosingScope = -1
      );
  
      ~SchemaElementDecl();
  
  
      // -----------------------------------------------------------------------
      //  The virtual element decl interface
      // -----------------------------------------------------------------------
      virtual XMLAttDef* findAttr
      (
          const   XMLCh* const    qName
          , const unsigned int    uriId
          , const XMLCh* const    baseName
          , const XMLCh* const    prefix
          , const LookupOpts      options
          ,       bool&           wasAdded
      )   const;
      virtual XMLAttDefList& getAttDefList() const;
      virtual const XMLCh* getBaseName() const;
      virtual const int getURI() const;
      virtual CharDataOpts getCharDataOpts() const;
      virtual const XMLCh* getFullName() const;
      virtual bool hasAttDefs() const;
      virtual bool resetDefs();
      virtual const ContentSpecNode* getContentSpec() const;
      virtual ContentSpecNode* getContentSpec();
      virtual void setContentSpec(ContentSpecNode* toAdopt);
  
  
      // -----------------------------------------------------------------------
      //  Getter methods
      // -----------------------------------------------------------------------
      const SchemaAttDef* getAttDef(const XMLCh* const baseName, const int uriId) const;
      SchemaAttDef* getAttDef(const XMLCh* const baseName, const int uriId);
      QName* getElementName() const;
      ModelTypes getModelType() const;
      DatatypeValidator* getDatatypeValidator() const;
      int getEnclosingScope() const;
  
  
      // -----------------------------------------------------------------------
      //  Setter methods
      // -----------------------------------------------------------------------
      void addAttDef(SchemaAttDef* const toAdd);
      void setElementName(const XMLCh* const prefix
                        , const XMLCh* const localPart
                        , const int          uriId = -1);
      void setModelType(const SchemaElementDecl::ModelTypes toSet);
      void setDatatypeValidator(DatatypeValidator* newDatatypeValidator);
      void setEnclosingScope(const int enclosingScope);
  
  
  protected :
      // -----------------------------------------------------------------------
      //  Protected, virtual methods
      // -----------------------------------------------------------------------
      virtual XMLContentModel* makeContentModel() const;
      virtual XMLCh* formatContentModel
      (
          const   XMLValidator&   validator
      )   const;
  
  
  private :
      // -----------------------------------------------------------------------
      //  Private helper methods
      // -----------------------------------------------------------------------
      XMLContentModel* createChildModel() const;
      void faultInAttDefList() const;
  
  
      // -----------------------------------------------------------------------
      //  Private data members
      //
      //  fAttDefs
      //      The list of attributes that are defined for this element. Each
      //      element is its own little 'namespace' for attributes, so each
      //      element maintains its own list of owned attribute defs. It is
      //      faulted in when an attribute is actually added.
      //
      //  fAttList
      //      We have to return a view of our att defs via the abstract view
      //      that the scanner understands. It may or may not ever be asked
      //      for so we fault it in as needed.
      //
      //  fContentSpec
      //      This is the content spec for the node. It contains the original
      //      content spec that was read from the Schema, as a tree of nodes. This
      //      one is always set up, and is used to build the fContentModel
      //      version if we are validating.
      //
      //  fElementName
      //      This is the name of the element decl.
      //
      //  fModelType
      //      The content model type of this element. This tells us what kind
      //      of content model to create.
      //
      //  fDatatypeValidator
      //      The DatatypeValidator used to validate this element type.
      //
      //  fEnclosingScope
      //      The enclosing scope where this element is declared.
      // -----------------------------------------------------------------------
      RefHash2KeysTableOf<SchemaAttDef>*  fAttDefs;
      SchemaAttDefList*              fAttList;
      ContentSpecNode*               fContentSpec;
      QName*                         fElementName;
      ModelTypes                     fModelType;
      DatatypeValidator*             fDatatypeValidator;
      int                            fEnclosingScope;
  };
  
  // ---------------------------------------------------------------------------
  //  SchemaElementDecl: XMLElementDecl virtual interface implementation
  // ---------------------------------------------------------------------------
  inline const int SchemaElementDecl::getURI() const
  {
      return fElementName->getURI();
  }
  
  inline const XMLCh* SchemaElementDecl::getFullName() const
  {
      return fElementName->getRawName();
  }
  
  inline ContentSpecNode* SchemaElementDecl::getContentSpec()
  {
      return fContentSpec;
  }
  
  inline const ContentSpecNode* SchemaElementDecl::getContentSpec() const
  {
      return fContentSpec;
  }
  
  // ---------------------------------------------------------------------------
  //  SchemaElementDecl: Getter methods
  // ---------------------------------------------------------------------------
  inline QName* SchemaElementDecl::getElementName() const
  {
      return fElementName;
  }
  
  inline SchemaElementDecl::ModelTypes SchemaElementDecl::getModelType() const
  {
      return fModelType;
  }
  
  inline DatatypeValidator* SchemaElementDecl::getDatatypeValidator() const
  {
      return fDatatypeValidator;
  }
  
  inline int SchemaElementDecl::getEnclosingScope() const
  {
      return fEnclosingScope;
  }
  
  // ---------------------------------------------------------------------------
  //  SchemaElementDecl: Setter methods
  // ---------------------------------------------------------------------------
  inline void SchemaElementDecl::setElementName(const XMLCh* const        prefix
                              , const XMLCh* const        localPart
                              , const int                 uriId )
  {
     fElementName->setName(prefix, localPart, uriId);
  }
  
  inline void
  SchemaElementDecl::setModelType(const SchemaElementDecl::ModelTypes toSet)
  {
      fModelType = toSet;
  }
  
  inline void SchemaElementDecl::setDatatypeValidator(DatatypeValidator* newDatatypeValidator)
  {
      fDatatypeValidator = newDatatypeValidator;
  }
  
  inline void SchemaElementDecl::setEnclosingScope(const int newEnclosingScope)
  {
      fEnclosingScope = newEnclosingScope;
  }
  
  #endif