Changeset 3157


Ignore:
Timestamp:
May 19, 2013, 9:20:51 AM (6 years ago)
Author:
cameron
Message:

Fixes for icXML 0.9

Location:
icXML/icXML-devel/src
Files:
1 deleted
47 edited

Legend:

Unmodified
Added
Removed
  • icXML/icXML-devel/src/Makefile.am

    r3153 r3157  
    198198        icxmlc/XMLWhitespaceNormalizer.hpp \
    199199        icxmlc/MemoryPool.hpp \
    200         icxmlc/XMLSynchronizedNamespaceResolver.hpp \
    201200        icxmlc/XMLEntityParserImpl.hpp \
    202201        icxmlc/XMLParallelTokenizer.hpp \
     
    465464        icxercesc/framework/XMLAttr.hpp \
    466465        icxercesc/framework/XMLBuffer.hpp \
    467         xercesc/framework/XMLBufferMgr.hpp \
     466        icxercesc/framework/XMLBufferMgr.hpp \
    468467        icxercesc/framework/XMLContentModel.hpp \
    469468        icxercesc/framework/XMLDocumentHandler.hpp \
     
    525524        icxercesc/framework/XMLAttr.cpp \
    526525        icxercesc/framework/XMLBuffer.cpp \
    527         xercesc/framework/XMLBufferMgr.cpp \
     526        icxercesc/framework/XMLBufferMgr.cpp \
    528527        xercesc/framework/XMLContentModel.cpp \
    529528        xercesc/framework/XMLDTDDescription.cpp \
  • icXML/icXML-devel/src/Makefile.in

    r3153 r3157  
    317317        icxercesc/framework/XMLAttr.cpp \
    318318        icxercesc/framework/XMLBuffer.cpp \
    319         xercesc/framework/XMLBufferMgr.cpp \
     319        icxercesc/framework/XMLBufferMgr.cpp \
    320320        xercesc/framework/XMLContentModel.cpp \
    321321        xercesc/framework/XMLDTDDescription.cpp \
     
    613613        icxercesc/framework/XMLAttr.lo \
    614614        icxercesc/framework/XMLBuffer.lo \
    615         xercesc/framework/XMLBufferMgr.lo \
     615        icxercesc/framework/XMLBufferMgr.lo \
    616616        xercesc/framework/XMLContentModel.lo \
    617617        xercesc/framework/XMLDTDDescription.lo \
     
    10741074        icxercesc/framework/XMLAttr.hpp \
    10751075        icxercesc/framework/XMLBuffer.hpp \
    1076         xercesc/framework/XMLBufferMgr.hpp \
     1076        icxercesc/framework/XMLBufferMgr.hpp \
    10771077        icxercesc/framework/XMLContentModel.hpp \
    10781078        icxercesc/framework/XMLDocumentHandler.hpp \
     
    12421242        icxmlc/XMLReferenceTable.hpp icxmlc/XMLReplacementText.hpp \
    12431243        icxmlc/XMLWhitespaceNormalizer.hpp icxmlc/MemoryPool.hpp \
    1244         icxmlc/XMLSynchronizedNamespaceResolver.hpp \
    12451244        icxmlc/XMLEntityParserImpl.hpp icxmlc/XMLParallelTokenizer.hpp \
    12461245        icxmlc/XMLParserImpl.hpp icxmlc/Array.hpp \
     
    15351534        icxmlc/XMLWhitespaceNormalizer.hpp \
    15361535        icxmlc/MemoryPool.hpp \
    1537         icxmlc/XMLSynchronizedNamespaceResolver.hpp \
    15381536        icxmlc/XMLEntityParserImpl.hpp \
    15391537        icxmlc/XMLParallelTokenizer.hpp \
     
    18001798        icxercesc/framework/XMLAttr.hpp \
    18011799        icxercesc/framework/XMLBuffer.hpp \
    1802         xercesc/framework/XMLBufferMgr.hpp \
     1800        icxercesc/framework/XMLBufferMgr.hpp \
    18031801        icxercesc/framework/XMLContentModel.hpp \
    18041802        icxercesc/framework/XMLDocumentHandler.hpp \
     
    18601858        icxercesc/framework/XMLAttr.cpp \
    18611859        icxercesc/framework/XMLBuffer.cpp \
    1862         xercesc/framework/XMLBufferMgr.cpp \
     1860        icxercesc/framework/XMLBufferMgr.cpp \
    18631861        xercesc/framework/XMLContentModel.cpp \
    18641862        xercesc/framework/XMLDTDDescription.cpp \
     
    30323030icxercesc/framework/XMLBuffer.lo: icxercesc/framework/$(am__dirstamp) \
    30333031        icxercesc/framework/$(DEPDIR)/$(am__dirstamp)
    3034 xercesc/framework/XMLBufferMgr.lo: xercesc/framework/$(am__dirstamp) \
    3035         xercesc/framework/$(DEPDIR)/$(am__dirstamp)
     3032icxercesc/framework/XMLBufferMgr.lo:  \
     3033        icxercesc/framework/$(am__dirstamp) \
     3034        icxercesc/framework/$(DEPDIR)/$(am__dirstamp)
    30363035xercesc/framework/XMLContentModel.lo:  \
    30373036        xercesc/framework/$(am__dirstamp) \
     
    37113710        -rm -f icxercesc/framework/XMLBuffer.$(OBJEXT)
    37123711        -rm -f icxercesc/framework/XMLBuffer.lo
     3712        -rm -f icxercesc/framework/XMLBufferMgr.$(OBJEXT)
     3713        -rm -f icxercesc/framework/XMLBufferMgr.lo
    37133714        -rm -f icxercesc/framework/XMLElementDecl.$(OBJEXT)
    37143715        -rm -f icxercesc/framework/XMLElementDecl.lo
     
    39653966        -rm -f xercesc/framework/XMLAttDefList.$(OBJEXT)
    39663967        -rm -f xercesc/framework/XMLAttDefList.lo
    3967         -rm -f xercesc/framework/XMLBufferMgr.$(OBJEXT)
    3968         -rm -f xercesc/framework/XMLBufferMgr.lo
    39693968        -rm -f xercesc/framework/XMLContentModel.$(OBJEXT)
    39703969        -rm -f xercesc/framework/XMLContentModel.lo
     
    43574356@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/framework/$(DEPDIR)/XMLAttr.Plo@am__quote@
    43584357@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/framework/$(DEPDIR)/XMLBuffer.Plo@am__quote@
     4358@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/framework/$(DEPDIR)/XMLBufferMgr.Plo@am__quote@
    43594359@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/framework/$(DEPDIR)/XMLElementDecl.Plo@am__quote@
    43604360@AMDEP_TRUE@@am__include@ @am__quote@icxercesc/framework/$(DEPDIR)/XMLGrammarPoolImpl.Plo@am__quote@
     
    44844484@AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/Wrapper4InputSource.Plo@am__quote@
    44854485@AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLAttDefList.Plo@am__quote@
    4486 @AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLBufferMgr.Plo@am__quote@
    44874486@AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLContentModel.Plo@am__quote@
    44884487@AMDEP_TRUE@@am__include@ @am__quote@xercesc/framework/$(DEPDIR)/XMLDTDDescription.Plo@am__quote@
  • icXML/icXML-devel/src/icxercesc/framework/XMLBuffer.cpp

    r2721 r3157  
    8585}
    8686
     87void XMLBuffer::set(const XMLCh* const chars)
     88{
     89    fIndex = 0;
     90    if (chars != 0 && *chars != 0)
     91        append(chars);
     92}
     93
    8794XERCES_CPP_NAMESPACE_END
    8895
  • icXML/icXML-devel/src/icxercesc/framework/XMLBuffer.hpp

    r3103 r3157  
    174174        }
    175175
    176         void set (const XMLCh* const chars)
    177         {
    178                 fIndex = 0;
    179                 if (chars != 0 && *chars != 0)
    180                         append(chars);
    181         }
     176    void set (const XMLCh* const chars);
    182177
    183178    void set (const XMLCh ch)
  • icXML/icXML-devel/src/icxercesc/framework/XMLDocumentHandler.hpp

    r3104 r3157  
    262262
    263263        //@}
    264 
    265     virtual ContentHandler* getContentHandler() const
    266     {
    267         return 0;
    268     }
    269 
    270264protected :
    271265        // -----------------------------------------------------------------------
     
    283277        XMLDocumentHandler(const XMLDocumentHandler&);
    284278        XMLDocumentHandler& operator=(const XMLDocumentHandler&);
    285 
    286 protected:
    287 
    288     gid_t                               fNamespaceContextId;
    289279};
    290280
  • icXML/icXML-devel/src/icxercesc/framework/XMLElementDecl.cpp

    r3153 r3157  
    8888, fCreateReason(XMLElementDecl::NoReason)
    8989, fId(XMLElementDecl::fgInvalidElemId)
     90, fUriId(0)
     91, fNamespaceContextId(0)
    9092, fExternalElement(false)
    9193{
  • icXML/icXML-devel/src/icxercesc/framework/XMLElementDecl.hpp

    r3150 r3157  
    406406        void setExternalElemDeclaration(const bool aValue);
    407407
     408
     409    unsigned int getNamespaceContextId() const;
     410
    408411        //@}
    409412
     
    481484        XMLSize_t           fId;
    482485        unsigned int            fUriId;
     486    unsigned int        fNamespaceContextId;
    483487        bool                fExternalElement;
    484488};
     
    555559{
    556560        return fExternalElement;
     561}
     562
     563inline unsigned int XMLElementDecl::getNamespaceContextId() const
     564{
     565    return fNamespaceContextId;
    557566}
    558567
  • icXML/icXML-devel/src/icxercesc/internal/IGXMLScanner.cpp

    r3153 r3157  
    378378        // create pools for undeclared elements
    379379        fDTDElemNonDeclPool = new (fMemoryManager) NameIdPool<DTDElementDecl>(29, 128, fMemoryManager);
    380         fSchemaElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool<SchemaElementDecl>(29, false, 128, fMemoryManager);
     380    fSchemaElemNonDeclPool = new (fMemoryManager) RefHash3KeysIdPool<SchemaElementDecl>(29, true, 128, fMemoryManager);
    381381        fPSVIAttrList = new (fMemoryManager) PSVIAttributeList(fMemoryManager);
    382382
  • icXML/icXML-devel/src/icxercesc/internal/IGXMLScanner2.cpp

    r3153 r3157  
    136136
    137137        // Reset the Root Element Name
    138         fRootElemName = 0;
     138    setRootElemName(0);
    139139
    140140        // Reset IdentityConstraints
  • icXML/icXML-devel/src/icxercesc/internal/SGXMLScanner.cpp

    r3153 r3157  
    33063306
    33073307        // Reset the Root Element Name
    3308         fRootElemName = 0;
     3308    setRootElemName(0);
    33093309
    33103310        // Reset IdentityConstraints
  • icXML/icXML-devel/src/icxercesc/internal/WFXMLScanner.cpp

    r3150 r3157  
    4646)
    4747: XMLScanner(valToAdopt, grammarResolver, manager)
    48 , fElementList(32, manager, true)
     48, fElements(32, true, manager)
    4949{
    5050        CleanupType cleanup(this, &WFXMLScanner::cleanUp);
     
    7777)
    7878: XMLScanner(docHandler, docTypeHandler, entityHandler, errHandler, valToAdopt, grammarResolver, manager)
    79 , fElementList(32, manager, true)
     79, fElements(32, true, manager)
    8080{
    8181        CleanupType cleanup(this, &WFXMLScanner::cleanUp);
  • icXML/icXML-devel/src/icxercesc/internal/WFXMLScanner.hpp

    r3150 r3157  
    274274        // -----------------------------------------------------------------------
    275275
    276     ValueVectorOf<DTDElementDecl*>      fElementList;
     276    RefVectorOf<XMLElementDecl>      fElements;
    277277};
    278278
     
    331331    {
    332332        elemDecl = new (fGrammarPoolMemoryManager) DTDElementDecl(element.getQName(), DTDElementDecl::Any, fGrammarPoolMemoryManager);
    333         fElementList.addElement(elemDecl);
     333        fElements.addElement((XMLElementDecl*)elemDecl);
    334334        element.setElemDecl(elemDecl);
    335335    }
  • icXML/icXML-devel/src/icxercesc/internal/XMLReader.cpp

    r3150 r3157  
    12291229                                // Eat this char
    12301230                                fCharIndex++;
    1231                 handleEOL(curCh, false);
     1231                (curCh, false);
    12321232                                // Ok we can add this guy to our buffer
    12331233                                toFill.append(curCh);
     
    16341634}
    16351635
     1636void XMLReader::handleEOL(XMLCh & curCh, bool inDecl)
     1637{
     1638    // Handle line/col tracking for any character-at-a-time parsing modes.
     1639    if (unlikely(inDecl))
     1640    {
     1641        if (unlikely(curCh == chNEL || curCh == chLineSeparator))
     1642        {
     1643            /***
     1644             * XML1.1
     1645             *
     1646             * 2.11 End-of-Line Handling
     1647             *  ...
     1648             *   The characters #x85 and #x2028 cannot be reliably recognized and translated
     1649             *   until an entity's encoding declaration (if present) has been read.
     1650             *   Therefore, it is a fatal error to use them within the XML declaration or
     1651             *   text declaration.
     1652             *
     1653             ***/
     1654            ThrowXMLwithMemMgr1(TranscodingException, XMLExcepts::Reader_NelLsepinDecl, fSystemId, fMemoryManager);
     1655        }
     1656    }
     1657
     1658    if (unlikely(curCh == chLF))
     1659    {
     1660        fCurCol = 1;
     1661        fCurLine++;
     1662    }
     1663    else
     1664    {
     1665        fCurCol++;
     1666    }
     1667}
     1668
    16361669// -----------------------------------------------------------------------
    16371670// DEPRECATED FUNCTIONS KEPT FOR DLL COMPATIBILITY
  • icXML/icXML-devel/src/icxercesc/internal/XMLReader.hpp

    r3150 r3157  
    837837}
    838838
    839 inline void XMLReader::handleEOL(XMLCh & curCh, bool inDecl)
    840 {
    841     // Handle line/col tracking for any character-at-a-time parsing modes.
    842     if (unlikely(inDecl))
    843     {
    844         if (curCh == chNEL || curCh == chLineSeparator)
    845         {
    846             /***
    847              * XML1.1
    848              *
    849              * 2.11 End-of-Line Handling
    850              *  ...
    851              *   The characters #x85 and #x2028 cannot be reliably recognized and translated
    852              *   until an entity's encoding declaration (if present) has been read.
    853              *   Therefore, it is a fatal error to use them within the XML declaration or
    854              *   text declaration.
    855              *
    856              ***/
    857             ThrowXMLwithMemMgr1
    858             (
    859                 TranscodingException
    860                 , XMLExcepts::Reader_NelLsepinDecl
    861                 , fSystemId
    862                 , fMemoryManager
    863             );
    864         }
    865     }
    866 
    867     if (unlikely(curCh == chLF))
    868     {
    869         fCurCol = 1;
    870         fCurLine++;
    871     }
    872     else
    873     {
    874         fCurCol++;
    875     }
    876 }
    877 
    878839inline XMLSize_t XMLReader::calculateRawBufIndex()
    879840{
  • icXML/icXML-devel/src/icxercesc/internal/XMLScanner.cpp

    r3150 r3157  
    314314                        }
    315315                }
    316                 else {
    317 
     316        else
     317        {
    318318                        if (!fStandardUriConformant)
    319319                                srcToUse = new (fMemoryManager) LocalFileInputSource(systemId, fMemoryManager);
     
    681681void XMLScanner::cleanUp()
    682682{
    683         delete fValidationContext;
    684         fMemoryManager->deallocate(fExternalSchemaLocation);
    685         fMemoryManager->deallocate(fExternalNoNamespaceSchemaLocation);
    686     fMemoryManager->deallocate(fRootElemName);
     683    delete fValidationContext; fValidationContext = 0;
     684    fMemoryManager->deallocate(fExternalSchemaLocation); fExternalSchemaLocation = 0;
     685    fMemoryManager->deallocate(fExternalNoNamespaceSchemaLocation); fExternalNoNamespaceSchemaLocation = 0;
     686    fMemoryManager->deallocate(fRootElemName); fRootElemName = 0;
    687687}
    688688
     
    19381938
    19391939                // Watch for EOF
    1940                 if (!nextCh)
     1940        if (unlikely(nextCh == 0))
     1941        {
    19411942                        ThrowXMLwithMemMgr(UnexpectedEOFException, XMLExcepts::Gen_UnexpectedEOF, fMemoryManager);
    1942 
     1943        }
    19431944                // Break out on the terminating semicolon
    19441945                if (nextCh == chSemiColon)
     
    20272028}
    20282029
     2030const XMLCh* XMLScanner::getURIText(const unsigned int uriId) const
     2031{
     2032    return (*fUriResolver)[uriId];
     2033}
     2034
    20292035//  Most equal signs can have white space around them, so this little guy
    20302036//  just makes the calling code cleaner by eating whitespace.
     
    20682074}
    20692075
    2070 
    2071 
    2072 unsigned int
    2073 XMLScanner::resolveQName(  const XMLCh* const           qName
    2074                                                  ,       XMLBuffer&             prefixBuf
    2075                                                  , const ElemStack::MapModes    mode
    2076                                                  ,       int&                   prefixColonPos)
    2077 {
    2078         DEPRECATED_FEATURE_IN_ICXML;
    2079 }
    2080 
    2081 unsigned int
    2082 XMLScanner::resolveQNameWithColon(  const XMLCh* const          qName
    2083                                                                   ,       XMLBuffer&            prefixBuf
    2084                                                                   , const ElemStack::MapModes   mode
    2085                                                                   , const int                   prefixColonPos)
    2086 {
    2087         DEPRECATED_FEATURE_IN_ICXML;
    2088 }
    2089 
    2090 // ---------------------------------------------------------------------------
    2091 //  XMLScanner: Private scanning methods
    2092 // ---------------------------------------------------------------------------
    2093 
    2094 //  This method is called after the end of the root element, to handle
    2095 //  any miscellaneous stuff hanging around.
    2096 void XMLScanner::scanMiscellaneous()
    2097 {
    2098         DEPRECATED_FEATURE_IN_ICXML;
    2099 }
    2100 
    21012076/******************************************************************************************************
    21022077  ICXML - DEPRECATED FUNCTIONS
     
    21422117}
    21432118
     2119unsigned int XMLScanner::resolveQName(const XMLCh* const, XMLBuffer& , const ElemStack::MapModes, int&)
     2120{
     2121    DEPRECATED_FEATURE_IN_ICXML;
     2122}
     2123
     2124unsigned int XMLScanner::resolveQNameWithColon(const XMLCh* const, XMLBuffer&, const ElemStack::MapModes, const int)
     2125{
     2126    DEPRECATED_FEATURE_IN_ICXML;
     2127}
     2128
     2129void XMLScanner::scanMiscellaneous()
     2130{
     2131    DEPRECATED_FEATURE_IN_ICXML;
     2132}
    21442133
    21452134XERCES_CPP_NAMESPACE_END
  • icXML/icXML-devel/src/icxercesc/internal/XMLScanner.hpp

    r3150 r3157  
    2323#define XERCESC_INCLUDE_GUARD_XMLSCANNER_HPP
    2424
    25 #include <xercesc/framework/XMLBufferMgr.hpp>
     25#include <icxercesc/framework/XMLBufferMgr.hpp>
    2626#include <xercesc/framework/XMLErrorCodes.hpp>
    2727#include <xercesc/framework/XMLRefInfo.hpp>
     
    6565class XMLElementDecl;
    6666class XMLReferenceTable;
     67class SAXParser;
     68class SAX2XMLReaderImpl;
     69class AbstractDOMParser;
    6770
    6871
     
    427430        void setHandleMultipleImports(const bool newValue);
    428431
     432
    429433        // -----------------------------------------------------------------------
    430434        //  Mutator methods
     
    442446                const   XMLCh* const    systemId
    443447        );
     448
    444449        void scanDocument
    445450        (
     
    452457                ,       XMLPScanToken&  toFill
    453458        );
     459
    454460        bool scanFirst
    455461        (
     
    457463                ,       XMLPScanToken&  toFill
    458464        );
     465
    459466        bool scanFirst
    460467        (
     
    15701577}
    15711578
    1572 inline const XMLCh* XMLScanner::getURIText(const unsigned int uriId) const
    1573 {
    1574     return (*fUriResolver)[uriId];
    1575 }
    1576 
    15771579inline unsigned int XMLScanner::getURIIdForPrefix(const XMLCh* prefix) const
    15781580{
  • icXML/icXML-devel/src/icxercesc/internal/XSAXMLScanner.cpp

    r3104 r3157  
    551551
    552552        // Reset the Root Element Name
    553         fRootElemName = 0;
     553    setRootElemName(0);
    554554
    555555        // Reset some status flags
  • icXML/icXML-devel/src/icxercesc/parsers/AbstractDOMParser.hpp

    r3104 r3157  
    3232#include <xercesc/dom/DOMDocumentType.hpp>
    3333#include <icxercesc/validators/DTD/DTDElementDecl.hpp>
    34 #include <xercesc/framework/XMLBufferMgr.hpp>
     34#include <icxercesc/framework/XMLBufferMgr.hpp>
    3535#include <xercesc/framework/psvi/PSVIHandler.hpp>
    3636#include <icxmlc/XMLConfig.hpp>
     
    14611461
    14621462        //@}
    1463 
    14641463
    14651464        // -----------------------------------------------------------------------
  • icXML/icXML-devel/src/icxercesc/parsers/SAX2XMLReaderImpl.cpp

    r3103 r3157  
    7777        , fAdvDHListSize(32)
    7878        , fDocHandler(0)
    79     , fLastNamespaceContextId(0)
     79    , fNamespaceContextId(0)
    8080    , fDTDHandler(0)
    8181        , fEntityResolver(0)
     
    140140        setDoSchema(true);
    141141
    142     fNamespaceContextId = -1;
     142    fNamespaceContextId = 0;
    143143}
    144144
     
    683683        const XMLCh * elemUri = XMLUni::fgZeroLenString;
    684684
    685         bool modifiedNamespace = 0;
    686         gid_t lastNamespaceContextId = 0;
    687 
    688685                if (getDoNamespaces())
    689686                {
    690             modifiedNamespace = (this->fNamespaceContextId != fLastNamespaceContextId);
    691 
    692 
    693 
    694             if (unlikely(modifiedNamespace))
     687            if (unlikely(elemDecl.getNamespaceContextId() != fNamespaceContextId))
    695688            {
    696689                const XMLNamespaceResolver * resolver = fScanner->getUriResolver();
    697                 MaskedBindingSetIterator itr = resolver->getNamespaceIterator(fNamespaceContextId, fLastNamespaceContextId);
     690                MaskedBindingSetIterator itr = resolver->getNamespaceIterator(elemDecl.getNamespaceContextId(), fNamespaceContextId);
    698691                while (itr.next())
    699692                {
     
    702695                    fDocHandler->startPrefixMapping(prefix, uri);
    703696                }
    704 
    705                 lastNamespaceContextId = fLastNamespaceContextId;
    706                 fLastNamespaceContextId = fNamespaceContextId;
    707697
    708698                if (unlikely(attrCount > fNamespaceAttrList.fMaxCount))
     
    722712                }
    723713
    724 
    725 
    726714                fNamespaceAttrList.fCurCount = namespaceAttrCount;
    727715                fAttrList.setVector(&fNamespaceAttrList, namespaceAttrCount, fScanner);
     
    755743
    756744                        // call endPrefixMapping appropriately.
    757             if (modifiedNamespace)
     745            if (unlikely(elemDecl.getNamespaceContextId() != fNamespaceContextId))
    758746                        {
    759747                const XMLNamespaceResolver * resolver = fScanner->getUriResolver();
    760                 MaskedBindingSetIterator itr = resolver->getNamespaceIterator(fNamespaceContextId, lastNamespaceContextId);
     748                MaskedBindingSetIterator itr = resolver->getNamespaceIterator(fNamespaceContextId, elemDecl.getNamespaceContextId());
    761749                while (itr.next())
    762750                {
     
    764752                    fDocHandler->endPrefixMapping(prefix);
    765753                }
    766                 fLastNamespaceContextId = lastNamespaceContextId;
    767754                        }
    768755                }
    769756
    770 
     757        fNamespaceContextId = elemDecl.getNamespaceContextId();
    771758    }
    772759
     
    814801                {
    815802            fDocHandler->endElement(fScanner->getURIText(uriId), baseName, elemQName);
    816             if (unlikely(fNamespaceContextId != fLastNamespaceContextId))
     803            if (unlikely(elemDecl.getNamespaceContextId() != fNamespaceContextId))
    817804            {
    818805                const XMLNamespaceResolver * resolver = fScanner->getUriResolver();
    819                 MaskedBindingSetIterator itr = resolver->getNamespaceIterator(fLastNamespaceContextId, fNamespaceContextId);
     806                MaskedBindingSetIterator itr = resolver->getNamespaceIterator(fNamespaceContextId, elemDecl.getNamespaceContextId());
    820807                while (itr.next())
    821808                {
     
    823810                    fDocHandler->endPrefixMapping(prefix);
    824811                }
    825                 fLastNamespaceContextId = fNamespaceContextId;
     812                fNamespaceContextId = elemDecl.getNamespaceContextId();
    826813            }
    827 
    828814        }
    829815                else
  • icXML/icXML-devel/src/icxercesc/parsers/SAX2XMLReaderImpl.hpp

    r3103 r3157  
    9191        /** @name Implementation of SAX 2.0 XMLReader interface's. */
    9292        //@{
    93 
    94         /**
    95           * This method returns the installed content handler.
    96           *
    97           * @return A pointer to the installed content handler object.
    98           */
    99     virtual ContentHandler* getContentHandler() const;
    10093
    10194        /**
     
    16471640    VecAttributesImpl           fAttrList;
    16481641    ContentHandler*             fDocHandler;
    1649     gid_t                       fLastNamespaceContextId;
     1642    unsigned int                fNamespaceContextId;
    16501643        DTDHandler*                 fDTDHandler;
    16511644        EntityResolver*             fEntityResolver;
     
    16761669//  SAX2XMLReader: Getter methods
    16771670// ---------------------------------------------------------------------------
    1678 inline ContentHandler* SAX2XMLReaderImpl::getContentHandler() const
    1679 {
    1680         return fDocHandler;
    1681 }
    1682 
    16831671inline DTDHandler* SAX2XMLReaderImpl::getDTDHandler() const
    16841672{
  • icXML/icXML-devel/src/icxercesc/parsers/SAXParser.cpp

    r2721 r3157  
    122122void SAXParser::cleanUp()
    123123{
    124         fMemoryManager->deallocate(fAdvDHList);//delete [] fAdvDHList;
     124    fMemoryManager->deallocate(fAdvDHList); //delete [] fAdvDHList;
    125125        delete fScanner;
    126126        delete fGrammarResolver;
    127         // grammar pool must do this
    128         //delete fURIStringPool;
    129 
    130         if (fValidator)
    131                 delete fValidator;
     127    delete fValidator;
    132128}
    133129
  • icXML/icXML-devel/src/icxercesc/parsers/SAXParser.hpp

    r3104 r3157  
    20292029                , const XMLCh* const    encodingStr
    20302030        );
     2031
    20312032        //@}
    20322033
     
    21322133        XMLScanner*          fScanner;
    21332134        GrammarResolver*     fGrammarResolver;
    2134         #ifndef TEST_NAMESPACE_RESOLVER
    2135         XMLStringPool*       fURIStringPool;
    2136         #endif
    21372135        XMLValidator*        fValidator;
    21382136        MemoryManager*       fMemoryManager;
    21392137        XMLGrammarPool*      fGrammarPool;
    2140 //      XMLBuffer            fElemQNameBuf;
    21412138};
    2142 
    21432139
    21442140// ---------------------------------------------------------------------------
  • icXML/icXML-devel/src/icxercesc/util/PlatformUtils.hpp

    r2720 r3157  
    798798//
    799799
    800 inline XMLSize_t
    801 XMLPlatformUtils::alignPointerForNewBlockAllocation(XMLSize_t ptrSize)
    802 {
    803     enum
    804     {
    805         kDefaultAlignment =
    806         #ifdef XML_PLATFORM_NEW_BLOCK_ALIGNMENT
    807             XML_PLATFORM_NEW_BLOCK_ALIGNMENT
    808         #else
    809             ((sizeof(void*) >= sizeof(double)) ? sizeof(void*) : sizeof(double))
    810         #endif
    811     };
    812 
    813         static const XMLSize_t alignment = kDefaultAlignment;
    814 
    815     //    Macro DEFAULT_ALIGNMENT may be defined
    816     //    as needed to dictate alignment requirements on a
    817     //    per-architecture basis. In the absense of that we
    818     //    take an educated guess.
    819 
    820     //    Calculate current alignment of pointer
    821     const XMLSize_t offset = ptrSize % alignment;
    822 
    823     //    Adjust pointer alignment as needed
    824     return (!offset) ? ptrSize : (ptrSize + alignment - offset);
    825 }
    826 
    827800// ---------------------------------------------------------------------------
    828801//  XMLDeleter: Public Destructor
     
    839812}
    840813
     814inline XMLSize_t
     815XMLPlatformUtils::alignPointerForNewBlockAllocation(XMLSize_t ptrSize)
     816{
     817    // Macro XML_PLATFORM_NEW_BLOCK_ALIGNMENT may be defined
     818    // as needed to dictate alignment requirements on a
     819    // per-architecture basis. In the absense of that we
     820    // take an educated guess.
     821
     822    // note: -O3 optimization eliminates the "alignment" variable if it's constant; caused DLL incompatibility. Investigate futher if there is a way to export it.
     823
     824    const static XMLSize_t alignment=
     825    #ifdef XML_PLATFORM_NEW_BLOCK_ALIGNMENT
     826        XML_PLATFORM_NEW_BLOCK_ALIGNMENT;
     827    #else
     828        (sizeof(void*) >= sizeof(double)) ? sizeof(void*) : sizeof(double);
     829    #endif
     830
     831    // Calculate current alignment of pointer
     832    XMLSize_t current = ptrSize % alignment;
     833
     834    // Adjust pointer alignment as needed
     835    return (current == 0) ? ptrSize : (ptrSize + alignment - current);
     836}
     837
    841838XERCES_CPP_NAMESPACE_END
    842839
  • icXML/icXML-devel/src/icxercesc/util/QName.cpp

    r3150 r3157  
    358358}
    359359
     360void QName::setName(const XMLCh* const rawName, const unsigned int uriId)
     361{
     362    setName(rawName, XMLString::indexOf(rawName, chColon), uriId);
     363}
     364
    360365void QName::setNPrefix(const XMLCh* prefix, const XMLSize_t newLen)
    361366{
     
    371376{
    372377        setName(qName.fPrefix, qName.fLocalPart, qName.fURIId);
     378}
     379
     380// -----------------------------------------------------------------------
     381//  getters
     382// -----------------------------------------------------------------------
     383const XMLCh* QName::getRawName() const
     384{
     385    return fRawName;
     386}
     387
     388XMLCh* QName::getRawName()
     389{
     390    return fRawName;
    373391}
    374392
  • icXML/icXML-devel/src/icxercesc/util/QName.hpp

    r3150 r3157  
    217217}
    218218
    219 inline XMLCh* QName::getRawName()
    220 {
    221         return fRawName;
    222 }
    223 
    224 inline const XMLCh* QName::getRawName() const
    225 {
    226         return fRawName;
    227 }
    228 
    229219inline const XMLSize_t QName::getRawLength() const
    230220{
     
    253243{
    254244        setNLocalPart(localPart, XMLString::stringLen(localPart));
    255 }
    256 
    257 inline void QName::setName( const XMLCh* const    rawName
    258                                                   , const unsigned int    uriId)
    259 {
    260         setName(rawName, XMLString::indexOf(rawName, chColon), uriId);
    261245}
    262246
  • icXML/icXML-devel/src/icxercesc/util/XMLString.cpp

    r2721 r3157  
    803803                        chDigit_0, chDigit_1, chDigit_2, chDigit_3, chDigit_4, chDigit_5
    804804                ,   chDigit_6, chDigit_7, chDigit_8, chDigit_9, chLatin_A, chLatin_B
    805                 ,   chLatin_C, chLatin_D, chLatin_e, chLatin_F
     805                ,   chLatin_C, chLatin_D, chLatin_E, chLatin_F
    806806        };
    807807
     
    894894                        chDigit_0, chDigit_1, chDigit_2, chDigit_3, chDigit_4, chDigit_5
    895895                ,   chDigit_6, chDigit_7, chDigit_8, chDigit_9, chLatin_A, chLatin_B
    896                 ,   chLatin_C, chLatin_D, chLatin_e, chLatin_F
     896                ,   chLatin_C, chLatin_D, chLatin_E, chLatin_F
    897897        };
    898898
  • icXML/icXML-devel/src/icxercesc/util/XMemory.cpp

    r2721 r3157  
    2323XERCES_CPP_NAMESPACE_BEGIN
    2424
    25 enum
    26 {
    27         kDefaultAlignment =
    28         #ifdef XML_PLATFORM_NEW_BLOCK_ALIGNMENT
    29                 XML_PLATFORM_NEW_BLOCK_ALIGNMENT
    30         #else
    31                 ((sizeof(void*) >= sizeof(double)) ? sizeof(void*) : sizeof(double))
    32         #endif
    33         , headerSize =
    34                 (sizeof(MemoryManager*) % kDefaultAlignment) == 0 ?
    35                         sizeof(MemoryManager*) :
    36                         sizeof(MemoryManager*) + kDefaultAlignment - (sizeof(MemoryManager*) % kDefaultAlignment)
    37 };
     25#define HEADER_SIZE (XMLPlatformUtils::alignPointerForNewBlockAllocation(sizeof(MemoryManager*)))
    3826
    3927void* XMemory::operator new(size_t size)
    4028{
    41         void* const block = XMLPlatformUtils::fgMemoryManager->allocate(headerSize + size);
    42         *(MemoryManager**)block = XMLPlatformUtils::fgMemoryManager;
    43 
    44         return (char*)block + headerSize;
     29    void* const block = XMLPlatformUtils::fgMemoryManager->allocate(HEADER_SIZE + size);
     30    *(MemoryManager**)block = XMLPlatformUtils::fgMemoryManager;
     31    return (char*)block + HEADER_SIZE;
    4532}
    4633
     
    6148void* XMemory::operator new(size_t size, MemoryManager* manager)
    6249{
    63         void * const block = manager->allocate(headerSize + size);
    64         *(MemoryManager**)block = manager;
    65         return (char*)block + headerSize;
     50    void * const block = manager->allocate(HEADER_SIZE + size);
     51    *(MemoryManager**)block = manager;
     52    return (char*)block + HEADER_SIZE;
    6653}
    6754
     
    7562        if (p != 0)
    7663        {
    77                 void* const block = (char*)p - headerSize;
     64        void* const block = (char*)p - HEADER_SIZE;
    7865                MemoryManager* const manager = *(MemoryManager**)block;
    7966                manager->deallocate(block);
     
    8976        if (p != 0)
    9077        {
    91                 void* const block = (char*)p - headerSize;
     78        void* const block = (char*)p - HEADER_SIZE;
    9279                /***
    9380                 * assert(*(MemoryManager**)block == manager);
     
    10996#endif
    11097
    111 #undef XML_PLATFORM_DEFAULT_NEW_BLOCK_ALIGNMENT
     98#undef HEADER_SIZE
    11299
    113100XERCES_CPP_NAMESPACE_END
  • icXML/icXML-devel/src/icxercesc/validators/datatype/DatatypeValidatorFactory.cpp

    r3153 r3157  
    879879}
    880880
     881DatatypeValidator* DatatypeValidatorFactory::getDatatypeValidator(const XMLCh* const dvType) const
     882{
     883    DatatypeValidator * validator = 0;
     884    if (dvType)
     885    {
     886        if (fBuiltInRegistry && fBuiltInRegistry->containsKey(dvType))
     887        {
     888            validator = fBuiltInRegistry->get(dvType);
     889        }
     890
     891        if (fUserDefinedRegistry && fUserDefinedRegistry->containsKey(dvType))
     892        {
     893            validator = fUserDefinedRegistry->get(dvType);
     894        }
     895    }
     896    return validator;
     897}
     898
    881899/***
    882900 * Support for Serialization/De-serialization
  • icXML/icXML-devel/src/icxercesc/validators/datatype/DatatypeValidatorFactory.hpp

    r2720 r3157  
    240240};
    241241
    242 inline DatatypeValidator*
    243 DatatypeValidatorFactory::getDatatypeValidator(const XMLCh* const dvType) const
    244 {
    245         DatatypeValidator * validator = 0;
    246         if (dvType)
    247         {
    248                 if (fBuiltInRegistry && fBuiltInRegistry->containsKey(dvType))
    249                 {
    250                         validator = fBuiltInRegistry->get(dvType);
    251                 }
    252 
    253                 if (fUserDefinedRegistry && fUserDefinedRegistry->containsKey(dvType))
    254                 {
    255                         validator = fUserDefinedRegistry->get(dvType);
    256                 }
    257         }
    258         DEBUG_MESSAGE("DatatypeValidatorFactory::getDatatypeValidator(" << dvType << ")=" << validator);
    259         return validator;
    260 }
    261 
    262242inline DVHashTable*
    263243DatatypeValidatorFactory::getUserDefinedRegistry() const
  • icXML/icXML-devel/src/icxercesc/validators/schema/ComplexTypeInfo.cpp

    r3104 r3157  
    131131        , fContentSpec(0)
    132132        , fAttWildCard(0)
    133         , fAttList(0)
     133    , fAttList(NULL, manager)
    134134        , fElements(0)
    135135//      , fAttDefs(0)
     
    140140        , fMemoryManager(manager)
    141141{
    142 //      fAttDefs = new (fMemoryManager) RefHash2KeysTableOf<SchemaAttDef>(29, true, fMemoryManager);
    143     fAttList = new (fMemoryManager) SchemaAttDefList(NULL ,fMemoryManager);
     142
    144143}
    145144
     
    156155
    157156        delete fAttWildCard;
    158         delete fAttList;
    159157        delete fElements;
    160158        delete fLocator;
     
    175173    // fAttDefs->put((void*)(attName->getLocalPart()), attName->getURI(), toAdd);
    176174        // update and/or create fAttList
    177     fAttList->addAttDef(toAdd);
     175    fAttList.addAttDef(toAdd);
    178176}
    179177
     
    206204        //       access attributes (especially if same grammar is used in
    207205        //       multiple threads).
    208         return *fAttList;
     206    return const_cast<ComplexTypeInfo*>(this)->fAttList;
    209207}
    210208
     
    821819}
    822820
     821void ComplexTypeInfo::addElement(SchemaElementDecl* const elem)
     822{
     823    if (!fElements)
     824    {
     825        fElements = new (fMemoryManager) RefVectorOf<SchemaElementDecl>(8, false, fMemoryManager);
     826    }
     827    else if (fElements->containsElement(elem))
     828    {
     829        return;
     830    }
     831    fElements->addElement(elem);
     832}
     833
     834void ComplexTypeInfo::setTypeName(const XMLCh* const typeName)
     835{
     836    fMemoryManager->deallocate(fTypeName);
     837    fMemoryManager->deallocate(fTypeLocalName);
     838    fMemoryManager->deallocate(fTypeUri);
     839
     840    if (typeName)
     841    {
     842        fTypeName = XMLString::replicate(typeName, fMemoryManager);
     843
     844        int index = XMLString::indexOf(fTypeName, chComma);
     845        XMLSize_t length = XMLString::stringLen(fTypeName);
     846        fTypeLocalName = (XMLCh*) fMemoryManager->allocate((length - index + 1) * sizeof(XMLCh)); //new XMLCh[length - index + 1];
     847        XMLString::subString(fTypeLocalName, fTypeName, index + 1, length, fMemoryManager);
     848
     849        fTypeUri = (XMLCh*) fMemoryManager->allocate
     850        (
     851            (index + 1) * sizeof(XMLCh)
     852        ); //new XMLCh[index + 1];
     853        XMLString::subString(fTypeUri, fTypeName, 0, index, fMemoryManager);
     854    }
     855    else
     856    {
     857        fTypeName = fTypeLocalName = fTypeUri = 0;
     858    }
     859}
     860
    823861/***
    824862 * Support for Serialization/De-serialization
  • icXML/icXML-devel/src/icxercesc/validators/schema/ComplexTypeInfo.hpp

    r3104 r3157  
    216216        ContentSpecNode*                   fContentSpec;
    217217        SchemaAttDef*                      fAttWildCard;
    218         SchemaAttDefList*                  fAttList;
     218    SchemaAttDefList                   fAttList;
    219219        RefVectorOf<SchemaElementDecl>*    fElements;
    220220        // TODO: should this really be a hash table? is it populated enough to be worthwhile?
     
    329329inline const SchemaAttDef* ComplexTypeInfo::getAttDef(const XMLCh* const baseName, const int uriId) const
    330330{
    331     return static_cast<const SchemaAttDef*>(fAttList->findAttDefLocalPart(uriId, baseName));
     331    return static_cast<const SchemaAttDef*>(fAttList.findAttDefLocalPart(uriId, baseName));
    332332//      return fAttDefs->get(baseName, uriId);
    333333}
     
    335335inline SchemaAttDef* ComplexTypeInfo::getAttDef(const XMLCh* const baseName, const int uriId)
    336336{
    337     return static_cast<SchemaAttDef*>(fAttList->findAttDefLocalPart(uriId, baseName));
     337    return static_cast<SchemaAttDef*>(fAttList.findAttDefLocalPart(uriId, baseName));
    338338    // return fAttDefs->get(baseName, uriId);
    339339}
     
    440440}
    441441
    442 inline void ComplexTypeInfo::setTypeName(const XMLCh* const typeName) {
    443 
    444         fMemoryManager->deallocate(fTypeName);//delete [] fTypeName;
    445         fMemoryManager->deallocate(fTypeLocalName);//delete [] fTypeLocalName;
    446         fMemoryManager->deallocate(fTypeUri);//delete [] fTypeUri;
    447 
    448         if (typeName)
    449         {
    450                 fTypeName = XMLString::replicate(typeName, fMemoryManager);
    451 
    452                 int index = XMLString::indexOf(fTypeName, chComma);
    453                 XMLSize_t length = XMLString::stringLen(fTypeName);
    454                 fTypeLocalName = (XMLCh*) fMemoryManager->allocate
    455                 (
    456                         (length - index + 1) * sizeof(XMLCh)
    457                 ); //new XMLCh[length - index + 1];
    458                 XMLString::subString(fTypeLocalName, fTypeName, index + 1, length, fMemoryManager);
    459 
    460                 fTypeUri = (XMLCh*) fMemoryManager->allocate
    461                 (
    462                         (index + 1) * sizeof(XMLCh)
    463                 ); //new XMLCh[index + 1];
    464                 XMLString::subString(fTypeUri, fTypeName, 0, index, fMemoryManager);
    465         }
    466         else
    467         {
    468                 fTypeName = fTypeLocalName = fTypeUri = 0;
    469         }
    470 }
    471 
    472442inline void
    473443ComplexTypeInfo::setBaseDatatypeValidator(DatatypeValidator* const validator) {
     
    488458}
    489459
    490 inline void ComplexTypeInfo::addElement(SchemaElementDecl* const elem) {
    491 
    492         if (!fElements) {
    493                 fElements = new (fMemoryManager) RefVectorOf<SchemaElementDecl>(8, false, fMemoryManager);
    494         }
    495         else if (fElements->containsElement(elem)) {
    496                 return;
    497         }
    498 
    499         fElements->addElement(elem);
    500 }
    501 
    502460inline void ComplexTypeInfo::setAttWildCard(SchemaAttDef* const toAdopt) {
    503461
     
    518476inline bool ComplexTypeInfo::hasAttDefs() const
    519477{
    520     return !fAttList->isEmpty();
     478    return !fAttList.isEmpty();
    521479    // return !fAttDefs->isEmpty();
    522480}
     
    524482inline bool ComplexTypeInfo::contains(const XMLCh* const attName)
    525483{
    526     SchemaAttDef** list = fAttList->fArray;
    527 
    528     for (XMLSize_t i = 0; i < fAttList->fCount; i++)
     484    SchemaAttDef** list = fAttList.fArray;
     485
     486    for (XMLSize_t i = 0; i < fAttList.fCount; i++)
    529487    {
    530488        if (XMLString::equals(attName, list[i]->getAttName()->getLocalPart()))
  • icXML/icXML-devel/src/icxercesc/validators/schema/SchemaAttDefList.cpp

    r3104 r3157  
    4848SchemaAttDefList::~SchemaAttDefList()
    4949{
    50 //    delete fEnum;
     50    for (XMLSize_t i = 0; i < fCount; i++)
     51    {
     52        delete fArray[i];
     53    }
    5154    (getMemoryManager())->deallocate(fArray);
    5255}
  • icXML/icXML-devel/src/icxercesc/validators/schema/SchemaInfo.cpp

    r3153 r3157  
    245245}
    246246
     247void SchemaInfo::addRecursingType(const DOMElement* const elem, const XMLCh* const name)
     248{
     249
     250    if (!fRecursingAnonTypes) {
     251        fRecursingAnonTypes = new (fMemoryManager) ValueVectorOf<const DOMElement*>(8, fMemoryManager);
     252        fRecursingTypeNames = new (fMemoryManager) ValueVectorOf<const XMLCh*>(8, fMemoryManager);
     253    }
     254
     255    fRecursingAnonTypes->addElement(elem);
     256    fRecursingTypeNames->addElement(name);
     257}
     258
    247259XERCES_CPP_NAMESPACE_END
    248260
  • icXML/icXML-devel/src/icxercesc/validators/schema/SchemaInfo.hpp

    r3153 r3157  
    403403}
    404404
    405 inline void SchemaInfo::addRecursingType(const DOMElement* const elem,
    406                                                                                  const XMLCh* const name) {
    407 
    408         if (!fRecursingAnonTypes) {
    409                 fRecursingAnonTypes = new (fMemoryManager) ValueVectorOf<const DOMElement*>(8, fMemoryManager);
    410                 fRecursingTypeNames = new (fMemoryManager) ValueVectorOf<const XMLCh*>(8, fMemoryManager);
    411         }
    412 
    413         fRecursingAnonTypes->addElement(elem);
    414         fRecursingTypeNames->addElement(name);
    415 }
    416 
    417405inline void SchemaInfo::clearTopLevelComponents()
    418406{
  • icXML/icXML-devel/src/icxercesc/validators/schema/TraverseSchema.cpp

    r3153 r3157  
    82268226        }
    82278227
    8228         if (attGroupInfo) {
     8228    if (attGroupInfo) {
    82298229                copyAttGroupAttributes(elem, attGroupInfo, fCurrentAttGroupInfo, typeInfo);
    82308230        }
    82318231
    82328232        // restore schema information, if necessary
    8233         if (saveInfo != fSchemaInfo) {
     8233    if (saveInfo != fSchemaInfo) {
    82348234                restoreSchemaInfo(saveInfo, infoType);
    82358235        }
     
    1058510585}
    1058610586
     10587// NOTE: had to move these functions out to retain DLL compatibility
     10588
     10589const XMLCh* TraverseSchema::getPrefix(const XMLCh* const rawName)
     10590{
     10591    int colonIndex = XMLString::indexOf(rawName, chColon);
     10592
     10593    if (colonIndex <= 0)
     10594    {
     10595        return XMLUni::fgZeroLenString;
     10596    }
     10597
     10598    XMLCh * const colon = const_cast<XMLCh*>(&rawName[colonIndex]);
     10599
     10600    *colon = 0;
     10601    const XMLCh * name = fStringPool->getValueForId(fStringPool->addOrFind(rawName));
     10602    *colon = chColon;
     10603
     10604    return name;
     10605}
     10606
     10607void TraverseSchema::addImportedNS(const int namespaceURI)
     10608{
     10609    if (!fImportedNSList)
     10610    {
     10611        fImportedNSList = new (fMemoryManager) ValueVectorOf<int>(4, fMemoryManager);
     10612    }
     10613
     10614    if (!fImportedNSList->containsElement(namespaceURI))
     10615    {
     10616        fImportedNSList->addElement(namespaceURI);
     10617    }
     10618}
     10619
     10620const XMLCh* TraverseSchema::genAnonTypeName(const XMLCh* const prefix)
     10621{
     10622    XMLCh anonCountStr[16]; // a count of 15 digits should be enough
     10623
     10624    XMLString::sizeToText(fAnonXSTypeCount++, anonCountStr, 15, 10, fMemoryManager);
     10625    fBuffer.set(prefix);
     10626    fBuffer.append(anonCountStr);
     10627
     10628    return fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer()));
     10629}
     10630
     10631const XMLCh* TraverseSchema::getLocalPart(const XMLCh* const rawName)
     10632{
     10633    int    colonIndex = XMLString::indexOf(rawName, chColon);
     10634    XMLSize_t rawNameLen = XMLString::stringLen(rawName);
     10635
     10636    if (XMLSize_t(colonIndex + 1) == rawNameLen)
     10637    {
     10638        return XMLUni::fgZeroLenString;
     10639    }
     10640
     10641    return fStringPool->getValueForId(fStringPool->addOrFind(&rawName[colonIndex + 1]));
     10642}
     10643
    1058710644XERCES_CPP_NAMESPACE_END
    1058810645
  • icXML/icXML-devel/src/icxercesc/validators/schema/TraverseSchema.hpp

    r3153 r3157  
    795795//  TraverseSchema: Helper methods
    796796// ---------------------------------------------------------------------------
    797 inline const XMLCh* TraverseSchema::getPrefix(const XMLCh* const rawName)
    798 {
    799         int colonIndex = XMLString::indexOf(rawName, chColon);
    800 
    801         if (colonIndex <= 0)
    802         {
    803                 return XMLUni::fgZeroLenString;
    804         }
    805 
    806         XMLCh * const colon = const_cast<XMLCh*>(&rawName[colonIndex]);
    807 
    808         *colon = 0;
    809         const XMLCh * name = fStringPool->getValueForId(fStringPool->addOrFind(rawName));
    810         *colon = chColon;
    811 
    812         return name;
    813 }
    814 
    815 inline const XMLCh* TraverseSchema::getLocalPart(const XMLCh* const rawName)
    816 {
    817         int    colonIndex = XMLString::indexOf(rawName, chColon);
    818         XMLSize_t rawNameLen = XMLString::stringLen(rawName);
    819 
    820         if (XMLSize_t(colonIndex + 1) == rawNameLen)
    821         {
    822                 return XMLUni::fgZeroLenString;
    823         }
    824 
    825         return fStringPool->getValueForId(fStringPool->addOrFind(&rawName[colonIndex + 1]));
    826 }
    827797
    828798inline void
     
    863833}
    864834
    865 inline const XMLCh* TraverseSchema::genAnonTypeName(const XMLCh* const prefix) {
    866 
    867         XMLCh anonCountStr[16]; // a count of 15 digits should be enough
    868 
    869         XMLString::sizeToText(fAnonXSTypeCount++, anonCountStr, 15, 10, fMemoryManager);
    870         fBuffer.set(prefix);
    871         fBuffer.append(anonCountStr);
    872 
    873         return fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer()));
    874 }
    875 
    876835inline void TraverseSchema::popCurrentTypeNameStack() {
    877836
     
    910869
    911870        return (fImportedNSList->containsElement(namespaceURI));
    912 }
    913 
    914 inline void TraverseSchema::addImportedNS(const int namespaceURI)
    915 {
    916         if (!fImportedNSList)
    917         {
    918                 fImportedNSList = new (fMemoryManager) ValueVectorOf<int>(4, fMemoryManager);
    919         }
    920 
    921         if (!fImportedNSList->containsElement(namespaceURI))
    922         {
    923                 fImportedNSList->addElement(namespaceURI);
    924         }
    925871}
    926872
  • icXML/icXML-devel/src/icxmlc/XMLSymbolTable.hpp

    r3151 r3157  
    77/*
    88 * @author Nigel Medforth, nigelm -at- interational-characters.com
    9  * @version $Id: XMLSymbolTable.hpp 312 2013-05-10 20:53:22Z nigelm $
     9 * @version $Id: XMLSymbolTable.hpp 318 2013-05-16 02:45:25Z nigelm $
    1010 *
    1111 */
     
    364364)
    365365{
    366     XMLByte * unencodedKey = (XMLByte *)fMemoryManager->allocate((length * 3) + 1);
    367     XMLSize_t unencodedLength;
    368     unencodedLength = fTranscoder->transcodeTo(key, length, unencodedKey, length * 3, unencodedLength, XMLTranscoder::UnRep_Throw);
    369     unencodedKey[unencodedLength] = 0;
    370 
    371     gid_t gid = fSymbolTable.find(unencodedKey, unencodedLength);
     366    Janitor<XMLByte> janSourceKey((XMLByte *)fMemoryManager->allocate((length * 3) + 1));
     367    XMLByte * sourceKey = janSourceKey.get();
     368    XMLSize_t sourceLength = fTranscoder->transcodeTo(key, length, sourceKey, length * 3, sourceLength, XMLTranscoder::UnRep_Throw);
     369    sourceKey[sourceLength] = 0;
     370
     371    gid_t gid = fSymbolTable.find(sourceKey, sourceLength);
    372372
    373373    if (unlikely(gid == -1))
    374374    {
    375         gid = addInternal(key, length, unencodedKey, unencodedLength);
    376     }
    377     fMemoryManager->deallocate(unencodedKey);
     375        gid = addInternal(key, length, sourceKey, sourceLength);
     376    }
    378377    return gid;
    379378}
  • icXML/icXML-devel/src/icxmlc/parsers/XMLDocumentDisseminator.hpp

    r3151 r3157  
    1313
    1414XERCES_CPP_NAMESPACE_BEGIN
     15
    1516
    1617class XMLDocumentDisseminator
     
    4950
    5051    IDISA_ALWAYS_INLINE
    51     void readContextId();
     52    unsigned int getNamespaceContextId();
    5253
    5354private:
     
    123124                const QName * const grammarName = elemDecl.fElementName;
    124125                elemDecl.fElementName = elemName;
    125                 readContextId();
     126                elemDecl.fNamespaceContextId = getNamespaceContextId();
    126127                fDocumentHandler->startElement(elemDecl, uriId, elemName->getPrefix(), fAttrList, attributeCount, isEmpty, 0);
    127128                elemDecl.fElementName = grammarName;
     
    136137                const QName * const grammarName = elemDecl.fElementName;
    137138                elemDecl.fElementName = elemName;
    138                 readContextId();
     139                elemDecl.fNamespaceContextId = getNamespaceContextId();
    139140                fDocumentHandler->endElement(elemDecl, uriId, 0, elemName->getPrefix());
    140141                elemDecl.fElementName = grammarName;
     
    168169}
    169170
    170 void XMLDocumentDisseminator::readContextId()
     171unsigned int XMLDocumentDisseminator::getNamespaceContextId()
    171172{
    172173    // the namespace context id allows the scanner to map prefix to uris and determine what
    173174    // prefixes and uris are in scope.
    174     fDocumentHandler->fNamespaceContextId = fContextStream[fContextIdx++];
     175    return fContextStream[fContextIdx++];
    175176}
    176177
  • icXML/icXML-devel/src/icxmlc/parsers/XMLNamespaceParser.hpp

    r3151 r3157  
    117117    }
    118118
    119 
    120     IDISA_ALWAYS_INLINE
    121119    void resolveNamespaces();
    122120
     
    447445        }
    448446
    449         // mark any attribute as either a namespace or surpressed attribute; this will inform the DocumentAccumulator as to whether or not
    450         // to include the xmlns attribute in the document context and object streams.
    451         const static MarkupType attributeType[2] = { Surpressed, NamespaceAttribute };
    452447        WritableContentPtrType attributeMarker = const_cast<WritableContentPtrType>(fCursorPtr - 1);
    453         *attributeMarker = (*attributeMarker & DefaultAttribute) | attributeType[namespaceContextChange];
     448        *attributeMarker = (*attributeMarker & DefaultAttribute) | NamespaceAttribute;
    454449
    455450        if (unlikely(expanded))
  • icXML/icXML-devel/src/icxmlc/parsers/XMLWellFormednessParser.hpp

    r3151 r3157  
    7373    void checkWellformedness(XMLDocumentAccumulator * const accumulator);
    7474
    75     IDISA_ALWAYS_INLINE
    7675    void checkEntityWellformedness();
    7776
  • icXML/icXML-devel/src/xercesc/framework/XMLBufferMgr.cpp

    r2722 r3157  
    2525// ---------------------------------------------------------------------------
    2626//#include <string.h>
    27 #include <xercesc/framework/XMLBufferMgr.hpp>
     27#include <icxercesc/framework/XMLBufferMgr.hpp>
    2828#include <xercesc/util/RuntimeException.hpp>
    2929
  • icXML/icXML-devel/src/xercesc/internal/XSerializeEngine.cpp

    r2722 r3157  
    962962}
    963963
    964 inline void XSerializeEngine::checkAndFlushBuffer(XMLSize_t bytesNeedToWrite)
     964void XSerializeEngine::checkAndFlushBuffer(XMLSize_t bytesNeedToWrite)
    965965{
    966966    TEST_THROW_ARG1( (bytesNeedToWrite <= 0)
     
    974974}
    975975
    976 inline void XSerializeEngine::checkAndFillBuffer(XMLSize_t bytesNeedToRead)
     976void XSerializeEngine::checkAndFillBuffer(XMLSize_t bytesNeedToRead)
    977977{
    978978
     
    11311131    return (remainder == 0) ? 0 : (size - remainder);
    11321132}
    1133 
    11341133// Adjust the fBufCur
    1135 inline void XSerializeEngine::alignBufCur(XMLSize_t size)
     1134void XSerializeEngine::alignBufCur(XMLSize_t size)
    11361135{
    11371136    fBufCur+=alignAdjust(size);
  • icXML/icXML-devel/src/xercesc/sax2/SAX2XMLReader.hpp

    r3104 r3157  
    9797    /** @name Implementation of SAX 2.0 XMLReader interface's. */
    9898    //@{
    99 
    100     /**
    101       * This method returns the installed content handler.
    102       *
    103       * @return A pointer to the installed content handler object.
    104       */
    105     virtual ContentHandler* getContentHandler() const = 0 ;
    10699
    107100    /**
  • icXML/icXML-devel/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp

    r2777 r3157  
    3131#include <xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp>
    3232#include <xercesc/util/MsgLoaders/InMemory/XercesMessages_en_US.hpp>
     33#include <xercesc/util/Janitor.hpp>
    3334
    3435XERCES_CPP_NAMESPACE_BEGIN
     
    146147    //  which will do the replacement work.
    147148    //
    148     XMLCh* tmp1 = 0;
    149     XMLCh* tmp2 = 0;
    150     XMLCh* tmp3 = 0;
    151     XMLCh* tmp4 = 0;
    152    
    153     bool bRet = false;
     149
     150    Janitor<XMLCh> janRepText1(0);
     151    Janitor<XMLCh> janRepText2(0);
     152    Janitor<XMLCh> janRepText3(0);
     153    Janitor<XMLCh> janRepText4(0);
     154
    154155    if (repText1)
    155         tmp1 = XMLString::transcode(repText1, manager);
     156        janRepText1.reset(XMLString::transcode(repText1, manager));
    156157    if (repText2)
    157         tmp2 = XMLString::transcode(repText2, manager);
     158        janRepText2.reset(XMLString::transcode(repText2, manager));
    158159    if (repText3)
    159         tmp3 = XMLString::transcode(repText3, manager);
     160        janRepText3.reset(XMLString::transcode(repText3, manager));
    160161    if (repText4)
    161         tmp4 = XMLString::transcode(repText4, manager);
     162        janRepText4.reset(XMLString::transcode(repText4, manager));
    162163
    163     bRet = loadMsg(msgToLoad, toFill, maxChars, tmp1, tmp2, tmp3, tmp4, manager);
    164 
    165     if (tmp1)
    166         manager->deallocate(tmp1);//delete [] tmp1;
    167     if (tmp2)
    168         manager->deallocate(tmp2);//delete [] tmp2;
    169     if (tmp3)
    170         manager->deallocate(tmp3);//delete [] tmp3;
    171     if (tmp4)
    172         manager->deallocate(tmp4);//delete [] tmp4;
    173 
    174     return bRet;
     164    return loadMsg(msgToLoad, toFill, maxChars, janRepText1.get(), janRepText2.get(), janRepText3.get(), janRepText4.get(), manager);
    175165}
    176166
  • icXML/icXML-devel/src/xercesc/util/XMLException.cpp

    r2722 r3157  
    179179
    180180    // load the text
    181         if (!gGetMsgLoader().loadMsg(toLoad, errText, msgSize))
    182         {
    183                 fMsg = XMLString::replicate
    184         (
    185         XMLUni::fgDefErrMsg
    186             , fMemoryManager
    187         );
    188                 return;
    189         }
    190 
     181    const bool found = gGetMsgLoader().loadMsg(toLoad, errText, msgSize);
    191182    // We got the text so replicate it into the message member
    192     fMsg = XMLString::replicate(errText, fMemoryManager);
     183    fMsg = XMLString::replicate(found ? errText : XMLUni::fgDefErrMsg, fMemoryManager);
    193184}
    194185
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/FieldValueMap.cpp

    r2722 r3157  
    120120}
    121121
     122// ---------------------------------------------------------------------------
     123//  FieldValueMap: Setter methods
     124// ---------------------------------------------------------------------------
     125void FieldValueMap::put(IC_Field* const key, DatatypeValidator* const dv, const XMLCh* const value)
     126{
     127    if (!fFields) {
     128        fFields = new (fMemoryManager) ValueVectorOf<IC_Field*>(4, fMemoryManager);
     129        fValidators = new (fMemoryManager) ValueVectorOf<DatatypeValidator*>(4, fMemoryManager);
     130        fValues = new (fMemoryManager) RefArrayVectorOf<XMLCh>(4, true, fMemoryManager);
     131    }
     132
     133    XMLSize_t keyIndex;
     134    if (!indexOf(key, keyIndex))
     135    {
     136        fFields->addElement(key);
     137        fValidators->addElement(dv);
     138        fValues->addElement(XMLString::replicate(value, fMemoryManager));
     139    }
     140    else
     141    {
     142        fValidators->setElementAt(dv, keyIndex);
     143        fValues->setElementAt(XMLString::replicate(value, fMemoryManager), keyIndex);
     144    }
     145}
     146
    122147XERCES_CPP_NAMESPACE_END
    123148
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/FieldValueMap.hpp

    r2722 r3157  
    161161}
    162162
    163 // ---------------------------------------------------------------------------
    164 //  FieldValueMap: Setter methods
    165 // ---------------------------------------------------------------------------
    166 inline void FieldValueMap::put(IC_Field* const key,
    167                                DatatypeValidator* const dv,
    168                                const XMLCh* const value) {
    169 
    170     if (!fFields) {
    171         fFields = new (fMemoryManager) ValueVectorOf<IC_Field*>(4, fMemoryManager);
    172         fValidators = new (fMemoryManager) ValueVectorOf<DatatypeValidator*>(4, fMemoryManager);
    173         fValues = new (fMemoryManager) RefArrayVectorOf<XMLCh>(4, true, fMemoryManager);
    174     }
    175 
    176     XMLSize_t keyIndex;
    177     bool bFound=indexOf(key, keyIndex);
    178 
    179     if (!bFound) {
    180 
    181         fFields->addElement(key);
    182         fValidators->addElement(dv);
    183         fValues->addElement(XMLString::replicate(value, fMemoryManager));
    184     }
    185     else {
    186         fValidators->setElementAt(dv, keyIndex);
    187         fValues->setElementAt(XMLString::replicate(value, fMemoryManager), keyIndex);
    188     }
    189 }
    190 
    191163XERCES_CPP_NAMESPACE_END
    192164
Note: See TracChangeset for help on using the changeset viewer.