You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2001/07/31 17:26:54 UTC

cvs commit: xml-xerces/c/src/validators/schema XercesAttGroupInfo.hpp XercesAttGroupInfo.cpp XercesGroupInfo.hpp SchemaInfo.hpp SchemaInfo.cpp SchemaAttDef.hpp SchemaAttDef.cpp NamespaceScope.hpp NamespaceScope.cpp Makefile.in

knoaman     01/07/31 08:26:54

  Modified:    c/src/validators/schema XercesGroupInfo.hpp SchemaInfo.hpp
                        SchemaInfo.cpp SchemaAttDef.hpp SchemaAttDef.cpp
                        NamespaceScope.hpp NamespaceScope.cpp Makefile.in
  Added:       c/src/validators/schema XercesAttGroupInfo.hpp
                        XercesAttGroupInfo.cpp
  Log:
  Added support for <attributeGroup>.
  
  Revision  Changes    Path
  1.2       +23 -1     xml-xerces/c/src/validators/schema/XercesGroupInfo.hpp
  
  Index: XercesGroupInfo.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/XercesGroupInfo.hpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XercesGroupInfo.hpp	2001/07/24 18:33:46	1.1
  +++ XercesGroupInfo.hpp	2001/07/31 15:26:54	1.2
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: XercesGroupInfo.hpp,v 1.1 2001/07/24 18:33:46 knoaman Exp $
  + * $Id: XercesGroupInfo.hpp,v 1.2 2001/07/31 15:26:54 knoaman Exp $
    */
   
   #if !defined(XERCESGROUPINFO_HPP)
  @@ -108,6 +108,11 @@
       void setAdoptContentSpec(const bool toAdopt);
       void addElement(SchemaElementDecl* const toAdd);
   
  +	// -----------------------------------------------------------------------
  +    //  Query methods
  +    // -----------------------------------------------------------------------
  +    bool containsElement(const SchemaElementDecl* const elem);
  +
   private:
       // -----------------------------------------------------------------------
       //  Unimplemented contstructors and operators
  @@ -169,6 +174,23 @@
   inline void XercesGroupInfo::addElement(SchemaElementDecl* const elem) {
   
       fElements->addElement(elem);
  +}
  +
  +
  +// ---------------------------------------------------------------------------
  +//  XercesGroupInfo: Query methods
  +// ---------------------------------------------------------------------------}
  +inline bool XercesGroupInfo::containsElement(const SchemaElementDecl* const elem) {
  +
  +    unsigned int elemSize = fElements->size();
  +
  +    for (unsigned int i=0; i < elemSize; i++) {
  +        if (fElements->elementAt(i) == elem) {
  +            return true;
  +        }
  +    }
  +
  +    return false;
   }
   
   #endif
  
  
  
  1.4       +17 -10    xml-xerces/c/src/validators/schema/SchemaInfo.hpp
  
  Index: SchemaInfo.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/SchemaInfo.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SchemaInfo.hpp	2001/07/09 14:29:43	1.3
  +++ SchemaInfo.hpp	2001/07/31 15:26:54	1.4
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: SchemaInfo.hpp,v 1.3 2001/07/09 14:29:43 knoaman Exp $
  + * $Id: SchemaInfo.hpp,v 1.4 2001/07/31 15:26:54 knoaman Exp $
    */
   
   #if !defined(SCHEMAINFO_HPP)
  @@ -89,6 +89,7 @@
                  const bool attrDefaultQualified,
                  const int blockDefault,
                  const int finalDefault,
  +               const unsigned int namespaceScopeLevel,
                  XMLCh* const schemaURL,
                  const DOM_Element& root,
                  SchemaInfo* const nextRoot,
  @@ -99,19 +100,20 @@
   	// -----------------------------------------------------------------------
       //  Getter methods
       // -----------------------------------------------------------------------
  -    SchemaInfo* getNext() const;
  -    SchemaInfo* getPrev() const;
  -    XMLCh*      getCurrentSchemaURL() const;
  -    DOM_Element getRoot() const;
  -    int         getBlockDefault() const;
  -    int         getFinalDefault() const;
  -    bool        isElementDefaultQualified() const;
  -    bool        isAttributeDefaultQualified() const;
  +    SchemaInfo*  getNext() const;
  +    SchemaInfo*  getPrev() const;
  +    XMLCh*       getCurrentSchemaURL() const;
  +    DOM_Element  getRoot() const;
  +    int          getBlockDefault() const;
  +    int          getFinalDefault() const;
  +    unsigned int getNamespaceScopeLevel() const;
  +    bool         isElementDefaultQualified() const;
  +    bool         isAttributeDefaultQualified() const;
   
   	// -----------------------------------------------------------------------
       //  Setter methods
       // -----------------------------------------------------------------------
  -    void setNext(SchemaInfo* const nextInfo);
  +    void setNext(SchemaInfo* const nextInfo);    
   
   private:
       // -----------------------------------------------------------------------
  @@ -121,6 +123,7 @@
       bool               fAttributeDefaultQualified;
       int                fBlockDefault;
       int                fFinalDefault;
  +    unsigned int       fNamespaceScopeLevel;
       XMLCh*             fCurrentSchemaURL;
       DOM_Element        fSchemaRootElement;
       SchemaInfo*        fNext;
  @@ -149,6 +152,10 @@
   inline int SchemaInfo::getFinalDefault() const {
   
       return fFinalDefault;
  +}
  +
  +inline unsigned int SchemaInfo::getNamespaceScopeLevel() const {
  +    return fNamespaceScopeLevel;
   }
   
   inline XMLCh* SchemaInfo::getCurrentSchemaURL() const {
  
  
  
  1.4       +5 -0      xml-xerces/c/src/validators/schema/SchemaInfo.cpp
  
  Index: SchemaInfo.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/SchemaInfo.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SchemaInfo.cpp	2001/07/09 14:29:43	1.3
  +++ SchemaInfo.cpp	2001/07/31 15:26:54	1.4
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: SchemaInfo.cpp,v $
  + * Revision 1.4  2001/07/31 15:26:54  knoaman
  + * Added support for <attributeGroup>.
  + *
    * Revision 1.3  2001/07/09 14:29:43  knoaman
    * Fixes for import/include declarations
    *
  @@ -81,6 +84,7 @@
                          const bool attrDefaultQualified,
                          const int blockDefault,
                          const int finalDefault,
  +                       const unsigned int namespaceScopeLevel,
                          XMLCh* const schemaURL,
                          const DOM_Element& root,
                          SchemaInfo* const nextRoot,
  @@ -89,6 +93,7 @@
       , fAttributeDefaultQualified(attrDefaultQualified)
       , fBlockDefault(blockDefault)
       , fFinalDefault(finalDefault)
  +    , fNamespaceScopeLevel(namespaceScopeLevel)
       , fCurrentSchemaURL(XMLString::replicate(schemaURL))
       , fSchemaRootElement(root)
       , fNext(nextRoot)
  
  
  
  1.4       +7 -0      xml-xerces/c/src/validators/schema/SchemaAttDef.hpp
  
  Index: SchemaAttDef.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/SchemaAttDef.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SchemaAttDef.hpp	2001/05/11 17:17:41	1.3
  +++ SchemaAttDef.hpp	2001/07/31 15:26:54	1.4
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: SchemaAttDef.hpp,v $
  + * Revision 1.4  2001/07/31 15:26:54  knoaman
  + * Added support for <attributeGroup>.
  + *
    * Revision 1.3  2001/05/11 17:17:41  tng
    * Schema: DatatypeValidator fixes.  By Pei Yong Zhang.
    *
  @@ -105,6 +108,10 @@
           , const XMLAttDef::AttTypes              type
           , const XMLAttDef::DefAttTypes           defType
           , const XMLCh* const                     enumValues = 0
  +    );
  +    SchemaAttDef
  +    (
  +          const SchemaAttDef*                   other
       );
       ~SchemaAttDef();
   
  
  
  
  1.3       +16 -0     xml-xerces/c/src/validators/schema/SchemaAttDef.cpp
  
  Index: SchemaAttDef.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/SchemaAttDef.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SchemaAttDef.cpp	2001/05/11 13:27:33	1.2
  +++ SchemaAttDef.cpp	2001/07/31 15:26:54	1.3
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: SchemaAttDef.cpp,v $
  + * Revision 1.3  2001/07/31 15:26:54  knoaman
  + * Added support for <attributeGroup>.
  + *
    * Revision 1.2  2001/05/11 13:27:33  tng
    * Copyright update.
    *
  @@ -113,6 +116,19 @@
       , fElemId(XMLElementDecl::fgInvalidElemId)
   {
       fAttName = new QName(prefix, localPart, uriId);
  +}
  +
  +SchemaAttDef::SchemaAttDef(const SchemaAttDef* other) :
  +
  +    XMLAttDef(other->getValue(), other->getType(),
  +              other->getDefaultType(), other->getEnumeration())
  +    , fElemId(XMLElementDecl::fgInvalidElemId)
  +    , fAttName(0)
  +    , fDatatypeValidator(other->getDatatypeValidator())
  +{
  +    QName* otherName = other->getAttName();
  +    fAttName = new QName(otherName->getPrefix(), 
  +                         otherName->getLocalPart(), otherName->getURI());
   }
   
   SchemaAttDef::~SchemaAttDef()
  
  
  
  1.3       +12 -1     xml-xerces/c/src/validators/schema/NamespaceScope.hpp
  
  Index: NamespaceScope.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/NamespaceScope.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NamespaceScope.hpp	2001/05/11 13:27:33	1.2
  +++ NamespaceScope.hpp	2001/07/31 15:26:54	1.3
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: NamespaceScope.hpp,v 1.2 2001/05/11 13:27:33 tng Exp $
  + * $Id: NamespaceScope.hpp,v 1.3 2001/07/31 15:26:54 knoaman Exp $
    */
   
   #if !defined(NAMESPACESCOPE_HPP)
  @@ -122,6 +122,8 @@
                      const unsigned int uriId);
   
       unsigned int getNamespaceForPrefix(const XMLCh* const prefixToMap) const;
  +    unsigned int getNamespaceForPrefix(const XMLCh* const prefixToMap,
  +                                       int depthLevel) const;
   
   
       // -----------------------------------------------------------------------
  @@ -172,6 +174,15 @@
       StackElem**   fStack;
   };
   
  +
  +// ---------------------------------------------------------------------------
  +//  NamespaceScope: Stack access
  +// ---------------------------------------------------------------------------
  +inline unsigned int
  +NamespaceScope::getNamespaceForPrefix(const XMLCh* const prefixToMap) const {
  +
  +    return getNamespaceForPrefix(prefixToMap, (int)(fStackTop - 1));
  +}
   
   // ---------------------------------------------------------------------------
   //  NamespaceScope: Miscellaneous methods
  
  
  
  1.3       +6 -3      xml-xerces/c/src/validators/schema/NamespaceScope.cpp
  
  Index: NamespaceScope.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/NamespaceScope.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NamespaceScope.cpp	2001/05/11 13:27:33	1.2
  +++ NamespaceScope.cpp	2001/07/31 15:26:54	1.3
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: NamespaceScope.cpp,v $
  + * Revision 1.3  2001/07/31 15:26:54  knoaman
  + * Added support for <attributeGroup>.
  + *
    * Revision 1.2  2001/05/11 13:27:33  tng
    * Copyright update.
    *
  @@ -178,9 +181,9 @@
       curRow->fMapCount++;
   }
   
  -
   unsigned int
  -NamespaceScope::getNamespaceForPrefix(const XMLCh* const prefixToMap) const {
  +NamespaceScope::getNamespaceForPrefix(const XMLCh* const prefixToMap,
  +                                      const int depthLevel) const {
   
       //
       //  Map the prefix to its unique id, from the prefix string pool. If its
  @@ -196,7 +199,7 @@
       //  Start at the stack top and work backwards until we come to some
       //  element that mapped this prefix.
       //
  -    int startAt = (int)(fStackTop - 1);
  +    int startAt = depthLevel;
       for (int index = startAt; index >= 0; index--)
       {
           // Get a convenience pointer to the current element
  
  
  
  1.15      +5 -0      xml-xerces/c/src/validators/schema/Makefile.in
  
  Index: Makefile.in
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/Makefile.in,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Makefile.in	2001/07/24 20:13:30	1.14
  +++ Makefile.in	2001/07/31 15:26:54	1.15
  @@ -55,6 +55,9 @@
   #
   #
   # $Log: Makefile.in,v $
  +# Revision 1.15  2001/07/31 15:26:54  knoaman
  +# Added support for <attributeGroup>.
  +#
   # Revision 1.14  2001/07/24 20:13:30  knoaman
   # Added support for <group> + extra constraint checking for complexType
   #
  @@ -135,6 +138,7 @@
   	SchemaInfo.hpp \
   	GeneralAttributeCheck.hpp \
   	XercesGroupInfo.hpp \
  +	XercesAttGroupInfo.hpp \
   	TraverseSchema.hpp
   
   VALIDATORS_SCHEMA_CPP_PRIVHEADERS =
  @@ -155,6 +159,7 @@
   	SchemaInfo.$(TO) \
   	GeneralAttributeCheck.$(TO) \
   	XercesGroupInfo.$(TO) \
  +	XercesAttGroupInfo.$(TO) \
   	TraverseSchema.$(TO)
   
   all::	includes $(VALIDATORS_SCHEMA_CPP_OBJECTS)
  
  
  
  1.1                  xml-xerces/c/src/validators/schema/XercesAttGroupInfo.hpp
  
  Index: XercesAttGroupInfo.hpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 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) 2001, International
   * Business Machines, Inc., http://www.ibm.com .  For more information
   * on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  /*
   * $Id: XercesAttGroupInfo.hpp,v 1.1 2001/07/31 15:26:54 knoaman Exp $
   */
  
  #if !defined(XERCESATTGROUPINFO_HPP)
  #define XERCESATTGROUPINFO_HPP
  
  
  /**
    * The class act as a place holder to store attributeGroup information.
    *
    * The class is intended for internal use.
    */
  
  // ---------------------------------------------------------------------------
  //  Includes
  // ---------------------------------------------------------------------------
  #include <util/RefVectorOf.hpp>
  #include <validators/schema/SchemaAttDef.hpp>
  
  
  
  class VALIDATORS_EXPORT XercesAttGroupInfo
  {
  public:
      // -----------------------------------------------------------------------
      //  Public Constructors/Destructor
      // -----------------------------------------------------------------------
      XercesAttGroupInfo();
  	~XercesAttGroupInfo();
  
  	// -----------------------------------------------------------------------
      //  Getter methods
      // -----------------------------------------------------------------------
      unsigned int        attributeCount() const;
      unsigned int        anyAttributeCount() const; 
      SchemaAttDef*       attributeAt(const unsigned int index);
      const SchemaAttDef* attributeAt(const unsigned int index) const;
      SchemaAttDef*       anyAttributeAt(const unsigned int index);
      const SchemaAttDef* anyAttributeAt(const unsigned int index) const;
      
  	// -----------------------------------------------------------------------
      //  Setter methods
      // -----------------------------------------------------------------------
      void addAttDef(SchemaAttDef* const toAdd, const bool toClone = false);
      void addAnyAttDef(SchemaAttDef* const toAdd, const bool toClone = false);
  
  	// -----------------------------------------------------------------------
      //  Query methods
      // -----------------------------------------------------------------------
      bool containsAttribute(const XMLCh* const name, const unsigned int uri);
  
  private:
      // -----------------------------------------------------------------------
      //  Unimplemented contstructors and operators
      // -----------------------------------------------------------------------
      XercesAttGroupInfo(const XercesAttGroupInfo& elemInfo);
      XercesAttGroupInfo& operator= (const XercesAttGroupInfo& other);
  
      // -----------------------------------------------------------------------
      //  Private data members
      // -----------------------------------------------------------------------
      RefVectorOf<SchemaAttDef>* fAttributes;
      RefVectorOf<SchemaAttDef>* fAnyAttributes;
  };
  
  // ---------------------------------------------------------------------------
  //  XercesAttGroupInfo: Getter methods
  // ---------------------------------------------------------------------------
  inline unsigned int XercesAttGroupInfo::attributeCount() const {
  
      if (fAttributes) {
          return fAttributes->size();
      }
  
      return 0;
  }
  
  inline unsigned int XercesAttGroupInfo::anyAttributeCount() const {
  
      if (fAnyAttributes) {
          return fAnyAttributes->size();
      }
  
      return 0;
  }
  
  inline SchemaAttDef*
  XercesAttGroupInfo::attributeAt(const unsigned int index) {
  
      if (fAttributes) {
          return fAttributes->elementAt(index);
      }
  
      return 0;
  }
  
  inline const SchemaAttDef* 
  XercesAttGroupInfo::attributeAt(const unsigned int index) const {
  
      if (fAttributes) {
          return fAttributes->elementAt(index);
      }
  
      return 0;
  }
  
  inline SchemaAttDef*
  XercesAttGroupInfo::anyAttributeAt(const unsigned int index) {
  
      if (fAnyAttributes) {
          return fAnyAttributes->elementAt(index);
      }
  
      return 0;
  }
  
  inline const SchemaAttDef* 
  XercesAttGroupInfo::anyAttributeAt(const unsigned int index) const {
  
      if (fAnyAttributes) {
          return fAnyAttributes->elementAt(index);
      }
  
      return 0;
  }
  
  // ---------------------------------------------------------------------------
  //  XercesAttGroupInfo: Setter methods
  // ---------------------------------------------------------------------------
  inline void XercesAttGroupInfo::addAttDef(SchemaAttDef* const toAdd,
                                               const bool toClone) {
  
      if (!fAttributes) {
          fAttributes = new RefVectorOf<SchemaAttDef>(4);
      }
  
      if (toClone) {
          fAttributes->addElement(new SchemaAttDef(toAdd));
      }
      else {
          fAttributes->addElement(toAdd);
      }
  }
  
  inline void XercesAttGroupInfo::addAnyAttDef(SchemaAttDef* const toAdd,
                                                  const bool toClone) {
  
      if (!fAnyAttributes) {   
          fAnyAttributes = new RefVectorOf<SchemaAttDef>(2);
      }
  
      if (toClone) {
          fAnyAttributes->addElement(new SchemaAttDef(toAdd));
      }
      else {
          fAnyAttributes->addElement(toAdd);
      }
  }
  
  #endif
  
  /**
    * End of file XercesGroupInfo.hpp
    */
  
  
  
  
  1.1                  xml-xerces/c/src/validators/schema/XercesAttGroupInfo.cpp
  
  Index: XercesAttGroupInfo.cpp
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 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: XercesAttGroupInfo.cpp,v $
   * Revision 1.1  2001/07/31 15:26:54  knoaman
   * Added support for <attributeGroup>.
   *
   * Revision 1.1  2001/07/24 18:33:46  knoaman
   * Added support for <group> + extra constraint checking for complexType
   *
   */
  
  // ---------------------------------------------------------------------------
  //  Includes
  // ---------------------------------------------------------------------------
  #include <validators/schema/XercesAttGroupInfo.hpp>
  #include <util/QName.hpp>
  
  // ---------------------------------------------------------------------------
  //  XercesAttGroupInfo: Constructors and Destructor
  // ---------------------------------------------------------------------------
  XercesAttGroupInfo::XercesAttGroupInfo()
      : fAttributes(0)
      , fAnyAttributes(0)
  {
  
  }
  
  
  XercesAttGroupInfo::~XercesAttGroupInfo()
  {
      delete fAttributes;
      delete fAnyAttributes;
  }
  
  bool XercesAttGroupInfo::containsAttribute(const XMLCh* const name,
                                             const unsigned int uri) {
  
      if (fAttributes) {
  
          unsigned int attCount = fAttributes->size();
  
          if (attCount) {
  
              for (unsigned int i=0; i < attCount; i++) {
  
                  QName* attName = fAttributes->elementAt(i)->getAttName();
  
                  if (attName->getURI() == uri &&
                      !XMLString::compareString(attName->getLocalPart(),name)) {
                      return true;
                  }
              }
          }
      }
  
      return false;
  }
  
  /**
    * End of file XercesGroupInfo.cpp
    */
  
  
  
  
  

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