knoaman     2002/12/03 18:47:27

  Modified:    c/src/xercesc/internal Makefile.in
               c/src/xercesc/validators/DTD DTDGrammar.cpp DTDScanner.cpp
                        DTDScanner.hpp
               c/src/xercesc/validators/schema SchemaValidator.cpp
  Log:
  scanner re-organization.
  
  Revision  Changes    Path
  1.5       +9 -3      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Makefile.in       17 Sep 2002 21:23:19 -0000      1.4
  +++ Makefile.in       4 Dec 2002 02:47:24 -0000       1.5
  @@ -83,12 +83,15 @@
        ElemStack.hpp \
        EndOfEntityException.hpp \
        IANAEncodings.hpp \
  +     IGXMLScanner.hpp \
        ReaderMgr.hpp \
        VecAttrListImpl.hpp \
        VecAttributesImpl.hpp \
  +     WFXMLScanner.hpp \
        XMLInternalErrorHandler.hpp \
        XMLReader.hpp \
  -     XMLScanner.hpp
  +     XMLScanner.hpp \
  +     XMLScannerResolver.hpp
   
   INTERNAL_CPP_PRIVHEADERS =
   
  @@ -96,12 +99,15 @@
   
   INTERNAL_CPP_OBJECTS = \
        ElemStack.$(TO) \
  +     IGXMLScanner.$(TO) \
  +     IGXMLScanner2.$(TO) \
        ReaderMgr.$(TO) \
        VecAttrListImpl.$(TO) \
        VecAttributesImpl.$(TO) \
  +     WFXMLScanner.$(TO) \
        XMLReader.$(TO) \
        XMLScanner.$(TO) \
  -     XMLScanner2.$(TO)
  +     XMLScannerResolver.$(TO)
   
   all::        includes $(INTERNAL_CPP_OBJECTS)
   
  
  
  
  1.4       +8 -17     xml-xerces/c/src/xercesc/validators/DTD/DTDGrammar.cpp
  
  Index: DTDGrammar.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/DTD/DTDGrammar.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DTDGrammar.cpp    4 Nov 2002 14:50:40 -0000       1.3
  +++ DTDGrammar.cpp    4 Dec 2002 02:47:25 -0000       1.4
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.4  2002/12/04 02:47:25  knoaman
  + * scanner re-organization.
  + *
    * Revision 1.3  2002/11/04 14:50:40  tng
    * C++ Namespace Support.
    *
  @@ -89,18 +92,6 @@
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  -// ---------------------------------------------------------------------------
  -//  Local const data
  -//
  -//  These are the text for the require char refs that must always be present.
  -//  We init these into the entity pool upon construction.
  -// ---------------------------------------------------------------------------
  -static const XMLCh gAmp[] = { chLatin_a, chLatin_m, chLatin_p, chNull };
  -static const XMLCh gLT[] = { chLatin_l, chLatin_t, chNull };
  -static const XMLCh gGT[] = { chLatin_g, chLatin_t, chNull };
  -static const XMLCh gQuot[] = { chLatin_q, chLatin_u, chLatin_o, chLatin_t, chNull };
  -static const XMLCh gApos[] = { chLatin_a, chLatin_p, chLatin_o, chLatin_s, chNull };
  -
   //---------------------------------------------------------------------------
   //  DTDGrammar: Constructors and Destructor
   // ---------------------------------------------------------------------------
  @@ -204,11 +195,11 @@
       //  We also mark them as special char entities, which allows them to be
       //  used in places whether other non-numeric general entities cannot.
       //
  -    fEntityDeclPool->put(new DTDEntityDecl(gAmp, chAmpersand, true, true));
  -    fEntityDeclPool->put(new DTDEntityDecl(gLT, chOpenAngle, true, true));
  -    fEntityDeclPool->put(new DTDEntityDecl(gGT, chCloseAngle, true, true));
  -    fEntityDeclPool->put(new DTDEntityDecl(gQuot, chDoubleQuote, true, true));
  -    fEntityDeclPool->put(new DTDEntityDecl(gApos, chSingleQuote, true, true));
  +    fEntityDeclPool->put(new DTDEntityDecl(XMLUni::fgAmp, chAmpersand, true, true));
  +    fEntityDeclPool->put(new DTDEntityDecl(XMLUni::fgLT, chOpenAngle, true, true));
  +    fEntityDeclPool->put(new DTDEntityDecl(XMLUni::fgGT, chCloseAngle, true, true));
  +    fEntityDeclPool->put(new DTDEntityDecl(XMLUni::fgQuot, chDoubleQuote, true, 
true));
  +    fEntityDeclPool->put(new DTDEntityDecl(XMLUni::fgApos, chSingleQuote, true, 
true));
   }
   
   XERCES_CPP_NAMESPACE_END
  
  
  
  1.17      +26 -0     xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.cpp
  
  Index: DTDScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- DTDScanner.cpp    14 Nov 2002 22:34:11 -0000      1.16
  +++ DTDScanner.cpp    4 Dec 2002 02:47:25 -0000       1.17
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.17  2002/12/04 02:47:25  knoaman
  + * scanner re-organization.
  + *
    * Revision 1.16  2002/11/14 22:34:11  tng
    * [Bug 14265] Access violation with Null systemId/publicId in DTDScanner
    *
  @@ -203,6 +206,7 @@
   #include <xercesc/sax/InputSource.hpp>
   #include <xercesc/framework/XMLDocumentHandler.hpp>
   #include <xercesc/framework/XMLEntityHandler.hpp>
  +#include <xercesc/framework/XMLValidator.hpp>
   #include <xercesc/internal/EndOfEntityException.hpp>
   #include <xercesc/internal/XMLScanner.hpp>
   #include <xercesc/validators/common/ContentSpecNode.hpp>
  @@ -211,6 +215,7 @@
   #include <xercesc/validators/DTD/DocTypeHandler.hpp>
   #include <xercesc/validators/DTD/DTDScanner.hpp>
   
  +
   XERCES_CPP_NAMESPACE_BEGIN
   
   // ---------------------------------------------------------------------------
  @@ -280,6 +285,27 @@
       delete fDumEntityDecl;
       delete fPEntityDeclPool;
   }
  +
  +// -----------------------------------------------------------------------
  +//  Setter methods
  +// -----------------------------------------------------------------------
  +void DTDScanner::setScannerInfo(XMLScanner* const      owningScanner
  +                            , ReaderMgr* const      readerMgr
  +                            , XMLBufferMgr* const   bufMgr)
  +{
  +    // We don't own any of these, we just reference them
  +    fScanner = owningScanner;
  +    fReaderMgr = readerMgr;
  +    fBufMgr = bufMgr;
  +
  +    if (fScanner->getDoNamespaces())
  +        fEmptyNamespaceId = fScanner->getEmptyNamespaceId();
  +    else
  +        fEmptyNamespaceId = 0;
  +
  +    fDocTypeReaderId = fReaderMgr->getCurrentReaderNum();
  +}
  +
   
   // ---------------------------------------------------------------------------
   //  DTDScanner: Private scanning methods
  
  
  
  1.5       +5 -21     xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.hpp
  
  Index: DTDScanner.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.hpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DTDScanner.hpp    4 Nov 2002 14:50:40 -0000       1.4
  +++ DTDScanner.hpp    4 Dec 2002 02:47:25 -0000       1.5
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.5  2002/12/04 02:47:25  knoaman
  + * scanner re-organization.
  + *
    * Revision 1.4  2002/11/04 14:50:40  tng
    * C++ Namespace Support.
    *
  @@ -92,6 +95,8 @@
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  +class XMLScanner;
  +
   /*
    * Default implementation of an XML DTD scanner.
    */
  @@ -314,27 +319,6 @@
   inline void DTDScanner::setDocTypeHandler(DocTypeHandler* const handlerToSet)
   {
       fDocTypeHandler = handlerToSet;
  -}
  -
  -
  -// -----------------------------------------------------------------------
  -//  Setter methods
  -// -----------------------------------------------------------------------
  -inline void DTDScanner::setScannerInfo(XMLScanner* const      owningScanner
  -                            , ReaderMgr* const      readerMgr
  -                            , XMLBufferMgr* const   bufMgr)
  -{
  -    // We don't own any of these, we just reference them
  -    fScanner = owningScanner;
  -    fReaderMgr = readerMgr;
  -    fBufMgr = bufMgr;
  -
  -    if (fScanner->getDoNamespaces())
  -        fEmptyNamespaceId = fScanner->getEmptyNamespaceId();
  -    else
  -        fEmptyNamespaceId = 0;
  -
  -    fDocTypeReaderId = fReaderMgr->getCurrentReaderNum();
   }
   
   // -----------------------------------------------------------------------
  
  
  
  1.22      +11 -9     xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp
  
  Index: SchemaValidator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- SchemaValidator.cpp       27 Nov 2002 22:15:42 -0000      1.21
  +++ SchemaValidator.cpp       4 Dec 2002 02:47:26 -0000       1.22
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.22  2002/12/04 02:47:26  knoaman
  + * scanner re-organization.
  + *
    * Revision 1.21  2002/11/27 22:15:42  peiyongz
    * Schema Errat E2-24 Duration 'T': allow to catch SchemaDateTimeException
    *
  @@ -212,6 +215,7 @@
   #include <xercesc/framework/XMLDocumentHandler.hpp>
   #include <xercesc/internal/XMLReader.hpp>
   #include <xercesc/internal/XMLScanner.hpp>
  +#include <xercesc/internal/ElemStack.hpp>
   #include <xercesc/validators/datatype/DatatypeValidatorFactory.hpp>
   #include <xercesc/validators/datatype/ListDatatypeValidator.hpp>
   #include <xercesc/validators/datatype/UnionDatatypeValidator.hpp>
  @@ -417,12 +421,11 @@
                           //  the notation pool (after the Grammar is parsed), then 
obviously
                           //  this value will be legal since it matches one of them.
                           //
  -                        XMLBuffer nameBuf(XMLString::stringLen(value)+1);
  -                        XMLBuffer prefixBuf(XMLString::stringLen(value)+1);
  -                        unsigned int uriId = getScanner()->resolveQName(value, 
nameBuf, prefixBuf, ElemStack::Mode_Element);
  +                        int colonPos = -1;
  +                        unsigned int uriId = getScanner()->resolveQName(value, 
notationBuf, ElemStack::Mode_Element, colonPos);
                           notationBuf.set(getScanner()->getURIText(uriId));
                           notationBuf.append(chColon);
  -                        notationBuf.append(nameBuf.getRawBuffer());
  +                        notationBuf.append(&value[colonPos + 1]);
                           value = notationBuf.getRawBuffer();
                       }
   
  @@ -474,7 +477,7 @@
                               fCurrentDV->validate(value);
                       }
                   }
  -            }
  +            } 
               catch (XMLException& idve) {
                   emitError (XMLValid::DatatypeError, idve.getType(), 
idve.getMessage());
               }
  @@ -647,13 +650,12 @@
                   //  the notation pool (after the Grammar is parsed), then obviously
                   //  this value will be legal since it matches one of them.
                   //
  -                XMLBuffer nameBuf(XMLString::stringLen(attrValue)+1);
  -                XMLBuffer prefixBuf(XMLString::stringLen(attrValue)+1);
                   XMLBuffer notationBuf;
  -                unsigned int uriId = getScanner()->resolveQName(attrValue, nameBuf, 
prefixBuf, ElemStack::Mode_Element);
  +                int colonPos = -1;
  +                unsigned int uriId = getScanner()->resolveQName(attrValue, 
notationBuf, ElemStack::Mode_Element, colonPos);
                   notationBuf.set(getScanner()->getURIText(uriId));
                   notationBuf.append(chColon);
  -                notationBuf.append(nameBuf.getRawBuffer());
  +                notationBuf.append(&attrValue[colonPos + 1]);
   
                   attDefDV->validate(notationBuf.getRawBuffer());
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to