You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pe...@apache.org on 2003/11/12 21:29:47 UTC

cvs commit: xml-xerces/c/src/xercesc/internal ValidationContextImpl.cpp ValidationContextImpl.hpp DGXMLScanner.cpp IGXMLScanner.cpp IGXMLScanner2.cpp Makefile.in SGXMLScanner.cpp XMLScanner.cpp XMLScanner.hpp

peiyongz    2003/11/12 12:29:47

  Modified:    c/src/xercesc/internal DGXMLScanner.cpp IGXMLScanner.cpp
                        IGXMLScanner2.cpp Makefile.in SGXMLScanner.cpp
                        XMLScanner.cpp XMLScanner.hpp
  Added:       c/src/xercesc/internal ValidationContextImpl.cpp
                        ValidationContextImpl.hpp
  Log:
  Stateless Grammar: ValidationContext
  
  Revision  Changes    Path
  1.29      +3 -3      xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp
  
  Index: DGXMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/DGXMLScanner.cpp,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- DGXMLScanner.cpp	10 Nov 2003 21:56:53 -0000	1.28
  +++ DGXMLScanner.cpp	12 Nov 2003 20:29:47 -0000	1.29
  @@ -1760,7 +1760,7 @@
           fErrorReporter->resetErrors();
   
       // Clear out the id reference list
  -    fIDRefList->removeAll();
  +    resetValidationContext();
   
       if (toCache) {
   
  @@ -2122,7 +2122,7 @@
           fErrorReporter->resetErrors();
   
       // Clear out the id reference list
  -    fIDRefList->removeAll();
  +    resetValidationContext();
   
       // Reset the Root Element Name
       fMemoryManager->deallocate(fRootElemName);//delete [] fRootElemName;
  
  
  
  1.30      +2 -2      xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp
  
  Index: IGXMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner.cpp,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- IGXMLScanner.cpp	10 Nov 2003 21:56:53 -0000	1.29
  +++ IGXMLScanner.cpp	12 Nov 2003 20:29:47 -0000	1.30
  @@ -3035,7 +3035,7 @@
           fErrorReporter->resetErrors();
   
       // Clear out the id reference list
  -    fIDRefList->removeAll();
  +    resetValidationContext();
       // and clear out the darned undeclared DTD element pool...
       fDTDElemNonDeclPool->removeAll();
   
  
  
  
  1.40      +2 -2      xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp
  
  Index: IGXMLScanner2.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- IGXMLScanner2.cpp	10 Nov 2003 21:56:53 -0000	1.39
  +++ IGXMLScanner2.cpp	12 Nov 2003 20:29:47 -0000	1.40
  @@ -955,7 +955,7 @@
           fErrorReporter->resetErrors();
   
       // Clear out the id reference list
  -    fIDRefList->removeAll();
  +    resetValidationContext();
   
       // Reset the Root Element Name
       fMemoryManager->deallocate(fRootElemName);//delete [] fRootElemName;
  
  
  
  1.18      +3 -1      xml-xerces/c/src/xercesc/internal/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/Makefile.in,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Makefile.in	29 Oct 2003 16:14:15 -0000	1.17
  +++ Makefile.in	12 Nov 2003 20:29:47 -0000	1.18
  @@ -89,6 +89,7 @@
   	MemoryManagerImpl.hpp \
   	ReaderMgr.hpp \
   	SGXMLScanner.hpp \
  +	ValidationContextImpl.hpp \
   	VecAttrListImpl.hpp \
   	VecAttributesImpl.hpp \
   	IGXMLScanner.hpp \
  @@ -120,6 +121,7 @@
   	MemoryManagerImpl.$(TO) \
   	ReaderMgr.$(TO) \
   	SGXMLScanner.$(TO) \
  +	ValidationContextImpl.$(TO) \
   	VecAttrListImpl.$(TO) \
   	VecAttributesImpl.$(TO) \
   	WFXMLScanner.$(TO) \
  
  
  
  1.48      +3 -3      xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp
  
  Index: SGXMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- SGXMLScanner.cpp	10 Nov 2003 21:56:53 -0000	1.47
  +++ SGXMLScanner.cpp	12 Nov 2003 20:29:47 -0000	1.48
  @@ -2414,7 +2414,7 @@
           for(unsigned int i=0; i<attDefList.getAttDefCount(); i++)
           {
               // Get the current att def, for convenience and its def type
  -            XMLAttDef *curDef = &attDefList.getAttDef(i);
  +            XMLAttDef *curDef = &attDefList.getAttDef(i);            
               const XMLAttDef::DefAttTypes defType = curDef->getDefaultType();
   
               if (!curDef->getProvided())
  @@ -2784,7 +2784,7 @@
           fErrorReporter->resetErrors();
   
       // Clear out the id reference list
  -    fIDRefList->removeAll();
  +    resetValidationContext();
   
       // Reset IdentityConstraints
       fValueStoreCache->startDocument();
  
  
  
  1.52      +16 -6     xml-xerces/c/src/xercesc/internal/XMLScanner.cpp
  
  Index: XMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLScanner.cpp,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- XMLScanner.cpp	4 Nov 2003 14:08:30 -0000	1.51
  +++ XMLScanner.cpp	12 Nov 2003 20:29:47 -0000	1.52
  @@ -63,6 +63,7 @@
   //  Includes
   // ---------------------------------------------------------------------------
   #include <xercesc/internal/XMLScanner.hpp>
  +#include <xercesc/internal/ValidationContextImpl.hpp>
   #include <xercesc/util/Janitor.hpp>
   #include <xercesc/util/Mutexes.hpp>
   #include <xercesc/util/RuntimeException.hpp>
  @@ -198,7 +199,8 @@
       , fEntityHandler(0)
       , fErrorReporter(0)
       , fErrorHandler(0)
  -    , fIDRefList(0)
  +    , fValidationContext(0)
  +    , fEntityDeclPoolRetrieved(false)
       , fReaderMgr(manager)
       , fValidator(valToAdopt)
       , fValScheme(Val_Never)
  @@ -268,7 +270,8 @@
       , fEntityHandler(entityHandler)
       , fErrorReporter(errHandler)
       , fErrorHandler(0)
  -    , fIDRefList(0)
  +    , fValidationContext(0)
  +    , fEntityDeclPoolRetrieved(false)
       , fReaderMgr(manager)
       , fValidator(valToAdopt)
       , fValScheme(Val_Never)
  @@ -304,7 +307,7 @@
   XMLScanner::~XMLScanner()
   {
       delete fAttrList;
  -    delete fIDRefList;
  +    delete fValidationContext;
       fMemoryManager->deallocate(fRootElemName);//delete [] fRootElemName;
       fMemoryManager->deallocate(fExternalSchemaLocation);//delete [] fExternalSchemaLocation;
       fMemoryManager->deallocate(fExternalNoNamespaceSchemaLocation);//delete [] fExternalNoNamespaceSchemaLocation;
  @@ -733,7 +736,7 @@
   
       //  Create the id ref list. This is used to enforce XML 1.0 ID ref
       //  semantics, i.e. all id refs must refer to elements that exist
  -    fIDRefList = new (fMemoryManager) RefHashTableOf<XMLRefInfo>(109, fMemoryManager);
  +    fValidationContext = new (fMemoryManager) ValidationContextImpl(fMemoryManager);
   
       //  Create the GrammarResolver
       //fGrammarResolver = new GrammarResolver();
  @@ -1728,11 +1731,12 @@
   //  This method is called after the content scan to insure that all the
   //  ID/IDREF attributes match up (i.e. that all IDREFs refer to IDs.) This is
   //  an XML 1.0 rule, so we can do here in the core.
  +
   void XMLScanner::checkIDRefs()
   {
       //  Iterate the id ref list. If we find any entries here which are used
       //  but not declared, then that's an error.
  -    RefHashTableOfEnumerator<XMLRefInfo> refEnum(fIDRefList);
  +    RefHashTableOfEnumerator<XMLRefInfo> refEnum(fValidationContext->getIdRefList());
       while (refEnum.hasMoreElements())
       {
           // Get a ref to the current element
  @@ -2124,5 +2128,11 @@
       return toFill.getLen();
   }
   
  +inline void XMLScanner::resetValidationContext()
  +{
  +    fValidationContext->clearIdRefList();
  +    fValidationContext->setEntityDeclPool(0);
  +    fEntityDeclPoolRetrieved = false;
  +}
   
   XERCES_CPP_NAMESPACE_END
  
  
  
  1.26      +23 -3     xml-xerces/c/src/xercesc/internal/XMLScanner.hpp
  
  Index: XMLScanner.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLScanner.hpp,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- XMLScanner.hpp	6 Nov 2003 15:30:06 -0000	1.25
  +++ XMLScanner.hpp	12 Nov 2003 20:29:47 -0000	1.26
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.26  2003/11/12 20:29:47  peiyongz
  + * Stateless Grammar: ValidationContext
  + *
    * Revision 1.25  2003/11/06 15:30:06  neilg
    * first part of PSVI/schema component model implementation, thanks to David Cargill.  This covers setting the PSVIHandler on parser objects, as well as implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and XSAttributeUse.
    *
  @@ -294,6 +297,7 @@
   #include <xercesc/internal/ElemStack.hpp>
   #include <xercesc/validators/DTD/DTDEntityDecl.hpp>
   #include <xercesc/framework/XMLAttr.hpp>
  +#include <xercesc/framework/ValidationContext.hpp>
   #include <xercesc/validators/common/GrammarResolver.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
  @@ -463,6 +467,9 @@
       bool getValidationConstraintFatal() const;
       RefHashTableOf<XMLRefInfo>* getIDRefList();
       const RefHashTableOf<XMLRefInfo>* getIDRefList() const;
  +
  +    ValidationContext*   getValidationContext();
  +
       bool getInException() const;
       /*bool getLastExtLocation
       (
  @@ -694,6 +701,7 @@
       bool isLegalToken(const XMLPScanToken& toCheck);
       XMLTokens senseNextToken(unsigned int& orgReader);
       void initValidator(XMLValidator* theValidator);
  +    inline void resetValidationContext();
   
       // -----------------------------------------------------------------------
       //  Data members
  @@ -935,7 +943,8 @@
       XMLErrorReporter*           fErrorReporter;
       ErrorHandler*               fErrorHandler;
       PSVIHandler*                fPSVIHandler;
  -    RefHashTableOf<XMLRefInfo>* fIDRefList;
  +    ValidationContext           *fValidationContext;
  +    bool                        fEntityDeclPoolRetrieved;
       ReaderMgr                   fReaderMgr;
       XMLValidator*               fValidator;
       ValSchemes                  fValScheme;
  @@ -1069,12 +1078,23 @@
   
   inline RefHashTableOf<XMLRefInfo>* XMLScanner::getIDRefList()
   {
  -    return fIDRefList;
  +    return fValidationContext->getIdRefList();
   }
   
   inline const RefHashTableOf<XMLRefInfo>* XMLScanner::getIDRefList() const
   {
  -    return fIDRefList;
  +    return fValidationContext->getIdRefList();
  +}
  +
  +inline ValidationContext*  XMLScanner::getValidationContext()
  +{
  +    if (!fEntityDeclPoolRetrieved)
  +    {
  +        fValidationContext->setEntityDeclPool(getEntityDeclPool());
  +        fEntityDeclPoolRetrieved = true;
  +    }
  +
  +    return fValidationContext;
   }
   
   inline const Locator* XMLScanner::getLocator() const
  
  
  
  1.1                  xml-xerces/c/src/xercesc/internal/ValidationContextImpl.cpp
  
  Index: ValidationContextImpl.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 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: ValidationContextImpl.cpp,v $
   * Revision 1.1  2003/11/12 20:29:47  peiyongz
   * Stateless Grammar: ValidationContext
   *
   * $Id: ValidationContextImpl.cpp,v 1.1 2003/11/12 20:29:47 peiyongz Exp $ 
   *
   */
  
  
  // ---------------------------------------------------------------------------
  //  Includes
  // ---------------------------------------------------------------------------
  #include <xercesc/internal/ValidationContextImpl.hpp>
  #include <xercesc/framework/XMLRefInfo.hpp>
  #include <xercesc/validators/DTD/DTDEntityDecl.hpp>
  #include <xercesc/validators/datatype/InvalidDatatypeValueException.hpp>
  
  XERCES_CPP_NAMESPACE_BEGIN
  
  // ---------------------------------------------------------------------------
  //  Constructor and Destructor
  // ---------------------------------------------------------------------------
  ValidationContextImpl::~ValidationContextImpl()
  {
      if (fIdRefList)
          delete fIdRefList;
  }
  
  ValidationContextImpl::ValidationContextImpl(MemoryManager* const manager)
  :ValidationContext(manager)
  ,fIdRefList(0)
  ,fEntityDeclPool(0)
  ,fToCheckIdRefList(true)
  {
      fIdRefList = new (fMemoryManager) RefHashTableOf<XMLRefInfo>(109, fMemoryManager);
  }
  
  /**
   * IdRefList
   *
   */
  RefHashTableOf<XMLRefInfo>* ValidationContextImpl::getIdRefList() const
  {
      return fIdRefList;
  }
  
  void ValidationContextImpl::setIdRefList(RefHashTableOf<XMLRefInfo>* const newIdRefList)
  {
      if (fIdRefList)
          delete fIdRefList;
  
      fIdRefList = newIdRefList;
  }
  
  void ValidationContextImpl::clearIdRefList()
  {
      if (fIdRefList)
          fIdRefList->removeAll();
  
  }
  
  void ValidationContextImpl::addId(const XMLCh * const content)
  {
      if (!fIdRefList || !fToCheckIdRefList)
          return;
  
      XMLRefInfo* idEntry = fIdRefList->get(content);
  
      if (idEntry)
      {
          if (idEntry->getDeclared())
          {
              ThrowXML1(InvalidDatatypeValueException
                      , XMLExcepts::VALUE_ID_Not_Unique
                      , content);
          }
      }
      else
      {
          idEntry = new (fMemoryManager) XMLRefInfo(content, false, false, fMemoryManager);
          fIdRefList->put((void*)idEntry->getRefName(), idEntry);
      }
  
      //
      //  Mark it declared
      //
      idEntry->setDeclared(true);
  
  }
  
  void ValidationContextImpl::addIdRef(const XMLCh * const content)
  {
      if (!fIdRefList || !fToCheckIdRefList)
          return;
  
      XMLRefInfo* idEntry = fIdRefList->get(content);
  
      if (!idEntry)
      {
          idEntry = new (fMemoryManager) XMLRefInfo(content, false, false, fMemoryManager);
          fIdRefList->put((void*)idEntry->getRefName(), idEntry);
      }
  
      //
      //  Mark it used
      //
      idEntry->setUsed(true);
  
  }
  
  void ValidationContextImpl::toCheckIdRefList(bool toCheck)
  { 
      fToCheckIdRefList = toCheck;
  }
  
  /**
   * EntityDeclPool
   *
   */
  const NameIdPool<DTDEntityDecl>* ValidationContextImpl::getEntityDeclPool() const
  {
      return fEntityDeclPool;
  }
  
  const NameIdPool<DTDEntityDecl>* ValidationContextImpl::setEntityDeclPool(const NameIdPool<DTDEntityDecl>* const newEntityDeclPool)
  {
      // we don't own it so we return the existing one for the owner to delete
      const NameIdPool<DTDEntityDecl>* tempPool = fEntityDeclPool;
      fEntityDeclPool = newEntityDeclPool;
      return tempPool;
  
  }
             
  void ValidationContextImpl::checkEntity(const XMLCh * const content) const
  {
  
      if (fEntityDeclPool)
      {
          const DTDEntityDecl* decl = fEntityDeclPool->getByKey(content);
  
          if (!decl || !decl->isUnparsed())
          {
              ThrowXML1(InvalidDatatypeValueException
                      , XMLExcepts::VALUE_ENTITY_Invalid
                      , content);
          }
  
      }
      else 
      {
          ThrowXML1
          (
              InvalidDatatypeValueException
              , XMLExcepts::VALUE_ENTITY_Invalid
              , content
          );
      }
  
  }
  
  XERCES_CPP_NAMESPACE_END
  
  
  
  
  1.1                  xml-xerces/c/src/xercesc/internal/ValidationContextImpl.hpp
  
  Index: ValidationContextImpl.hpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2003 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: ValidationContextImpl.hpp,v $
   * Revision 1.1  2003/11/12 20:29:47  peiyongz
   * Stateless Grammar: ValidationContext
   *
   * $Id: ValidationContextImpl.hpp,v 1.1 2003/11/12 20:29:47 peiyongz Exp $
   *
   */
  
  #if !defined(VALIDATION_CONTEXTIMPL_HPP)
  #define VALIDATION_CONTEXTIMPL_HPP
  
  #include <xercesc/framework/ValidationContext.hpp>
  
  XERCES_CPP_NAMESPACE_BEGIN
  
  class XMLPARSER_EXPORT ValidationContextImpl : public ValidationContext
  {
  public :
      // -----------------------------------------------------------------------
      /** @name Virtual destructor for derived classes */
      // -----------------------------------------------------------------------
      //@{
  
      /**
        * virtual destructor
        *
        */
      virtual ~ValidationContextImpl();
  
      ValidationContextImpl(MemoryManager* const memMgr = XMLPlatformUtils::fgMemoryManager);
  
      //@}
  
      // -----------------------------------------------------------------------
      /** @name The ValidationContextImpl Interface */
      // -----------------------------------------------------------------------
      //@{
  
      /**
        * IDRefList
        *
        */
      virtual RefHashTableOf<XMLRefInfo>*  getIdRefList() const;
  
      virtual void                         setIdRefList(RefHashTableOf<XMLRefInfo>* const);
  
      virtual void                         clearIdRefList();
  
      virtual void                         addId(const XMLCh * const );
  
      virtual void                         addIdRef(const XMLCh * const );
  
      virtual void                         toCheckIdRefList(bool);
  
      /**
        * EntityDeclPool
        *
        */
      virtual const NameIdPool<DTDEntityDecl>* getEntityDeclPool() const;
  
      virtual const NameIdPool<DTDEntityDecl>* setEntityDeclPool(const NameIdPool<DTDEntityDecl>* const);    
             
      virtual void                             checkEntity(const XMLCh * const ) const;
  
      //@}
    
  private:
      // -----------------------------------------------------------------------
      /** name  Unimplemented copy constructor and operator= */
      // -----------------------------------------------------------------------
      //@{
      ValidationContextImpl(const ValidationContextImpl& );
      ValidationContextImpl& operator=(const ValidationContextImpl& );
      //@}
  
      // -----------------------------------------------------------------------
      //  Data members
      //
      //  fIDRefList:  owned/adopted
      //      This is a list of XMLRefInfo objects. This member lets us do all
      //      needed ID-IDREF balancing checks.
      //
      //  fEntityDeclPool: referenced only
      //      This is a pool of EntityDecl objects, which contains all of the
      //      general entities that are declared in the DTD subsets, plus the
      //      default entities (such as &gt; &lt; ...) defined by the XML Standard.
      //
      //  fToAddToList
      // -----------------------------------------------------------------------
  
      RefHashTableOf<XMLRefInfo>*         fIdRefList;
      const NameIdPool<DTDEntityDecl>*    fEntityDeclPool;
      bool                                fToCheckIdRefList;
  
  };
  
  XERCES_CPP_NAMESPACE_END
  
  #endif
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org