Changeset 3565 for icXML


Ignore:
Timestamp:
Nov 18, 2013, 5:53:53 AM (5 years ago)
Author:
cameron
Message:

Updates to xercesc sources

Location:
icXML/icXML-devel/src/xercesc
Files:
96 edited

Legend:

Unmodified
Added
Removed
  • icXML/icXML-devel/src/xercesc/dom/impl/DOMAttrImpl.cpp

    r2777 r3565  
    3232
    3333DOMAttrImpl::DOMAttrImpl(DOMDocument *ownerDoc, const XMLCh *aName)
    34     : fNode(ownerDoc), fParent (ownerDoc), fSchemaType(0)
    35 {
    36     DOMDocumentImpl *docImpl = (DOMDocumentImpl *)ownerDoc;
    37     fName = docImpl->getPooledString(aName);
     34: fNode(ownerDoc)
     35, fName(((DOMDocumentImpl *)ownerDoc)->getPooledString(aName))
     36, fParent(ownerDoc)
     37, fSchemaType(0)
     38{
    3839    fNode.isSpecified(true);
    3940}
    4041
    4142DOMAttrImpl::DOMAttrImpl(const DOMAttrImpl &other, bool /*deep*/)
    42     : DOMAttr(other)
    43     , fNode(other.fNode)
    44     , fParent (other.fParent)
    45     , fName(other.fName)
    46     , fSchemaType(other.fSchemaType)
    47 {
    48     if (other.fNode.isSpecified())
    49         fNode.isSpecified(true);
    50     else
    51         fNode.isSpecified(false);
     43: DOMAttr(other)
     44, fNode(other.fNode)
     45, fName(other.fName)
     46, fParent (other.fParent)
     47, fSchemaType(other.fSchemaType)
     48{
     49    fNode.isSpecified(other.fNode.isSpecified());
    5250
    5351    if (other.fNode.isIdAttr())
  • icXML/icXML-devel/src/xercesc/dom/impl/DOMAttrMapImpl.cpp

    r2777 r3565  
    3333XERCES_CPP_NAMESPACE_BEGIN
    3434
    35 DOMAttrMapImpl::DOMAttrMapImpl(DOMNode *ownerNod)
    36 {
    37     this->fOwnerNode=ownerNod;
    38     this->fNodes = 0;
    39         hasDefaults(false);
    40 }
    41 
    42 DOMAttrMapImpl::DOMAttrMapImpl(DOMNode *ownerNod, const DOMAttrMapImpl *defaults)
    43 {
    44     this->fOwnerNode=ownerNod;
    45     this->fNodes = 0;
    46         hasDefaults(false);
    47         if (defaults != 0)
    48         {
    49                 if (defaults->getLength() > 0)
    50                 {
    51                         hasDefaults(true);
    52                         cloneContent(defaults);
    53                 }
    54         }
     35DOMAttrMapImpl::DOMAttrMapImpl(DOMNode * owner)
     36: fOwnerNode(owner)
     37, fNodes(0)
     38, attrDefaults(false)
     39{
     40
     41}
     42
     43DOMAttrMapImpl::DOMAttrMapImpl(DOMNode * owner, const DOMAttrMapImpl *defaults)
     44: fOwnerNode(owner)
     45, fNodes(0)
     46, attrDefaults(false)
     47{
     48    cloneContent(defaults);
    5549}
    5650
     
    6155void DOMAttrMapImpl::cloneContent(const DOMAttrMapImpl *srcmap)
    6256{
     57    attrDefaults = false;
    6358    if ((srcmap != 0) && (srcmap->fNodes != 0))
    6459    {
    65         if (fNodes != 0)
     60        attrDefaults = true;
     61        if (fNodes)
    6662            fNodes->reset();
    6763        else
     
    9086        DOMAttrMapImpl *newmap = new (castToNodeImpl(ownerNode_p)->getOwnerDocument()) DOMAttrMapImpl(ownerNode_p);
    9187        newmap->cloneContent(this);
    92         // newmap->attrDefaults = this->attrDefaults;  // revisit
    9388        return newmap;
    9489}
  • icXML/icXML-devel/src/xercesc/dom/impl/DOMDocumentImpl.cpp

    r2777 r3565  
    507507DOMNodeList *DOMDocumentImpl::getElementsByTagName(const XMLCh *tagname) const
    508508{
     509    DEBUG_MESSAGE("DOMElementImpl::getElementsByTagName(" << tagname << ')')
     510
    509511    // cast off the const of this because we will update the fNodeListPool
    510512    return ((DOMDocumentImpl*)this)->getDeepNodeList(this,tagname);
     
    644646
    645647
    646 DOMNodeList *DOMDocumentImpl::getElementsByTagNameNS(const XMLCh *fNamespaceURI,
    647     const XMLCh *fLocalName)  const
    648 {
     648DOMNodeList *DOMDocumentImpl::getElementsByTagNameNS(const XMLCh *fNamespaceURI, const XMLCh *fLocalName)  const
     649{
     650    DEBUG_MESSAGE("DOMDocumentImpl::getElementsByTagNameNS(" << fNamespaceURI << ',' << fLocalName << ')')
     651
    649652    // cast off the const of this because we will update the fNodeListPool
    650653    return ((DOMDocumentImpl*)this)->getDeepNodeList(this, fNamespaceURI, fLocalName);
     
    10641067    DOMNode *newnode=0;
    10651068    bool oldErrorCheckingFlag = errorChecking;
     1069
     1070    assert (source);
    10661071
    10671072    switch (source->getNodeType())
     
    12741279        fNode.callUserDataHandlers(DOMUserDataHandler::NODE_IMPORTED, source, newnode);
    12751280
     1281    assert (newnode);
     1282
    12761283    return newnode;
    12771284}
  • icXML/icXML-devel/src/xercesc/dom/impl/DOMElementImpl.cpp

    r2777 r3565  
    4444
    4545DOMElementImpl::DOMElementImpl(DOMDocument *ownerDoc, const XMLCh *eName)
    46     : fNode(ownerDoc), fParent(ownerDoc), fAttributes(0), fDefaultAttributes(0)
     46: fNode(ownerDoc)
     47, fName(((DOMDocumentImpl *)ownerDoc)->getPooledString(eName))
     48, fParent(ownerDoc)
     49, fAttributes(0)
     50, fDefaultAttributes(0)
    4751{
    4852    DOMDocumentImpl *docImpl = (DOMDocumentImpl *)ownerDoc;
    49     fName = docImpl->getPooledString(eName);
    5053    setupDefaultAttributes();
    51     if (!fDefaultAttributes) {
    52         fDefaultAttributes = new (docImpl) DOMAttrMapImpl(this);
    53         fAttributes = new (docImpl) DOMAttrMapImpl(this);
    54     }
    55     else {
    56       fAttributes = new (docImpl) DOMAttrMapImpl(this, fDefaultAttributes);
    57     }
     54    fAttributes = new (docImpl) DOMAttrMapImpl(this, fDefaultAttributes);
    5855}
    5956
    6057
    6158DOMElementImpl::DOMElementImpl(const DOMElementImpl &other, bool deep)
    62     : DOMElement(other),
    63       fNode (other.fParent.fOwnerDocument),
    64       fParent (other.fParent.fOwnerDocument),
    65       fAttributes(0),
    66       fDefaultAttributes(0)
    67 {
    68     fName = other.fName;
    69 
     59: DOMElement(other)
     60, fNode(other.fParent.fOwnerDocument)
     61, fName(other.fName)
     62, fParent(other.fParent.fOwnerDocument)
     63, fAttributes(0)
     64, fDefaultAttributes(0)
     65{
    7066    if (deep)
    7167        fParent.cloneChildren(&other);
     
    8076        fDefaultAttributes = ((DOMAttrMapImpl *)other.getDefaultAttributes())->cloneAttrMap(this);
    8177    }
    82 
    83     if (!fDefaultAttributes)
     78    else
     79    {
    8480        setupDefaultAttributes();
    85 
    86     if (!fDefaultAttributes)
    87         fDefaultAttributes = new (fParent.fOwnerDocument) DOMAttrMapImpl(this);
    88 
    89     if (!fAttributes) {
    90         if (!fDefaultAttributes) {
    91             fAttributes = new (fParent.fOwnerDocument) DOMAttrMapImpl(this);
    92         }
    93         else {
    94             fAttributes = new (fParent.fOwnerDocument) DOMAttrMapImpl(this, fDefaultAttributes);
    95         }
     81    }
     82
     83    if (!fAttributes)
     84    {
     85        fAttributes = new (fParent.fOwnerDocument) DOMAttrMapImpl(this, fDefaultAttributes);
    9686    }
    9787
     
    114104
    115105
    116 const XMLCh * DOMElementImpl::getNodeName() const {
     106const XMLCh * DOMElementImpl::getNodeName() const
     107{
    117108    return fName;
    118109}
    119110
    120111
    121 DOMNode::NodeType DOMElementImpl::getNodeType() const {
     112DOMNode::NodeType DOMElementImpl::getNodeType() const
     113{
    122114    return DOMNode::ELEMENT_NODE;
    123115}
     
    143135DOMNamedNodeMap *DOMElementImpl::getAttributes() const
    144136{
    145     DOMElementImpl *ncThis = (DOMElementImpl *)this;   // cast off const
    146     return ncThis->fAttributes;
     137    return const_cast<DOMElementImpl *>(this)->fAttributes;
    147138}
    148139
     
    151142DOMNodeList *DOMElementImpl::getElementsByTagName(const XMLCh *tagname) const
    152143{
     144    DEBUG_MESSAGE("DOMElementImpl::getElementsByTagName(" << tagname << ')')
     145
    153146    DOMDocumentImpl *docImpl = (DOMDocumentImpl *)fParent.fOwnerDocument;
    154147    return docImpl->getDeepNodeList(this,tagname);
     
    389382
    390383
    391 DOMNodeList *DOMElementImpl::getElementsByTagNameNS(const XMLCh *namespaceURI,
    392     const XMLCh *localName) const
    393 {
     384DOMNodeList *DOMElementImpl::getElementsByTagNameNS(const XMLCh *namespaceURI, const XMLCh *localName) const
     385{
     386    DEBUG_MESSAGE("DOMElementImpl::getElementsByTagNameNS(" << namespaceURI << ',' << localName << ')')
     387
    394388    DOMDocumentImpl *docImpl = (DOMDocumentImpl *)fParent.fOwnerDocument;
    395389    return docImpl->getDeepNodeList(this, namespaceURI, localName);
     
    408402
    409403
    410 bool DOMElementImpl::hasAttributeNS(const XMLCh *namespaceURI,
    411     const XMLCh *localName) const
     404bool DOMElementImpl::hasAttributeNS(const XMLCh *namespaceURI, const XMLCh *localName) const
    412405{
    413406    return (getAttributeNodeNS(namespaceURI, localName) != 0);
     
    419412DOMAttrMapImpl *DOMElementImpl::getDefaultAttributes() const
    420413{
     414    if (unlikely(fDefaultAttributes == 0))
     415    {
     416        DOMDocumentImpl * docImpl = (DOMDocumentImpl *)fParent.fOwnerDocument;
     417        const_cast<DOMElementImpl*>(this)->fDefaultAttributes = new (docImpl) DOMAttrMapImpl(const_cast<DOMElementImpl*>(this));
     418    }
    421419    return fDefaultAttributes;
    422420}
     
    447445
    448446    // This will throw INUSE if necessary
    449     DOMAttr *oldAttr = (DOMAttr *) fDefaultAttributes->setNamedItem(newAttr);
     447    DOMAttr *oldAttr = (DOMAttr *)getDefaultAttributes()->setNamedItem(newAttr);
    450448    fAttributes->hasDefaults(true);
    451449
     
    464462
    465463    // This will throw INUSE if necessary
    466     DOMAttr *oldAttr = (DOMAttr *) fDefaultAttributes->setNamedItemNS(newAttr);
     464    DOMAttr *oldAttr = (DOMAttr *)getDefaultAttributes()->setNamedItemNS(newAttr);
    467465    fAttributes->hasDefaults(true);
    468466
  • icXML/icXML-devel/src/xercesc/framework/LocalFileInputSource.cpp

    r2722 r3565  
    111111    : InputSource(manager)
    112112{
    113 
    114113    //
    115114    //  If the path is relative, then complete it acording to the current
     
    148147    }
    149148
     149
     150
    150151}
    151152
  • icXML/icXML-devel/src/xercesc/framework/XMLBufferMgr.cpp

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

    r3103 r3565  
    1717
    1818/**
    19  * $Id: XMLFormatter.cpp 901107 2010-01-20 08:45:02Z borisk $
     19 * $Id: XMLFormatter.cpp 1226891 2012-01-03 17:34:38Z amassari $
    2020 */
    2121
     
    242242    fOutEncoding = XMLString::replicate(outEncoding, fMemoryManager);
    243243
    244 
    245244    fIsXML11 = XMLString::equals(docVersion, XMLUni::fgVersion1_1);
    246245}
     
    419418    {
    420419        //
    421         //  Escape chars that require it according tot he scale flags
     420        //  Escape chars that require it according to the scale flags
    422421        //  we were given. For the others, try to accumulate them and
    423422        //  format them in as big as bulk as we can.
  • icXML/icXML-devel/src/xercesc/framework/XMLFormatter.hpp

    r2722 r3565  
    1717
    1818/*
    19  * $Id: XMLFormatter.hpp 932887 2010-04-11 13:04:59Z borisk $
     19 * $Id: XMLFormatter.hpp 932889 2010-04-11 13:10:10Z borisk $
    2020 */
    2121
  • icXML/icXML-devel/src/xercesc/framework/XMLRecognizer.cpp

    r2722 r3565  
    8787// ---------------------------------------------------------------------------
    8888XMLRecognizer::Encodings
    89 XMLRecognizer::basicEncodingProbe(  const   XMLByte* const  rawBuffer
    90                                     , const XMLSize_t       rawByteCount)
     89XMLRecognizer::basicEncodingProbe( const   XMLByte* const  rawBuffer
     90                                 , const XMLSize_t         rawByteCount)
    9191{
    9292    //
     
    197197
    198198
     199
    199200XMLRecognizer::Encodings
    200201XMLRecognizer::encodingForName(const XMLCh* const encName)
  • icXML/icXML-devel/src/xercesc/framework/XMLValidator.cpp

    r2722 r3565  
    8181        //  sort (i.e. it will ignore internal entities.
    8282        //
    83         ReaderMgr::LastExtEntityInfo lastInfo;
    84         fReaderMgr->getLastExtEntityInfo(lastInfo);
     83        Locator::LocationInfo lastInfo;
     84        fLocator->getLocationInfo(lastInfo);
    8585
    8686        fErrorReporter->error
     
    139139        //  sort (i.e. it will ignore internal entities.
    140140        //
    141         ReaderMgr::LastExtEntityInfo lastInfo;
    142         fReaderMgr->getLastExtEntityInfo(lastInfo);
     141        Locator::LocationInfo lastInfo;
     142        fLocator->getLocationInfo(lastInfo);
    143143
    144144        fErrorReporter->error
     
    197197        //  sort (i.e. it will ignore internal entities.
    198198        //
    199         ReaderMgr::LastExtEntityInfo lastInfo;
    200         fReaderMgr->getLastExtEntityInfo(lastInfo);
     199        Locator::LocationInfo lastInfo;
     200        fLocator->getLocationInfo(lastInfo);
    201201
    202202        fErrorReporter->error
     
    256256        //  sort (i.e. it will ignore internal entities.
    257257        //
    258         ReaderMgr::LastExtEntityInfo lastInfo;
    259         fReaderMgr->getLastExtEntityInfo(lastInfo);
     258        Locator::LocationInfo lastInfo;
     259        fLocator->getLocationInfo(lastInfo);
    260260
    261261        fErrorReporter->error
     
    285285//  XMLValidator: Hidden Constructors
    286286// ---------------------------------------------------------------------------
    287 XMLValidator::XMLValidator(XMLErrorReporter* const errReporter) :
    288 
    289     fBufMgr(0)
    290     , fErrorReporter(errReporter)
    291     , fReaderMgr(0)
    292     , fScanner(0)
     287XMLValidator::XMLValidator(XMLErrorReporter* const errReporter)
     288: fBufMgr(0)
     289, fErrorReporter(errReporter)
     290//, fReaderMgr(0)
     291, fLocator(0)
     292, fScanner(0)
    293293{
    294294}
  • icXML/icXML-devel/src/xercesc/framework/psvi/PSVIAttribute.cpp

    r2722 r3565  
    2424XERCES_CPP_NAMESPACE_BEGIN
    2525
    26 PSVIAttribute::PSVIAttribute( MemoryManager* const manager )
    27         PSVIItem(manager)
    28         , fAttributeDecl(0)
    29         , fDV(0)
     26PSVIAttribute::PSVIAttribute( MemoryManager* const manager )
     27: PSVIItem(manager)
     28, fAttributeDecl(0)
     29, fDV(0)
    3030{
    3131}
    3232
    33 void PSVIAttribute::reset(
    34             const XMLCh * const         valContext
    35             , PSVIItem::VALIDITY_STATE  state
    36             , PSVIItem::ASSESSMENT_TYPE assessmentType
    37             , XSSimpleTypeDefinition *  validatingType
    38             , XSSimpleTypeDefinition *  memberType
    39             , const XMLCh * const       defaultValue
    40             , const bool                isSpecified
    41             , XSAttributeDeclaration *  attrDecl
    42             , DatatypeValidator *dv
    43         )
     33void PSVIAttribute::reset
     34(
     35    const XMLCh * const         valContext
     36    , PSVIItem::VALIDITY_STATE  state
     37    , PSVIItem::ASSESSMENT_TYPE assessmentType
     38    , XSSimpleTypeDefinition *  validatingType
     39    , XSSimpleTypeDefinition *  memberType
     40    , const XMLCh * const       defaultValue
     41    , const bool                isSpecified
     42    , XSAttributeDeclaration *  attrDecl
     43    , DatatypeValidator      *  dv
     44)
    4445{
    4546    fValidationContext = valContext;
     
    5960void PSVIAttribute::setValue(const XMLCh * const       normalizedValue)
    6061{
    61     if(normalizedValue)
     62    if (normalizedValue)
    6263    {
    6364        fNormalizedValue = normalizedValue;
    64         if(fDV && fValidityState == PSVIItem::VALIDITY_VALID)
     65        if (fDV && fValidityState == PSVIItem::VALIDITY_VALID)
    6566            fCanonicalValue = (XMLCh *)fDV->getCanonicalRepresentation(normalizedValue, fMemoryManager);
    6667    }
  • icXML/icXML-devel/src/xercesc/framework/psvi/PSVIAttribute.hpp

    r2722 r3565  
    150150    DatatypeValidator *         fDV;
    151151};
     152
    152153inline PSVIAttribute::~PSVIAttribute()
    153154{
  • icXML/icXML-devel/src/xercesc/framework/psvi/PSVIAttributeList.cpp

    r2722 r3565  
    2626XERCES_CPP_NAMESPACE_BEGIN
    2727
    28 PSVIAttributeList::PSVIAttributeList( MemoryManager* const manager ):
    29     fMemoryManager(manager)
    30   , fAttrList(0)
    31   , fAttrPos(0)
     28PSVIAttributeList::PSVIAttributeList( MemoryManager* const manager )
     29: fAttrList(10, true, manager)
     30, fAttrCount(0)
     31, fMemoryManager(manager)
    3232{
    33     fAttrList= new (fMemoryManager) RefVectorOf<PSVIAttributeStorage> (10, true, fMemoryManager);
     33
    3434}
    3535
     
    4040XMLSize_t PSVIAttributeList::getLength() const
    4141{
    42     return fAttrPos;
     42    return fAttrCount;
    4343}
    4444
     
    5353PSVIAttribute *PSVIAttributeList::getAttributePSVIAtIndex(const XMLSize_t index)
    5454{
    55     if(index >= fAttrPos)
     55    if(index >= fAttrCount)
    5656        return 0;
    57     return fAttrList->elementAt(index)->fPSVIAttribute;
     57    return fAttrList.elementAt(index)->fPSVIAttribute;
    5858}
    5959
     
    6969{
    7070
    71     if(index >= fAttrPos)
     71    if(index >= fAttrCount)
    7272        return 0;
    73     return fAttrList->elementAt(index)->fAttributeName;
     73    return fAttrList.elementAt(index)->fAttributeName;
    7474}
    7575
     
    8484const XMLCh *PSVIAttributeList::getAttributeNamespaceAtIndex(const XMLSize_t index)
    8585{
    86     if(index >= fAttrPos)
     86    if(index >= fAttrCount)
    8787        return 0;
    88     return fAttrList->elementAt(index)->fAttributeNamespace;
     88    return fAttrList.elementAt(index)->fAttributeNamespace;
    8989}
    9090
     
    9999                , const XMLCh * attrNamespace)
    100100{
    101     for (XMLSize_t index=0; index < fAttrPos; index++) {
    102         PSVIAttributeStorage* storage = fAttrList->elementAt(index);
     101    for (XMLSize_t index=0; index < fAttrCount; index++) {
     102        PSVIAttributeStorage* storage = fAttrList.elementAt(index);
    103103        if (XMLString::equals(attrName,storage->fAttributeName) &&
    104104            XMLString::equals(attrNamespace,storage->fAttributeNamespace))
  • icXML/icXML-devel/src/xercesc/framework/psvi/PSVIAttributeList.hpp

    r2722 r3565  
    128128     * @return null if the attribute PSVI does not exist
    129129     */
    130     PSVIAttribute *getAttributePSVIByName(const XMLCh *attrName
    131                     , const XMLCh * attrNamespace);
     130    PSVIAttribute *getAttributePSVIByName(const XMLCh *attrName, const XMLCh * attrNamespace);
    132131
    133132    //@}
     
    146145      * @return             new, uninitialized, PSVIAttribute object
    147146      */
    148     PSVIAttribute *getPSVIAttributeToFill(
    149             const XMLCh * attrName
    150             , const XMLCh * attrNS);
     147    PSVIAttribute *getPSVIAttributeToFill(const XMLCh * attrName, const XMLCh * attrNS);
     148
     149    PSVIAttribute *getPSVIAttributeToFill(const XMLSize_t index, const XMLCh * attrName, const XMLCh * attrNS);
     150
     151
     152    void setPSVIMaxAttributeCount(const XMLSize_t maxAttributeCount);
    151153
    152154    /**
     
    154156      */
    155157    void reset();
     158
     159    void setAttributeCount(XMLSize_t attributeCount);
    156160
    157161    //@}
     
    174178    //  list of PSVIAttributes contained by this object
    175179    // fAttrPos
    176     //  current number of initialized PSVIAttributes in fAttrList
     180    //  current number of initialized PSVIAttributes in fAttrList   
     181    RefVectorOf<PSVIAttributeStorage>   fAttrList;
     182    XMLSize_t                           fAttrCount;
    177183    MemoryManager*                      fMemoryManager;
    178     RefVectorOf<PSVIAttributeStorage>*  fAttrList;
    179     XMLSize_t                           fAttrPos;
    180184};
    181185
    182186inline PSVIAttributeList::~PSVIAttributeList()
    183187{
    184     delete fAttrList;
    185 }
    186 
    187 inline PSVIAttribute *PSVIAttributeList::getPSVIAttributeToFill(
    188             const XMLCh *attrName
    189             , const XMLCh * attrNS)
    190 {
    191     PSVIAttributeStorage* storage = 0;
    192     if(fAttrPos == fAttrList->size())
    193     {
    194         storage = new (fMemoryManager) PSVIAttributeStorage();
    195         storage->fPSVIAttribute = new (fMemoryManager) PSVIAttribute(fMemoryManager);
    196         fAttrList->addElement(storage);
    197     }
    198     else
    199     {
    200         storage = fAttrList->elementAt(fAttrPos);
    201     }
     188
     189}
     190
     191inline PSVIAttribute *PSVIAttributeList::getPSVIAttributeToFill(const XMLSize_t index, const XMLCh *attrName, const XMLCh * attrNS)
     192{
     193    PSVIAttributeStorage* storage = fAttrList.elementAt(index);
    202194    storage->fAttributeName = attrName;
    203195    storage->fAttributeNamespace = attrNS;
    204     fAttrPos++;
    205196    return storage->fPSVIAttribute;
    206197}
    207198
     199inline void PSVIAttributeList::setAttributeCount(const XMLSize_t attributeCount)
     200{
     201    fAttrCount = attributeCount;
     202}
     203
     204inline void PSVIAttributeList::setPSVIMaxAttributeCount(const XMLSize_t maxAttributeCount)
     205{
     206    if (unlikely(maxAttributeCount > fAttrList.size()))
     207    {
     208        XMLSize_t count = maxAttributeCount - fAttrList.size();
     209        do
     210        {
     211            PSVIAttributeStorage * storage = new (fMemoryManager) PSVIAttributeStorage();
     212            storage->fPSVIAttribute = new (fMemoryManager) PSVIAttribute(fMemoryManager);
     213            fAttrList.addElement(storage);
     214        }
     215        while (--count);
     216    }
     217}
     218
    208219inline void PSVIAttributeList::reset()
    209220{
    210     fAttrPos = 0;
     221    fAttrCount = 0;
     222}
     223
     224inline PSVIAttribute *PSVIAttributeList::getPSVIAttributeToFill(const XMLCh *, const XMLCh *)
     225{
     226    DEPRECATED_FEATURE_IN_ICXML;
    211227}
    212228
  • icXML/icXML-devel/src/xercesc/framework/psvi/PSVIElement.cpp

    r2722 r3565  
    3737PSVIElement::~PSVIElement()
    3838{
    39     fMemoryManager->deallocate(fCanonicalValue);
     39
    4040}
    4141
     
    8585    fDefaultValue = defaultValue;
    8686    fNormalizedValue = normalizedValue;
    87     fMemoryManager->deallocate(fCanonicalValue);
    8887    fCanonicalValue = canonicalValue;
    8988}
  • icXML/icXML-devel/src/xercesc/framework/psvi/PSVIItem.cpp

    r2722 r3565  
    4141}
    4242
    43 void PSVIItem::reset(
    44             const XMLCh* const validationContext
    45             , const XMLCh* const normalizedValue
    46             , const VALIDITY_STATE validityState
    47             , const ASSESSMENT_TYPE assessmentType
    48         )
     43void PSVIItem::reset
     44(
     45const XMLCh* const validationContext
     46, const XMLCh* const normalizedValue
     47, const VALIDITY_STATE validityState
     48, const ASSESSMENT_TYPE assessmentType
     49)
    4950{
    5051    // this is just a wrapper method; fValidationContext will
     
    7980        return 0;
    8081   
     82    DEBUG_MESSAGE(" -- fType=" << fType)
     83
    8184    /***
    8285     *  XSSimpleType or
     
    131134     XSValue::Status  status=XSValue::st_Init;
    132135
    133      return XSValue::getActualValue(fNormalizedValue
    134                                   , XSValue::getDataType(basedv->getTypeLocalName())
    135                                   , status
    136                                   , XSValue::ver_10
    137                                   , false
    138                                   , fMemoryManager);
     136     XSValue::DataType dataType = XSValue::getDataType(basedv->getTypeLocalName());
    139137
     138     XSValue * value = XSValue::getActualValue(fNormalizedValue, dataType, status, XSValue::ver_10, false, fMemoryManager);
    140139
     140     return value;
    141141}
    142142
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSAnnotation.cpp

    r2722 r3565  
    2929#include <xercesc/parsers/XercesDOMParser.hpp>
    3030#include <xercesc/dom/DOMElement.hpp>
     31#include <icxercesc/framework/XMLGrammarPool.hpp>
    3132
    3233XERCES_CPP_NAMESPACE_BEGIN
    3334
    34 XSAnnotation::XSAnnotation(const XMLCh*          const content,
    35                                  MemoryManager * const manager)
     35XSAnnotation::XSAnnotation
     36(
     37    const XMLCh*          const content
     38    , XMLGrammarPool *          grammarPool
     39    , MemoryManager * const     manager
     40)
    3641:XSObject(XSConstants::ANNOTATION, 0, manager)
    3742,fContents(XMLString::replicate(content, manager))
    3843,fNext(0)
    3944,fSystemId(0)
     45,fGrammarPool(grammarPool)
    4046,fLine(0)
    4147,fCol(0)
    4248{
     49
    4350}
    4451
     
    4855,fNext(0)
    4956,fSystemId(0)
     57,fGrammarPool(0)
    5058,fLine(0)
    5159,fCol(0)
     
    6674void XSAnnotation::writeAnnotation(DOMNode* node, ANNOTATION_TARGET targetType)
    6775{
    68     XercesDOMParser *parser = new (fMemoryManager) XercesDOMParser(0, fMemoryManager);
     76    XercesDOMParser *parser = new (fMemoryManager) XercesDOMParser(0, fMemoryManager, fGrammarPool);
    6977    parser->setDoNamespaces(true);
    7078    parser->setValidationScheme(XercesDOMParser::Val_Never);
     
    7381        ((DOMElement*)node)->getOwnerDocument() :
    7482        (DOMDocument*)node;
     83
     84    MemBufInputSource* memBufIS = new (fMemoryManager) MemBufInputSource
     85    (
     86        (const XMLByte*)fContents
     87        , XMLString::stringLen(fContents) * sizeof(XMLCh)
     88        , ""
     89        , false
     90        , fMemoryManager
     91    );
     92    memBufIS->setEncoding(XMLUni::fgXMLChEncodingString);
     93    memBufIS->setCopyBufToStream(false);
     94
     95    try
     96    {
     97        parser->parse(*memBufIS);
     98    }
     99    catch (const XMLException&)
     100    {
     101        // REVISIT:  should we really eat this?
     102    }
     103
     104    DOMNode* newElem = futureOwner->importNode((parser->getDocument())->getDocumentElement(), true);
     105    node->insertBefore(newElem, node->getFirstChild());
     106
     107    delete parser;
     108    delete memBufIS;
     109}
     110
     111
     112void XSAnnotation::writeAnnotation(ContentHandler* handler)
     113{
     114    SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(fMemoryManager);
     115    parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
     116    parser->setFeature(XMLUni::fgSAX2CoreValidation, false);
     117    parser->setContentHandler(handler);
    75118
    76119    MemBufInputSource* memBufIS = new (fMemoryManager) MemBufInputSource
     
    91134    catch (const XMLException&)
    92135    {
    93         // REVISIT:  should we really eat this?
    94     }
    95 
    96     DOMNode* newElem = futureOwner->importNode((parser->getDocument())->getDocumentElement(), true);
    97     node->insertBefore(newElem, node->getFirstChild());
    98 
    99     delete parser;
    100     delete memBufIS;
    101 }
    102 
    103 
    104 void XSAnnotation::writeAnnotation(ContentHandler* handler)
    105 {
    106     SAX2XMLReader* parser = XMLReaderFactory::createXMLReader(fMemoryManager);
    107     parser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true);
    108     parser->setFeature(XMLUni::fgSAX2CoreValidation, false);
    109     parser->setContentHandler(handler);
    110 
    111     MemBufInputSource* memBufIS = new (fMemoryManager) MemBufInputSource
    112     (
    113         (const XMLByte*)fContents
    114         , XMLString::stringLen(fContents)*sizeof(XMLCh)
    115         , ""
    116         , false
    117         , fMemoryManager
    118     );
    119     memBufIS->setEncoding(XMLUni::fgXMLChEncodingString);
    120     memBufIS->setCopyBufToStream(false);
    121 
    122     try
    123     {
    124         parser->parse(*memBufIS);
    125     }
    126     catch (const XMLException&)
    127     {
    128136    }
    129137
     
    188196}
    189197
     198XSAnnotation::XSAnnotation(const XMLCh* const, MemoryManager * const)
     199:XSObject(XSConstants::ANNOTATION, 0, 0)
     200{
     201    DEPRECATED_FEATURE_IN_ICXML;
     202}
     203
    190204XERCES_CPP_NAMESPACE_END
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSAnnotation.hpp

    r2722 r3565  
    3838class DOMNode;
    3939class ContentHandler;
     40class XMLGrammarPool;
    4041
    4142class XMLPARSER_EXPORT XSAnnotation : public XSerializable, public XSObject
     
    6869    XSAnnotation
    6970    (
    70         const XMLCh* const contents
    71         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     71        const XMLCh* const      contents
     72        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     73    );
     74
     75    XSAnnotation
     76    (
     77        const XMLCh* const      contents
     78        , XMLGrammarPool *      grammarPool
     79        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
    7280    );
    7381
     
    153161    //  data members
    154162    // -----------------------------------------------------------------------
    155     XMLCh*        fContents;
    156     XSAnnotation* fNext;
     163    XMLCh*                  fContents;
     164    XSAnnotation*           fNext;
    157165
    158166private:
    159167
    160     XMLCh*        fSystemId;
    161     XMLFileLoc    fLine;
    162     XMLFileLoc    fCol;
     168    XMLGrammarPool *        fGrammarPool;
     169    XMLCh*                  fSystemId;
     170    XMLFileLoc              fLine;
     171    XMLFileLoc              fCol;
    163172
    164173};
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSAttributeDeclaration.cpp

    r3103 r3565  
    6464const XMLCh *XSAttributeDeclaration::getNamespace()
    6565{
    66     return fXSModel->getURIStringPool()->getValueForId(fAttDef->getAttName()->getURI());
     66    return fXSModel->getURIText(fAttDef->getAttName()->getURI());
    6767}
    6868
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSAttributeGroupDefinition.cpp

    r2722 r3565  
    4545    , fAnnotation(xsAnnot)
    4646{
     47
    4748}
    4849
    4950XSAttributeGroupDefinition::~XSAttributeGroupDefinition()
    5051{
    51     if (fXSAttributeUseList)
    52         delete fXSAttributeUseList;
    53 
     52    delete fXSAttributeUseList;
    5453    // don't delete fXSWildcard - deleted by XSModel
    5554}
     
    5857const XMLCh *XSAttributeGroupDefinition::getName() const
    5958{
    60     return fXSModel->getURIStringPool()->getValueForId(fXercesAttGroupInfo->getNameId());       
     59    return fXSModel->getURIText(fXercesAttGroupInfo->getNameId());
    6160}
    6261
    6362const XMLCh *XSAttributeGroupDefinition::getNamespace()
    6463{
    65     return fXSModel->getURIStringPool()->getValueForId(fXercesAttGroupInfo->getNamespaceId());
     64    return fXSModel->getURIText(fXercesAttGroupInfo->getNamespaceId());
    6665}
    6766
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSElementDeclaration.cpp

    r3153 r3565  
    9999const XMLCh *XSElementDeclaration::getNamespace()
    100100{
    101     return fXSModel->getURIStringPool()->getValueForId(fSchemaElementDecl->getURI());
     101    return fXSModel->getURIText(fSchemaElementDecl->getURI());
    102102}
    103103
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSIDCDefinition.cpp

    r2722 r3565  
    7979const XMLCh *XSIDCDefinition::getNamespace()
    8080{
    81     return fXSModel->getURIStringPool()->getValueForId(fIdentityConstraint->getNamespaceURI());
     81    return fXSModel->getURIText(fIdentityConstraint->getNamespaceURI());
    8282}
    8383
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSModel.cpp

    r3103 r3565  
    3434#include <xercesc/framework/psvi/XSComplexTypeDefinition.hpp>
    3535#include <xercesc/framework/psvi/XSModelGroupDefinition.hpp>
     36#include <xercesc/framework/psvi/XSNamedMap.hpp>
     37#include <typeinfo>
     38
    3639
    3740XERCES_CPP_NAMESPACE_BEGIN
     
    4043//  XSModel: Constructors and Destructor
    4144// ---------------------------------------------------------------------------
    42 XSModel::XSModel( XMLGrammarPool *grammarPool
    43                 , MemoryManager* const manager)
    44     : fMemoryManager(manager)
    45     , fNamespaceStringList(0)
    46     , fXSNamespaceItemList(0)
    47     , fURIStringPool(0)
    48     , fXSAnnotationList(0)
    49     , fHashNamespace(0)
    50     , fObjFactory(0)
    51     , fDeleteNamespace(0)
    52     , fParent(0)
    53     , fDeleteParent(false)
    54     , fAddedS4SGrammar(false)
    55 {
    56     fURIStringPool = grammarPool->getURIStringPool();
     45XSModel::XSModel
     46(
     47    XMLGrammarPool *            grammarPool
     48    , MemoryManager* const      manager
     49)
     50: fMemoryManager(manager)
     51, fNamespaceStringList(0)
     52, fXSNamespaceItemList(0)
     53, fURIStringPool(grammarPool->getURIStringPool())
     54, fStringPool(grammarPool->getStringPool())
     55, fXSAnnotationList(0)
     56, fHashNamespace(0)
     57, fObjFactory(0)
     58, fDeleteNamespace(0)
     59, fParent(0)
     60// , fGrammarPool(grammarPool)
     61, fDeleteParent(false)
     62, fAddedS4SGrammar(false)
     63{
    5764    fObjFactory = new (fMemoryManager) XSObjectFactory(manager);
    5865
     
    7279                    20,     // size
    7380                    29,     // modulus
    74                     fURIStringPool,
     81                    this,
    7582                    false,  // adoptElems
    7683                    fMemoryManager
     
    120127    // Now loop through all of the NamespaceItem's
    121128    // First, we add S4S namespace (irrespective of whether we have any grammars)
    122     namespaceItem = new (manager) XSNamespaceItem
    123     (
    124         this, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, manager
    125     );
    126 
    127     fNamespaceStringList->addElement
    128     (
    129         XMLString::replicate(SchemaSymbols::fgURI_SCHEMAFORSCHEMA,manager)
    130     );
     129    namespaceItem = new (manager) XSNamespaceItem(this, SchemaSymbols::fgURI_SCHEMAFORSCHEMA, manager);
     130
     131    fNamespaceStringList->addElement(XMLString::replicate(SchemaSymbols::fgURI_SCHEMAFORSCHEMA,manager));
     132
    131133    fXSNamespaceItemList->addElement(namespaceItem);
    132     fHashNamespace->put
    133     (
    134         (void*) SchemaSymbols::fgURI_SCHEMAFORSCHEMA
    135         , namespaceItem
    136     );
     134
     135    fHashNamespace->put((void*) SchemaSymbols::fgURI_SCHEMAFORSCHEMA, namespaceItem);
    137136
    138137    DatatypeValidatorFactory dvFactory(manager);
     
    142141        , dvFactory.getBuiltInRegistry()
    143142    );
     143
    144144    // don't include  S4S (thus the -1)
    145     XMLSize_t numberOfNamespaces = fXSNamespaceItemList->size() -1;
    146     for (XMLSize_t j = 0; j < numberOfNamespaces; j++)
     145    XMLSize_t toAdd = fXSNamespaceItemList->size() - 1;
     146    for (XMLSize_t j = 0; j < toAdd--; j++)
     147    {
    147148        addGrammarToXSModel(fXSNamespaceItemList->elementAt(j));
    148 }
    149 
    150 XSModel::XSModel( XSModel *baseModel
    151                 , GrammarResolver *grammarResolver
    152                 , MemoryManager* const manager)
    153     : fMemoryManager(manager)
    154     , fNamespaceStringList(0)
    155     , fXSNamespaceItemList(0)
    156     , fURIStringPool(0)
    157     , fXSAnnotationList(0)
    158     , fHashNamespace(0)
    159     , fObjFactory(0)
    160     , fDeleteNamespace(0)
    161     , fParent(baseModel)
    162     , fDeleteParent(true)
    163     , fAddedS4SGrammar(false)
    164 {
    165     fURIStringPool = grammarResolver->getStringPool();
     149    }
     150
     151}
     152
     153XSModel::XSModel
     154(
     155    XSModel *                   baseModel
     156    , GrammarResolver *         grammarResolver
     157    , MemoryManager* const      manager
     158)
     159: fMemoryManager(manager)
     160, fNamespaceStringList(0)
     161, fXSNamespaceItemList(0)
     162, fURIStringPool(baseModel ? baseModel->fURIStringPool : grammarResolver->getURIStringPool())
     163, fStringPool(baseModel ? baseModel->fStringPool : grammarResolver->getStringPool())
     164, fXSAnnotationList(0)
     165, fHashNamespace(0)
     166, fObjFactory(0)
     167, fDeleteNamespace(0)
     168, fParent(baseModel)
     169// , fGrammarPool(baseModel ? baseModel->fGrammarPool : grammarResolver->getGrammarPool())
     170, fDeleteParent(true)
     171, fAddedS4SGrammar(false)
     172{
    166173    fObjFactory = new (manager) XSObjectFactory(manager);
    167174
    168     XMLSize_t i;
    169175    // Populate XSNamedMaps by going through the components
    170     for (i=0; i<XSConstants::MULTIVALUE_FACET; i++)
    171     {
    172         switch (i+1)
     176    for (XMLSize_t i = 0; i < XSConstants::MULTIVALUE_FACET; i++)
     177    {
     178        switch (i + 1)
    173179        {
    174180            case XSConstants::ATTRIBUTE_DECLARATION:
     
    182188                    20,     // size
    183189                    29,     // modulus
    184                     fURIStringPool,
     190                    this,
    185191                    false,  // adoptElems
    186192                    fMemoryManager
     
    214220
    215221        // Need to copy information from parent so it can be returned in this object...
    216         for (i=0; i<fParent->fXSNamespaceItemList->size(); i++)
     222        for (XMLSize_t i = 0; i < fParent->fXSNamespaceItemList->size(); i++)
    217223        {
    218224            XSNamespaceItem* namespaceItem = fParent->fXSNamespaceItemList->elementAt(i);
     
    227233        }
    228234
    229         for (i=0; i<XSConstants::MULTIVALUE_FACET; i++)
    230         {
    231             switch (i+1)
     235        for (XMLSize_t i = 0; i < XSConstants::MULTIVALUE_FACET; i++)
     236        {
     237            switch (i + 1)
    232238            {
    233239                case XSConstants::ATTRIBUTE_DECLARATION:
     
    237243                case XSConstants::MODEL_GROUP_DEFINITION:
    238244                case XSConstants::NOTATION_DECLARATION:
    239                     for (XMLSize_t j=0; j<fParent->fComponentMap[i]->getLength(); j++)
     245                    for (XMLSize_t j = 0; j < fParent->fComponentMap[i]->getLength(); j++)
    240246                    {
    241247                        XSObject* copyObj = fParent->fComponentMap[i]->item(j);
     
    252258        }
    253259
    254         for (i=0; i<fParent->fXSAnnotationList->size(); i++)
     260        for (XMLSize_t i = 0; i < fParent->fXSAnnotationList->size(); i++)
    255261        {
    256262            fXSAnnotationList->addElement(fParent->fXSAnnotationList->elementAt(i));
     
    263269    ValueVectorOf<SchemaGrammar*>* grammarsToAdd = grammarResolver->getGrammarsToAddToXSModel();
    264270    XMLSize_t numberOfNamespaces = fXSNamespaceItemList->size();
    265     XMLSize_t numberOfNamespacesToAdd = 0;
    266     for (i=0; i < grammarsToAdd->size(); i++)
     271    XMLSize_t toAdd = grammarsToAdd->size();
     272    for (XMLSize_t i = 0; i < toAdd; i++)
    267273    {
    268274        SchemaGrammar* lGrammar = grammarsToAdd->elementAt(i);
     
    278284        fHashNamespace->put(NameSpace, namespaceItem);
    279285        fDeleteNamespace->addElement(namespaceItem);
    280         ++numberOfNamespacesToAdd;
    281286    }
    282287
     
    309314
    310315    // Now loop through all of the newly created NamespaceItem's
    311     for (i=numberOfNamespaces; i<(numberOfNamespaces+numberOfNamespacesToAdd); i++)
     316    for (XMLSize_t i = numberOfNamespaces; toAdd--; i++)
    312317    {
    313318        addGrammarToXSModel(fXSNamespaceItemList->elementAt(i));
     
    317322XSModel::~XSModel()
    318323{
    319     for (XMLSize_t i=0; i<XSConstants::MULTIVALUE_FACET; i++)
     324    for (XMLSize_t i=0; i < XSConstants::MULTIVALUE_FACET; i++)
    320325    {
    321326        switch (i+1)
     
    357362
    358363
    359 void XSModel::addComponentToNamespace(XSNamespaceItem* const namespaceItem,
    360                                       XSObject* const component,
    361                                       XMLSize_t componentIndex,
    362                                       bool addToXSModel)
     364void XSModel::addComponentToNamespace
     365(
     366    XSNamespaceItem* const  namespaceItem
     367    , XSObject* const       component
     368    , XMLSize_t             componentIndex
     369    , bool                  addToXSModel
     370)
    363371{
    364372    namespaceItem->fComponentMap[componentIndex]->addElement
     
    366374        component, component->getName(), namespaceItem->getSchemaNamespace()
    367375    );
     376
    368377    namespaceItem->fHashMap[componentIndex]->put
    369378    (
     
    391400              ComplexTypeInfo::getAnyType
    392401              (
    393                   fURIStringPool->getId(XMLUni::fgZeroLenString)
     402                  XMLNamespaceResolver::fEmptyUriId // fURIStringPool->getId(XMLUni::fgZeroLenString)
    394403              )
    395404              , this
     
    532541        while (modelGroupEnum.hasMoreElements())
    533542        {
    534             addComponentToNamespace
    535             (
    536                 namespaceItem
    537                 , fObjFactory->createXSModelGroupDefinition
    538                   (
    539                       &(modelGroupEnum.nextElement()), this
    540                   )
    541                 , XSConstants::MODEL_GROUP_DEFINITION - 1
    542             );
     543            XSModelGroupDefinition * def = fObjFactory->createXSModelGroupDefinition(&(modelGroupEnum.nextElement()), this);
     544            addComponentToNamespace(namespaceItem, def, XSConstants::MODEL_GROUP_DEFINITION - 1);
    543545        } // end of model group loop
    544546    }
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSModel.hpp

    r3153 r3565  
    2525#include <icxercesc/util/PlatformUtils.hpp>
    2626#include <xercesc/framework/psvi/XSObject.hpp>
    27 #include <xercesc/framework/psvi/XSNamedMap.hpp>
    28 
    2927#include <xercesc/util/ValueVectorOf.hpp>
    3028#include <icxercesc/validators/schema/SchemaElementDecl.hpp>
     29#include <xercesc/util/StringPool.hpp>
     30#include <icxmlc/XMLNamespaceResolver.hpp>
     31#include <icxmlc/XMLConfig.hpp>
    3132
    3233XERCES_CPP_NAMESPACE_BEGIN
     
    5657class XSTypeDefinition;
    5758class XSObjectFactory;
     59template <class TVal> class XSNamedMap;
    5860
    5961class XMLPARSER_EXPORT XSModel : public XMemory
    6062{
     63    friend class XSObjectFactory;
     64    friend class XSObject;
     65    friend class XSAnnotation;
     66    friend class XSModelGroupDefinition;
     67
    6168public:
    6269
     
    229236    //@{
    230237    XMLStringPool*  getURIStringPool();
     238
     239    const XMLCh * getURIText(const unsigned int uriId) const;
     240
     241    XMLCh * getURIText(const unsigned int uriId, MemoryManager * manager) const;
     242
     243    unsigned int getNamespaceId(const XMLCh * uri) const;
    231244
    232245    XSNamespaceItem* getNamespaceItem(const XMLCh* const key);
     
    277290
    278291protected:
    279     friend class XSObjectFactory;
    280     friend class XSObject;
    281292
    282293    // -----------------------------------------------------------------------
     
    309320    */
    310321    XSNamedMap<XSObject>*                   fComponentMap[XSConstants::MULTIVALUE_FACET];
    311     XMLStringPool*                          fURIStringPool;
     322    XMLStringPool* const                    fURIStringPool;
     323    XMLStringPool* const                    fStringPool;
    312324    XSAnnotationList*                       fXSAnnotationList;
    313325    RefHashTableOf<XSNamespaceItem>*        fHashNamespace;
     
    324336}
    325337
     338inline const XMLCh * XSModel::getURIText(const unsigned int uriId) const
     339{
     340    return fURIStringPool->getValueForId(uriId);
     341}
     342
     343inline XMLCh * XSModel::getURIText(const unsigned int uriId, MemoryManager * manager) const
     344{
     345    return XMLString::replicate(getURIText(uriId), manager);
     346}
     347
     348inline unsigned int XSModel::getNamespaceId(const XMLCh * uri) const
     349{
     350    return fURIStringPool->getId(uri);
     351}
     352
    326353inline StringList *XSModel::getNamespaces()
    327354{
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSModelGroupDefinition.cpp

    r2722 r3565  
    5454const XMLCh *XSModelGroupDefinition::getName() const
    5555{
    56     return fXSModel->getURIStringPool()->getValueForId(fGroupInfo->getNameId());
     56    return fXSModel->fStringPool->getValueForId(fGroupInfo->getNameId());
    5757}
    5858
    5959const XMLCh *XSModelGroupDefinition::getNamespace()
    6060{
    61     return fXSModel->getURIStringPool()->getValueForId(fGroupInfo->getNamespaceId());
     61    return fXSModel->getURIText(fGroupInfo->getNamespaceId());
    6262}
    6363
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSNamedMap.c

    r2722 r3565  
    2727#include <xercesc/framework/psvi/XSNamedMap.hpp>
    2828#endif
    29 
    3029#include <xercesc/util/RefVectorOf.hpp>
    31 #include <xercesc/util/StringPool.hpp>
     30#include <xercesc/framework/psvi/XSModel.hpp>
     31#include <icxmlc/XMLConfig.hpp>
    3232
    3333XERCES_CPP_NAMESPACE_BEGIN
     
    3737// ---------------------------------------------------------------------------
    3838template <class TVal>
    39 XSNamedMap<TVal>::XSNamedMap(const XMLSize_t maxElems,
    40                              const XMLSize_t modulus,
    41                              XMLStringPool* uriStringPool,
    42                              const bool adoptElems,
    43                              MemoryManager* const manager)
    44     : fMemoryManager(manager)
    45     , fURIStringPool(uriStringPool)
     39XSNamedMap<TVal>::XSNamedMap
     40(
     41    const XMLSize_t         maxElems
     42    , const XMLSize_t       modulus
     43    , XSModel *             model
     44    , const bool            adoptElems
     45    , MemoryManager* const  manager
     46)
     47: fMemoryManager(manager)
     48, fXSModel(model)
    4649{
    4750    // allow one of the Vector or Hash to own the data... but not both...
     
    4952    fHash = new (manager) RefHash2KeysTableOf<TVal> (modulus, adoptElems, manager);
    5053}
     54
     55
    5156template <class TVal> XSNamedMap<TVal>::~XSNamedMap()
    5257{
     
    108113 */
    109114template <class TVal>
    110 TVal *XSNamedMap<TVal>::itemByName(const XMLCh *compNamespace,
    111                           const XMLCh *localName)
     115TVal *XSNamedMap<TVal>::itemByName(const XMLCh *compNamespace, const XMLCh *localName)
    112116{
    113     return fHash->get((void*)localName, fURIStringPool->getId(compNamespace));
     117    return fHash->get((void*)localName, fXSModel->getNamespaceId(compNamespace));
    114118}
    115119
     
    119123{
    120124    fVector->addElement(toAdd);
    121     fHash->put((void*)key1, fURIStringPool->getId(key2), toAdd);
     125    fHash->put((void*)key1, fXSModel->getNamespaceId(key2), toAdd);
     126}
     127
     128
     129template <class TVal>
     130XSNamedMap<TVal>::XSNamedMap(const XMLSize_t, const XMLSize_t, XMLStringPool*, const bool, MemoryManager* const)
     131{
     132    DEPRECATED_FEATURE_IN_ICXML;
    122133}
    123134
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSNamedMap.hpp

    r2722 r3565  
    2727#include <xercesc/util/RefHash2KeysTableOf.hpp>
    2828#include <xercesc/util/RefVectorOf.hpp>
     29#include <xercesc/framework/psvi/XSModel.hpp>
    2930
    3031XERCES_CPP_NAMESPACE_BEGIN
     
    5354        MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    5455    );
     56
     57    XSNamedMap(const XMLSize_t maxElems,
     58        const XMLSize_t modulus,
     59        XSModel * model,
     60        const bool adoptElems,
     61        MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     62    );
     63
    5564    //@}
    5665
     
    123132    //  manager used to allocate memory needed by this object
    124133    MemoryManager *const        fMemoryManager;
    125     XMLStringPool*              fURIStringPool;
     134    XSModel *                   fXSModel;
    126135    RefVectorOf<TVal>*          fVector;
    127136    RefHash2KeysTableOf<TVal>*  fHash;
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSNamespaceItem.cpp

    r3103 r3565  
    2222#include <xercesc/framework/psvi/XSNamespaceItem.hpp>
    2323#include <icxercesc/validators/schema/SchemaGrammar.hpp>
    24 #include <xercesc/framework/psvi/XSModel.hpp>
    2524#include <xercesc/framework/psvi/XSAnnotation.hpp>
    2625#include <xercesc/validators/schema/XMLSchemaDescriptionImpl.hpp>
     
    5554                    20,     // size
    5655                    29,     // modulus
    57                     fXSModel->getURIStringPool(),
     56                    xsModel,
    5857                    false,  // adoptElems
    5958                    fMemoryManager
     
    108107                    20,     // size
    109108                    29,     // modulus
    110                     fXSModel->getURIStringPool(),
     109                    fXSModel,
    111110                    false,  // adoptElems
    112111                    fMemoryManager
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSNamespaceItem.hpp

    r2722 r3565  
    2626#include <xercesc/framework/psvi/XSObject.hpp>
    2727#include <xercesc/framework/psvi/XSNamedMap.hpp>
     28#include <xercesc/framework/psvi/XSModel.hpp>
    2829
    2930XERCES_CPP_NAMESPACE_BEGIN
     
    4950class XSTypeDefinition;
    5051class SchemaGrammar;
    51 class XSModel;
    5252
    5353class XMLPARSER_EXPORT XSNamespaceItem : public XMemory
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSNotationDeclaration.cpp

    r2722 r3565  
    5757const XMLCh *XSNotationDeclaration::getNamespace()
    5858{
    59     return fXSModel->getURIStringPool()->getValueForId(fXMLNotationDecl->getNameSpaceId());
     59    return fXSModel->getURIText(fXMLNotationDecl->getNameSpaceId());
    6060}
    6161
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSTypeDefinition.hpp

    r2722 r3565  
    209209}
    210210
    211 
    212211XERCES_CPP_NAMESPACE_END
    213212
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSValue.cpp

    r3103 r3565  
    358358                               ,       MemoryManager* const manager)
    359359{
     360
     361    DEBUG_MESSAGE("content=" << content)
     362
    360363    if (!content ||
    361364        !*content ||
     
    368371    status = st_Init;
    369372
    370     switch (inGroup[datatype]) {
    371     case XSValue::dg_numerics:
    372         return getActValNumerics(content, datatype,  status, toValidate, manager);
    373         break;
    374     case XSValue::dg_datetimes:
    375         return getActValDateTimes(content, datatype,  status, manager);
    376         break;
    377     case XSValue::dg_strings:
    378         return getActValStrings(content, datatype,  status, version, toValidate, manager);
    379         break;
    380     default:
    381         status = st_UnknownType;
    382         return 0;
    383         break;
     373    DEBUG_MESSAGE("inGroup[" << datatype << "]=" << inGroup[datatype])
     374
     375    switch (inGroup[datatype])
     376    {
     377        case XSValue::dg_numerics:
     378            return getActValNumerics(content, datatype,  status, toValidate, manager);
     379            break;
     380        case XSValue::dg_datetimes:
     381            return getActValDateTimes(content, datatype,  status, manager);
     382            break;
     383        case XSValue::dg_strings:
     384            return getActValStrings(content, datatype,  status, version, toValidate, manager);
     385            break;
     386        default:
     387            status = st_UnknownType;
     388            return 0;
     389            break;
    384390    }
    385391    return 0;
     
    10911097                               ,       MemoryManager* const manager)
    10921098{
    1093     switch (datatype) {
     1099
     1100    switch (datatype)
     1101    {
    10941102        case XSValue::dt_boolean:
    10951103            {
  • icXML/icXML-devel/src/xercesc/framework/psvi/XSWildcard.cpp

    r2779 r3565  
    4747        fConstraintType = NSCONSTRAINT_NOT;
    4848        fNsConstraintList = new (manager) RefArrayVectorOf<XMLCh>(1, true, manager);
    49         fNsConstraintList->addElement
    50         (
    51             XMLString::replicate(fXSModel->getURIStringPool()->getValueForId(
    52                     attWildCard->getAttName()->getURI()), manager)
    53         );
     49        fNsConstraintList->addElement(fXSModel->getURIText(attWildCard->getAttName()->getURI(), manager));
    5450    }
    5551    else if (attType == XMLAttDef::Any_List)
     
    6561                for (XMLSize_t i=0; i < nsListSize; i++)
    6662                {
    67                     fNsConstraintList->addElement
    68                     (
    69                         XMLString::replicate
    70                         (
    71                             fXSModel->getURIStringPool()->getValueForId
    72                             (
    73                                 nsList->elementAt(i)
    74                             )
    75                             , manager
    76                         )
    77                     );
     63                    fNsConstraintList->addElement(fXSModel->getURIText(nsList->elementAt(i), manager));
    7864                }
    7965            }
     
    129115        fNsConstraintList = new (manager) RefArrayVectorOf<XMLCh>(4, true, manager);
    130116        buildNamespaceList(elmWildCard);
    131     }
    132     // must be any
    133     else
     117    }   
     118    else // must be any
    134119    {
    135120        if (nodeType == ContentSpecNode::Any_Lax)
     
    139124    }
    140125
    141     if (fConstraintType == NSCONSTRAINT_NOT
    142         || (fConstraintType == NSCONSTRAINT_DERIVATION_LIST
    143             && !fNsConstraintList))
     126    if (fConstraintType == NSCONSTRAINT_NOT || (fConstraintType == NSCONSTRAINT_DERIVATION_LIST && !fNsConstraintList))
    144127    {
    145128        fNsConstraintList = new (manager) RefArrayVectorOf<XMLCh>(1, true, manager);
    146         fNsConstraintList->addElement
    147         (
    148              XMLString::replicate(fXSModel->getURIStringPool()->getValueForId(
    149                      elmWildCard->getElement()->getURI()), manager)
    150         );
     129        fNsConstraintList->addElement(fXSModel->getURIText(elmWildCard->getElement()->getURI(), manager));
    151130    }
    152131}
     
    161140//  XSWildcard: helper methods
    162141// ---------------------------------------------------------------------------
    163 void XSWildcard::buildNamespaceList(const ContentSpecNode* const rootNode)
     142void XSWildcard::buildNamespaceList(const ContentSpecNode * const rootNode)
    164143{
     144    DEBUG_MESSAGE("XSWildcard::buildNamespaceList(" << rootNode << ")");
     145
    165146    ContentSpecNode::NodeTypes nodeType = rootNode->getType();
    166147    if (nodeType == ContentSpecNode::Any_NS_Choice)
     
    171152    else
    172153    {
    173         fNsConstraintList->addElement
    174         (
    175             XMLString::replicate(fXSModel->getURIStringPool()->getValueForId(
    176                     rootNode->getElement()->getURI()), fMemoryManager)
    177         );
     154        assert (fMemoryManager);
     155        DEBUG_MESSAGE("rootNode->getElement()=" << rootNode->getElement())
     156        XMLCh * uri = fXSModel->getURIText(rootNode->getElement()->getURI(), fMemoryManager);
     157        DEBUG_MESSAGE(" -- URI=" << uri);
     158        fNsConstraintList->addElement(uri);
    178159    }
    179160}
  • icXML/icXML-devel/src/xercesc/internal/VecAttrListImpl.cpp

    r2722 r3565  
    3232//  Constructors and Destructor
    3333// ---------------------------------------------------------------------------
    34 VecAttrListImpl::VecAttrListImpl() :
    35 
    36     fAdopt(false)
    37     , fCount(0)
    38     , fVector(0)
     34VecAttrListImpl::VecAttrListImpl(const RefVectorOf<XMLAttr> & attrList)
     35: fCount(0)
     36, fVector(attrList)
    3937{
    4038}
     
    4240VecAttrListImpl::~VecAttrListImpl()
    4341{
    44     //
    45     //  Note that some compilers can't deal with the fact that the pointer
    46     //  is to a const object, so we have to cast off the const'ness here!
    47     //
    48     if (fAdopt)
    49         delete (RefVectorOf<XMLAttr>*)fVector;
     42
    5043}
    5144
     
    6457        return 0;
    6558    }
    66     return fVector->elementAt(index)->getQName();
     59    return fVector.elementAt(index)->getQName();
    6760}
    6861
     
    7265        return 0;
    7366    }
    74     return XMLAttDef::getAttTypeString(fVector->elementAt(index)->getType(), fVector->getMemoryManager());
     67    return XMLAttDef::getAttTypeString(fVector.elementAt(index)->getType(), fVector.getMemoryManager());
    7568}
    7669
     
    8073        return 0;
    8174    }
    82     return fVector->elementAt(index)->getValue();
     75    return fVector.elementAt(index)->getValue();
    8376}
    8477
     
    9184    for (XMLSize_t index = 0; index < fCount; index++)
    9285    {
    93         const XMLAttr* curElem = fVector->elementAt(index);
     86        const XMLAttr* curElem = fVector.elementAt(index);
    9487
    9588        if (XMLString::equals(curElem->getQName(), name))
    96             return XMLAttDef::getAttTypeString(curElem->getType(), fVector->getMemoryManager());
     89            return XMLAttDef::getAttTypeString(curElem->getType(), fVector.getMemoryManager());
    9790    }
    9891    return 0;
     
    107100    for (XMLSize_t index = 0; index < fCount; index++)
    108101    {
    109         const XMLAttr* curElem = fVector->elementAt(index);
     102        const XMLAttr* curElem = fVector.elementAt(index);
    110103
    111104        if (XMLString::equals(curElem->getQName(), name))
     
    127120    for (XMLSize_t index = 0; index < fCount; index++)
    128121    {
    129         const XMLAttr* curElem = fVector->elementAt(index);
     122        const XMLAttr* curElem = fVector.elementAt(index);
    130123
    131124        if (XMLString::equals(curElem->getQName(), wideName))
     
    140133//  Setter methods
    141134// ---------------------------------------------------------------------------
    142 void VecAttrListImpl::setVector(const   RefVectorOf<XMLAttr>* const srcVec
    143                                 , const XMLSize_t                   count
    144                                 , const bool                        adopt)
     135VecAttrListImpl::VecAttrListImpl()
     136: fCount(0)
     137, fVector(0)
    145138{
    146     //
    147     //  Delete the previous vector (if any) if we are adopting. Note that some
    148     //  compilers can't deal with the fact that the pointer is to a const
    149     //  object, so we have to cast off the const'ness here!
    150     //
    151     if (fAdopt)
    152         delete (RefVectorOf<XMLAttr>*)fVector;
     139    DEPRECATED_FEATURE_IN_ICXML;
     140}
    153141
    154     fAdopt = adopt;
    155     fCount = count;
    156     fVector = srcVec;
     142void VecAttrListImpl::setVector(const RefVectorOf<XMLAttr>* const, const XMLSize_t, const bool)
     143{
     144    DEPRECATED_FEATURE_IN_ICXML;
    157145}
    158146
  • icXML/icXML-devel/src/xercesc/internal/VecAttrListImpl.hpp

    r2722 r3565  
    3131class XMLPARSER_EXPORT VecAttrListImpl : public XMemory, public AttributeList
    3232{
     33    template<bool doPSVI> friend class SAXDocumentDisseminatorImpl;
     34
    3335public :
    3436    // -----------------------------------------------------------------------
    3537    //  Constructors and Destructor
    3638    // -----------------------------------------------------------------------
    37     VecAttrListImpl();
     39    VecAttrListImpl(const RefVectorOf<XMLAttr> & attrList);
     40    VecAttrListImpl();   
    3841    ~VecAttrListImpl();
    3942
     
    8790    //      The vector that provides the backing for the list.
    8891    // -----------------------------------------------------------------------
    89     bool                        fAdopt;
    90     XMLSize_t                   fCount;
    91     const RefVectorOf<XMLAttr>* fVector;
     92    XMLSize_t                       fCount;
     93    const RefVectorOf<XMLAttr> &    fVector;
    9294};
    9395
  • icXML/icXML-devel/src/xercesc/internal/XSObjectFactory.cpp

    r3153 r3565  
    8181// ---------------------------------------------------------------------------
    8282XSParticle*
    83 XSObjectFactory::createModelGroupParticle(const ContentSpecNode* const rootNode,
    84                                           XSModel* const xsModel)
    85 {
    86     if (rootNode == 0)
    87         return 0;
    88 
    89     ContentSpecNode::NodeTypes nodeType = rootNode->getType();
    90     if (nodeType == ContentSpecNode::All
    91         || nodeType == ContentSpecNode::ModelGroupChoice
    92         || nodeType == ContentSpecNode::ModelGroupSequence)
    93     {
    94         XSParticleList* particleList = new (fMemoryManager) RefVectorOf<XSParticle> (4, true, fMemoryManager);
    95         XSAnnotation* annot = getAnnotationFromModel(xsModel, rootNode);
    96         XSModelGroup* modelGroup = 0;
    97 
    98         if (nodeType == ContentSpecNode::All)
    99         {
    100             modelGroup = new (fMemoryManager) XSModelGroup(XSModelGroup::COMPOSITOR_ALL, particleList, annot, xsModel, fMemoryManager);
    101             buildAllParticles(rootNode, particleList, xsModel);
    102         }
    103         else
    104         {
    105             if (nodeType == ContentSpecNode::ModelGroupChoice)
    106                 modelGroup = new (fMemoryManager) XSModelGroup(XSModelGroup::COMPOSITOR_CHOICE, particleList, annot, xsModel, fMemoryManager);
     83XSObjectFactory::createModelGroupParticle
     84(
     85    const ContentSpecNode* const        rootNode
     86    , XSModel* const                    xsModel
     87)
     88{
     89    XSParticle * groupParticle = 0;
     90    if (rootNode)
     91    {
     92        ContentSpecNode::NodeTypes nodeType = rootNode->getType();
     93
     94        if (nodeType == ContentSpecNode::All || nodeType == ContentSpecNode::ModelGroupChoice || nodeType == ContentSpecNode::ModelGroupSequence)
     95        {
     96            XSParticleList * particleList = new (fMemoryManager) RefVectorOf<XSParticle> (4, true, fMemoryManager);
     97            XSAnnotation * annot = getAnnotationFromModel(xsModel, rootNode);
     98            XSModelGroup * modelGroup = 0;
     99
     100            if (nodeType == ContentSpecNode::All)
     101            {
     102                modelGroup = new (fMemoryManager) XSModelGroup(XSModelGroup::COMPOSITOR_ALL, particleList, annot, xsModel, fMemoryManager);
     103                buildAllParticles(rootNode, particleList, xsModel);
     104            }
    107105            else
    108                 modelGroup = new (fMemoryManager) XSModelGroup(XSModelGroup::COMPOSITOR_SEQUENCE, particleList, annot, xsModel, fMemoryManager);
    109 
    110             buildChoiceSequenceParticles(rootNode->getFirst(), particleList, xsModel);
    111             buildChoiceSequenceParticles(rootNode->getSecond(), particleList, xsModel);
    112         }
    113 
    114         int m = rootNode->getMaxOccurs();
    115         XSParticle* groupParticle = new (fMemoryManager) XSParticle
    116         (
    117             XSParticle::TERM_MODELGROUP
    118             , xsModel
    119             , modelGroup
    120             , (XMLSize_t)rootNode->getMinOccurs()
    121             , (XMLSize_t)m
    122             , m == -1
    123             , fMemoryManager
    124         );
    125 
    126         return groupParticle;
    127     }
    128     else
    129         return 0;
     106            {
     107                if (nodeType == ContentSpecNode::ModelGroupChoice)
     108                    modelGroup = new (fMemoryManager) XSModelGroup(XSModelGroup::COMPOSITOR_CHOICE, particleList, annot, xsModel, fMemoryManager);
     109                else
     110                    modelGroup = new (fMemoryManager) XSModelGroup(XSModelGroup::COMPOSITOR_SEQUENCE, particleList, annot, xsModel, fMemoryManager);
     111
     112                buildChoiceSequenceParticles(rootNode->getFirst(), particleList, xsModel);
     113                buildChoiceSequenceParticles(rootNode->getSecond(), particleList, xsModel);
     114            }
     115
     116            int m = rootNode->getMaxOccurs();
     117            groupParticle = new (fMemoryManager) XSParticle
     118            (
     119                XSParticle::TERM_MODELGROUP
     120                , xsModel
     121                , modelGroup
     122                , (XMLSize_t)rootNode->getMinOccurs()
     123                , (XMLSize_t)m
     124                , m == -1
     125                , fMemoryManager
     126            );
     127        }
     128    }
     129    return groupParticle;
    130130}
    131131
     
    438438                count
    439439                , 29
    440                 , xsModel->getURIStringPool()
     440                , xsModel
    441441                , false
    442442                , fMemoryManager
     
    502502
    503503XSComplexTypeDefinition*
    504 XSObjectFactory::addOrFind(ComplexTypeInfo* const typeInfo,
    505                            XSModel* const xsModel)
     504XSObjectFactory::addOrFind(ComplexTypeInfo* const typeInfo, XSModel * const xsModel)
    506505{
    507506    XSComplexTypeDefinition* xsObj = (XSComplexTypeDefinition*) xsModel->getXSObject(typeInfo);
     
    716715
    717716XSModelGroupDefinition*
    718 XSObjectFactory::createXSModelGroupDefinition(XercesGroupInfo* const groupInfo,
    719                                               XSModel* const xsModel)
    720 {
    721     XSParticle* particle = createModelGroupParticle(
    722             groupInfo->getContentSpec(), xsModel);
     717XSObjectFactory::createXSModelGroupDefinition
     718(
     719    XercesGroupInfo* const          groupInfo
     720    , XSModel* const                xsModel
     721)
     722{
     723    XSParticle * particle = createModelGroupParticle(groupInfo->getContentSpec(), xsModel);
    723724
    724725    XSModelGroupDefinition* xsObj = new (fMemoryManager) XSModelGroupDefinition
     
    730731        , fMemoryManager
    731732    );
     733
    732734    fDeleteVector->addElement(xsObj);
    733735
     
    760762        {
    761763            SchemaAttDef* attDef = attGroupInfo->attributeAt(i);
    762             XSAttributeDeclaration* xsAttDecl = 0;
    763 
    764             if (attDef->getBaseAttDecl())
    765                 xsAttDecl = addOrFind(attDef->getBaseAttDecl(), xsModel);
    766             else
    767                 xsAttDecl = addOrFind(attDef, xsModel);
    768 
    769             if (xsAttDecl && (attDef->getDefaultType() != XMLAttDef::Prohibited)) // just for sanity
     764            XSAttributeDeclaration * xsAttDecl =
     765                addOrFind(attDef->getBaseAttDecl() ? attDef->getBaseAttDecl() : attDef, xsModel);
     766
     767            assert (xsAttDecl);
     768
     769            if (attDef->getDefaultType() != XMLAttDef::Prohibited) // just for sanity
    770770            {
    771771                XSAttributeUse* attUse = createXSAttributeUse(xsAttDecl, xsModel);
     
    793793}
    794794
    795 XSAnnotation* XSObjectFactory::getAnnotationFromModel(XSModel* const xsModel,
    796                                                const void* const key)
     795XSAnnotation* XSObjectFactory::getAnnotationFromModel
     796(
     797    XSModel* const          xsModel
     798    , const void* const     key
     799)
    797800{
    798801    XSNamespaceItemList* namespaceItemList = xsModel->getNamespaceItems();
     
    802805    {
    803806        XSNamespaceItem* nsItem = namespaceItemList->elementAt(i);
     807
    804808        if (nsItem->fGrammar)
    805809        {
    806810            annot = nsItem->fGrammar->getAnnotation(key);
    807811            if (annot)
     812            {               
    808813                return annot;
    809         }
    810     }
    811 
    812     if (xsModel->fParent)
    813         return getAnnotationFromModel(xsModel->fParent, key);
    814     return 0;
     814            }
     815        }
     816    }
     817
     818    return (xsModel->fParent) ? getAnnotationFromModel(xsModel->fParent, key) : 0;
    815819}
    816820
  • icXML/icXML-devel/src/xercesc/internal/XSerializable.hpp

    r2722 r3565  
    3535    //  Constructors and Destructor
    3636    // -----------------------------------------------------------------------
    37     virtual ~XSerializable() {} ;
     37    virtual ~XSerializable() {}
    3838
    3939    // -----------------------------------------------------------------------
  • icXML/icXML-devel/src/xercesc/parsers/DOMLSParserImpl.cpp

    r2722 r3565  
    5454#include <xercesc/util/RuntimeException.hpp>
    5555#include <xercesc/util/XMLDOMMsg.hpp>
     56#include <icxmlc/parsers/XMLDocumentDisseminatorImpl.hpp>
    5657
    5758XERCES_CPP_NAMESPACE_BEGIN
     
    13771378}
    13781379
     1380XMLDocumentDisseminator * DOMLSParserImpl::createDocumentDisseminator()
     1381{
     1382    if (fPSVIHandler)
     1383    {
     1384        return new (fMemoryManager) XMLDocumentDisseminatorImpl<DOMLSParserImpl, true>(this, fPSVIHandler, fMemoryManager);
     1385    }
     1386    else
     1387    {
     1388        return new (fMemoryManager) XMLDocumentDisseminatorImpl<DOMLSParserImpl, false>(this, fMemoryManager);
     1389    }
     1390}
     1391
    13791392XERCES_CPP_NAMESPACE_END
  • icXML/icXML-devel/src/xercesc/parsers/DOMLSParserImpl.hpp

    r2722 r3565  
    589589    );
    590590
     591    /** Called by the XMLParserImpl. This is a factory method to provide it with a templated version
     592      * of the XMLDocumentDisseminator; each of which is optimized for SAX, SAX2 or DOM, depending
     593      * on the parser being used.
     594      *
     595      */
     596    virtual XMLDocumentDisseminator * createDocumentDisseminator();
    591597
    592598private :
  • icXML/icXML-devel/src/xercesc/parsers/XercesDOMParser.cpp

    r2722 r3565  
    4242#include <xercesc/util/OutOfMemoryException.hpp>
    4343#include <xercesc/util/XMLEntityResolver.hpp>
     44#include <icxmlc/parsers/XMLDocumentDisseminatorImpl.hpp>
    4445
    4546XERCES_CPP_NAMESPACE_BEGIN
     
    5253XercesDOMParser::XercesDOMParser( XMLValidator* const   valToAdopt
    5354                                , MemoryManager* const  manager
    54                                 , XMLGrammarPool* const gramPool):
    55 
    56 AbstractDOMParser(valToAdopt, manager, gramPool)
     55                                , XMLGrammarPool* const gramPool)
     56: AbstractDOMParser(valToAdopt, manager, gramPool)
    5757, fEntityResolver(0)
    5858, fXMLEntityResolver(0)
     
    347347}
    348348
     349XMLDocumentDisseminator * XercesDOMParser::createDocumentDisseminator()
     350{
     351    if (fPSVIHandler)
     352    {
     353        return new (fMemoryManager) XMLDocumentDisseminatorImpl<XercesDOMParser, true>(this, fPSVIHandler, fMemoryManager);
     354    }
     355    else
     356    {
     357        return new (fMemoryManager) XMLDocumentDisseminatorImpl<XercesDOMParser, false>(this, fMemoryManager);
     358    }
     359}
     360
    349361XERCES_CPP_NAMESPACE_END
  • icXML/icXML-devel/src/xercesc/parsers/XercesDOMParser.hpp

    r3104 r3565  
    4848{
    4949public :
    50     // -----------------------------------------------------------------------
    51     //  Constructors and Destructor
    52     // -----------------------------------------------------------------------
    53 
    54     /** @name Constructors and Destructor */
    55     //@{
    56     /** Construct a XercesDOMParser, with an optional validator
    57       *
    58       * Constructor with an instance of validator class to use for
    59       * validation. If you don't provide a validator, a default one will
    60       * be created for you in the scanner.
    61       *
    62       * @param gramPool   Pointer to the grammar pool instance from
    63       *                   external application.
    64       *                   The parser does NOT own it.
    65       *
    66       * @param valToAdopt Pointer to the validator instance to use. The
    67       *                   parser is responsible for freeing the memory.
    68       * @param  manager   Pointer to the memory manager to be used to
    69       *                   allocate objects.
    70       */
    71     XercesDOMParser
    72     (
    73           XMLValidator* const   valToAdopt = 0
    74         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
    75         , XMLGrammarPool* const gramPool = 0
    76     );
    77 
    78     /**
    79       * Destructor
    80       */
    81     virtual ~XercesDOMParser();
    82 
    83     //@}
    84 
    85 
    86     // -----------------------------------------------------------------------
    87     //  Getter methods
    88     // -----------------------------------------------------------------------
    89 
    90     /** @name Getter methods */
    91     //@{
    92 
    93     /** Get a pointer to the error handler
    94       *
    95       * This method returns the installed error handler. If no handler
    96       * has been installed, then it will be a zero pointer.
    97       *
    98       * @return The pointer to the installed error handler object.
    99       */
    100     ErrorHandler* getErrorHandler();
    101 
    102     /** Get a const pointer to the error handler
    103       *
    104       * This method returns the installed error handler.  If no handler
    105       * has been installed, then it will be a zero pointer.
    106       *
    107       * @return A const pointer to the installed error handler object.
    108       */
    109     const ErrorHandler* getErrorHandler() const;
    110 
    111     /** Get a pointer to the entity resolver
    112       *
    113       * This method returns the installed entity resolver.  If no resolver
    114       * has been installed, then it will be a zero pointer.
    115       *
    116       * @return The pointer to the installed entity resolver object.
    117       */
    118     EntityResolver* getEntityResolver();
    119 
    120     /** Get a const pointer to the entity resolver
    121       *
    122       * This method returns the installed entity resolver. If no resolver
    123       * has been installed, then it will be a zero pointer.
    124       *
    125       * @return A const pointer to the installed entity resolver object.
    126       */
    127     const EntityResolver* getEntityResolver() const;
    128 
    129     /**
    130       * Get a pointer to the entity resolver
    131       *
    132       * This method returns the installed entity resolver.  If no resolver
    133       * has been installed, then it will be a zero pointer.
    134       *
    135       * @return The pointer to the installed entity resolver object.
    136       */
    137     XMLEntityResolver* getXMLEntityResolver();
    138 
    139     /**
    140       * Get a const pointer to the entity resolver
    141       *
    142       * This method returns the installed entity resolver. If no resolver
    143       * has been installed, then it will be a zero pointer.
    144       *
    145       * @return A const pointer to the installed entity resolver object.
    146       */
    147     const XMLEntityResolver* getXMLEntityResolver() const;
    148 
    149     /** Get the 'Grammar caching' flag
    150       *
    151       * This method returns the state of the parser's grammar caching when
    152       * parsing an XML document.
    153       *
    154       * @return true, if the parser is currently configured to
    155       *         cache grammars, false otherwise.
    156       *
    157       * @see #cacheGrammarFromParse
    158       */
    159     bool isCachingGrammarFromParse() const;
    160 
    161     /** Get the 'Use cached grammar' flag
    162       *
    163       * This method returns the state of the parser's use of cached grammar
    164       * when parsing an XML document.
    165       *
    166       * @return true, if the parser is currently configured to
    167       *         use cached grammars, false otherwise.
    168       *
    169       * @see #useCachedGrammarInParse
    170       */
    171     bool isUsingCachedGrammarInParse() const;
    172 
    173     /**
    174      * Retrieve the grammar that is associated with the specified namespace key
    175      *
    176      * @param  nameSpaceKey Namespace key
    177      * @return Grammar associated with the Namespace key.
    178      */
    179     Grammar* getGrammar(const XMLCh* const nameSpaceKey);
    180 
    181     /**
    182      * Retrieve the grammar where the root element is declared.
    183      *
    184      * @return Grammar where root element declared
    185      */
    186     Grammar* getRootGrammar();
    187 
    188     /**
    189      * Returns the string corresponding to a URI id from the URI string pool.
    190      *
    191      * @param uriId id of the string in the URI string pool.
    192      * @return URI string corresponding to the URI id.
    193      */
    194     const XMLCh* getURIText(unsigned int uriId) const;
    195 
    196     /**
    197      * Returns the current src offset within the input source.
    198      * To be used only while parsing is in progress.
    199      *
    200      * @return offset within the input source
    201      */
    202     XMLFilePos getSrcOffset() const;
    203 
    204     /** Get the 'ignore cached DTD grammar' flag
    205       *
    206       * @return true, if the parser is currently configured to
    207       *         ignore cached DTD, false otherwise.
    208       *
    209       * @see #setIgnoreCachedDTD
    210       */
    211     bool getIgnoreCachedDTD() const;
    212 
    213     //@}
    214 
    215 
    216     // -----------------------------------------------------------------------
    217     //  Setter methods
    218     // -----------------------------------------------------------------------
    219 
    220     /** @name Setter methods */
    221     //@{
    222 
    223     /** Set the error handler
    224       *
    225       * This method allows applications to install their own error handler
    226       * to trap error and warning messages.
    227       *
    228       * <i>Any previously set handler is merely dropped, since the parser
    229       * does not own them.</i>
    230       *
    231       * @param handler  A const pointer to the user supplied error
    232       *                 handler.
    233       *
    234       * @see #getErrorHandler
    235       */
    236     void setErrorHandler(ErrorHandler* const handler);
    237 
    238     /** Set the entity resolver
    239       *
    240       * This method allows applications to install their own entity
    241       * resolver. By installing an entity resolver, the applications
    242       * can trap and potentially redirect references to external
    243       * entities.
    244       *
    245       * <i>Any previously set entity resolver is merely dropped, since the parser
    246       * does not own them.  If both setEntityResolver and setXMLEntityResolver
    247       * are called, then the last one is used.</i>
    248       *
    249       * @param handler  A const pointer to the user supplied entity
    250       *                 resolver.
    251       *
    252       * @see #getEntityResolver
    253       */
    254     void setEntityResolver(EntityResolver* const handler);
    255 
    256     /**
    257       * Set the entity resolver
    258       *
    259       * This method allows applications to install their own entity
    260       * resolver. By installing an entity resolver, the applications
    261       * can trap and potentially redirect references to external
    262       * entities.
    263       *
    264       * <i>Any previously set entity resolver is merely dropped, since the parser
    265       * does not own them.  If both setEntityResolver and setXMLEntityResolver
    266       * are called, then the last one set is used.</i>
    267       *
    268       * @param handler  A const pointer to the user supplied entity
    269       *                 resolver.
    270       *
    271       * @see #getXMLEntityResolver
    272       */
    273     void setXMLEntityResolver(XMLEntityResolver* const handler);
    274 
    275     /** Set the 'Grammar caching' flag
    276       *
    277       * This method allows users to enable or disable caching of grammar when
    278       * parsing XML documents. When set to true, the parser will cache the
    279       * resulting grammar for use in subsequent parses.
    280       *
    281       * If the flag is set to true, the 'Use cached grammar' flag will also be
    282       * set to true.
    283       *
    284       * The parser's default state is: false.
    285       *
    286       * @param newState The value specifying whether we should cache grammars
    287       *                 or not.
    288       *
    289       * @see #isCachingGrammarFromParse
    290       * @see #useCachedGrammarInParse
    291       */
    292     void cacheGrammarFromParse(const bool newState);
    293 
    294     /** Set the 'Use cached grammar' flag
    295       *
    296       * This method allows users to enable or disable the use of cached
    297       * grammars.  When set to true, the parser will use the cached grammar,
    298       * instead of building the grammar from scratch, to validate XML
    299       * documents.
    300       *
    301       * If the 'Grammar caching' flag is set to true, this method ignore the
    302       * value passed in.
    303       *
    304       * The parser's default state is: false.
    305       *
    306       * @param newState The value specifying whether we should use the cached
    307       *                 grammar or not.
    308       *
    309       * @see #isUsingCachedGrammarInParse
    310       * @see #cacheGrammarFromParse
    311       */
    312     void useCachedGrammarInParse(const bool newState);
    313 
    314     /** Set the 'ignore cached DTD grammar' flag
    315       *
    316       * This method gives users the option to ignore a cached DTD grammar, when
    317       * an XML document contains both an internal and external DTD, and the use
    318       * cached grammar from parse option is enabled. Currently, we do not allow
    319       * using cached DTD grammar when an internal subset is present in the
    320       * document. This option will only affect the behavior of the parser when
    321       * an internal and external DTD both exist in a document (i.e. no effect
    322       * if document has no internal subset).
    323       *
    324       * The parser's default state is false
    325       *
    326       * @param newValue The state to set
    327       */
    328     void setIgnoreCachedDTD(const bool newValue);
    329 
    330     //@}
    331 
    332     // -----------------------------------------------------------------------
    333     //  Utility methods
    334     // -----------------------------------------------------------------------
    335 
    336     /** @name Utility methods */
    337     //@{
    338     /** Reset the documents vector pool and release all the associated memory
    339       * back to the system.
    340       *
    341       * When parsing a document using a DOM parser, all memory allocated
    342       * for a DOM tree is associated to the DOM document.
    343       *
    344       * If you do multiple parse using the same DOM parser instance, then
    345       * multiple DOM documents will be generated and saved in a vector pool.
    346       * All these documents (and thus all the allocated memory)
    347       * won't be deleted until the parser instance is destroyed.
    348       *
    349       * If you don't need these DOM documents anymore and don't want to
    350       * destroy the DOM parser instance at this moment, then you can call this method
    351       * to reset the document vector pool and release all the allocated memory
    352       * back to the system.
    353       *
    354       * It is an error to call this method if you are in the middle of a
    355       * parse (e.g. in the mid of a progressive parse).
    356       *
    357       * @exception IOException An exception from the parser if this function
    358       *            is called when a parse is in progress.
     50        // -----------------------------------------------------------------------
     51        //  Constructors and Destructor
     52        // -----------------------------------------------------------------------
     53
     54        /** @name Constructors and Destructor */
     55        //@{
     56        /** Construct a XercesDOMParser, with an optional validator
     57          *
     58          * Constructor with an instance of validator class to use for
     59          * validation. If you don't provide a validator, a default one will
     60          * be created for you in the scanner.
     61          *
     62          * @param gramPool   Pointer to the grammar pool instance from
     63          *                   external application.
     64          *                   The parser does NOT own it.
     65          *
     66          * @param valToAdopt Pointer to the validator instance to use. The
     67          *                   parser is responsible for freeing the memory.
     68          * @param  manager   Pointer to the memory manager to be used to
     69          *                   allocate objects.
     70          */
     71        XercesDOMParser
     72        (
     73                  XMLValidator* const   valToAdopt = 0
     74                , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
     75                , XMLGrammarPool* const gramPool = 0
     76        );
     77
     78        /**
     79          * Destructor
     80          */
     81        virtual ~XercesDOMParser();
     82
     83        //@}
     84
     85
     86        // -----------------------------------------------------------------------
     87        //  Getter methods
     88        // -----------------------------------------------------------------------
     89
     90        /** @name Getter methods */
     91        //@{
     92
     93        /** Get a pointer to the error handler
     94          *
     95          * This method returns the installed error handler. If no handler
     96          * has been installed, then it will be a zero pointer.
     97          *
     98          * @return The pointer to the installed error handler object.
     99          */
     100        ErrorHandler* getErrorHandler();
     101
     102        /** Get a const pointer to the error handler
     103          *
     104          * This method returns the installed error handler.  If no handler
     105          * has been installed, then it will be a zero pointer.
     106          *
     107          * @return A const pointer to the installed error handler object.
     108          */
     109        const ErrorHandler* getErrorHandler() const;
     110
     111        /** Get a pointer to the entity resolver
     112          *
     113          * This method returns the installed entity resolver.  If no resolver
     114          * has been installed, then it will be a zero pointer.
     115          *
     116          * @return The pointer to the installed entity resolver object.
     117          */
     118        EntityResolver* getEntityResolver();
     119
     120        /** Get a const pointer to the entity resolver
     121          *
     122          * This method returns the installed entity resolver. If no resolver
     123          * has been installed, then it will be a zero pointer.
     124          *
     125          * @return A const pointer to the installed entity resolver object.
     126          */
     127        const EntityResolver* getEntityResolver() const;
     128
     129        /**
     130          * Get a pointer to the entity resolver
     131          *
     132          * This method returns the installed entity resolver.  If no resolver
     133          * has been installed, then it will be a zero pointer.
     134          *
     135          * @return The pointer to the installed entity resolver object.
     136          */
     137        XMLEntityResolver* getXMLEntityResolver();
     138
     139        /**
     140          * Get a const pointer to the entity resolver
     141          *
     142          * This method returns the installed entity resolver. If no resolver
     143          * has been installed, then it will be a zero pointer.
     144          *
     145          * @return A const pointer to the installed entity resolver object.
     146          */
     147        const XMLEntityResolver* getXMLEntityResolver() const;
     148
     149        /** Get the 'Grammar caching' flag
     150          *
     151          * This method returns the state of the parser's grammar caching when
     152          * parsing an XML document.
     153          *
     154          * @return true, if the parser is currently configured to
     155          *         cache grammars, false otherwise.
     156          *
     157          * @see #cacheGrammarFromParse
     158          */
     159        bool isCachingGrammarFromParse() const;
     160
     161        /** Get the 'Use cached grammar' flag
     162          *
     163          * This method returns the state of the parser's use of cached grammar
     164          * when parsing an XML document.
     165          *
     166          * @return true, if the parser is currently configured to
     167          *         use cached grammars, false otherwise.
     168          *
     169          * @see #useCachedGrammarInParse
     170          */
     171        bool isUsingCachedGrammarInParse() const;
     172
     173        /**
     174         * Retrieve the grammar that is associated with the specified namespace key
     175         *
     176         * @param  nameSpaceKey Namespace key
     177         * @return Grammar associated with the Namespace key.
     178         */
     179        Grammar* getGrammar(const XMLCh* const nameSpaceKey);
     180
     181        /**
     182         * Retrieve the grammar where the root element is declared.
     183         *
     184         * @return Grammar where root element declared
     185         */
     186        Grammar* getRootGrammar();
     187
     188        /**
     189         * Returns the string corresponding to a URI id from the URI string pool.
     190         *
     191         * @param uriId id of the string in the URI string pool.
     192         * @return URI string corresponding to the URI id.
     193         */
     194        const XMLCh* getURIText(unsigned int uriId) const;
     195
     196        /**
     197         * Returns the current src offset within the input source.
     198         * To be used only while parsing is in progress.
     199         *
     200         * @return offset within the input source
     201         */
     202        XMLFilePos getSrcOffset() const;
     203
     204        /** Get the 'ignore cached DTD grammar' flag
     205          *
     206          * @return true, if the parser is currently configured to
     207          *         ignore cached DTD, false otherwise.
     208          *
     209          * @see #setIgnoreCachedDTD
     210          */
     211        bool getIgnoreCachedDTD() const;
     212
     213        //@}
     214
     215
     216        // -----------------------------------------------------------------------
     217        //  Setter methods
     218        // -----------------------------------------------------------------------
     219
     220        /** @name Setter methods */
     221        //@{
     222
     223        /** Set the error handler
     224          *
     225          * This method allows applications to install their own error handler
     226          * to trap error and warning messages.
     227          *
     228          * <i>Any previously set handler is merely dropped, since the parser
     229          * does not own them.</i>
     230          *
     231          * @param handler  A const pointer to the user supplied error
     232          *                 handler.
     233          *
     234          * @see #getErrorHandler
     235          */
     236        void setErrorHandler(ErrorHandler* const handler);
     237
     238        /** Set the entity resolver
     239          *
     240          * This method allows applications to install their own entity
     241          * resolver. By installing an entity resolver, the applications
     242          * can trap and potentially redirect references to external
     243          * entities.
     244          *
     245          * <i>Any previously set entity resolver is merely dropped, since the parser
     246          * does not own them.  If both setEntityResolver and setXMLEntityResolver
     247          * are called, then the last one is used.</i>
     248          *
     249          * @param handler  A const pointer to the user supplied entity
     250          *                 resolver.
     251          *
     252          * @see #getEntityResolver
     253          */
     254        void setEntityResolver(EntityResolver* const handler);
     255
     256        /**
     257          * Set the entity resolver
     258          *
     259          * This method allows applications to install their own entity
     260          * resolver. By installing an entity resolver, the applications
     261          * can trap and potentially redirect references to external
     262          * entities.
     263          *
     264          * <i>Any previously set entity resolver is merely dropped, since the parser
     265          * does not own them.  If both setEntityResolver and setXMLEntityResolver
     266          * are called, then the last one set is used.</i>
     267          *
     268          * @param handler  A const pointer to the user supplied entity
     269          *                 resolver.
     270          *
     271          * @see #getXMLEntityResolver
     272          */
     273        void setXMLEntityResolver(XMLEntityResolver* const handler);
     274
     275        /** Set the 'Grammar caching' flag
     276          *
     277          * This method allows users to enable or disable caching of grammar when
     278          * parsing XML documents. When set to true, the parser will cache the
     279          * resulting grammar for use in subsequent parses.
     280          *
     281          * If the flag is set to true, the 'Use cached grammar' flag will also be
     282          * set to true.
     283          *
     284          * The parser's default state is: false.
     285          *
     286          * @param newState The value specifying whether we should cache grammars
     287          *                 or not.
     288          *
     289          * @see #isCachingGrammarFromParse
     290          * @see #useCachedGrammarInParse
     291          */
     292        void cacheGrammarFromParse(const bool newState);
     293
     294        /** Set the 'Use cached grammar' flag
     295          *
     296          * This method allows users to enable or disable the use of cached
     297          * grammars.  When set to true, the parser will use the cached grammar,
     298          * instead of building the grammar from scratch, to validate XML
     299          * documents.
     300          *
     301          * If the 'Grammar caching' flag is set to true, this method ignore the
     302          * value passed in.
     303          *
     304          * The parser's default state is: false.
     305          *
     306          * @param newState The value specifying whether we should use the cached
     307          *                 grammar or not.
     308          *
     309          * @see #isUsingCachedGrammarInParse
     310          * @see #cacheGrammarFromParse
     311          */
     312        void useCachedGrammarInParse(const bool newState);
     313
     314        /** Set the 'ignore cached DTD grammar' flag
     315          *
     316          * This method gives users the option to ignore a cached DTD grammar, when
     317          * an XML document contains both an internal and external DTD, and the use
     318          * cached grammar from parse option is enabled. Currently, we do not allow
     319          * using cached DTD grammar when an internal subset is present in the
     320          * document. This option will only affect the behavior of the parser when
     321          * an internal and external DTD both exist in a document (i.e. no effect
     322          * if document has no internal subset).
     323          *
     324          * The parser's default state is false
     325          *
     326          * @param newValue The state to set
     327          */
     328        void setIgnoreCachedDTD(const bool newValue);
     329
     330        //@}
     331
     332        // -----------------------------------------------------------------------
     333        //  Utility methods
     334        // -----------------------------------------------------------------------
     335
     336        /** @name Utility methods */
     337        //@{
     338        /** Reset the documents vector pool and release all the associated memory
     339          * back to the system.
     340          *
     341          * When parsing a document using a DOM parser, all memory allocated
     342          * for a DOM tree is associated to the DOM document.
     343          *
     344          * If you do multiple parse using the same DOM parser instance, then
     345          * multiple DOM documents will be generated and saved in a vector pool.
     346          * All these documents (and thus all the allocated memory)
     347          * won't be deleted until the parser instance is destroyed.
     348          *
     349          * If you don't need these DOM documents anymore and don't want to
     350          * destroy the DOM parser instance at this moment, then you can call this method
     351          * to reset the document vector pool and release all the allocated memory
     352          * back to the system.
     353          *
     354          * It is an error to call this method if you are in the middle of a
     355          * parse (e.g. in the mid of a progressive parse).
     356          *
     357          * @exception IOException An exception from the parser if this function
     358          *            is called when a parse is in progress.
     359          *
     360          */
     361        void resetDocumentPool();
     362
     363        //@}
     364
     365        // -----------------------------------------------------------------------
     366        //  Implementation of the XMLErrorReporter interface.
     367        // -----------------------------------------------------------------------
     368
     369        /** @name Implementation of the XMLErrorReporter interface. */
     370        //@{
     371
     372        /** Handle errors reported from the parser
     373          *
     374          * This method is used to report back errors found while parsing the
     375          * XML file. This method is also borrowed from the SAX specification.
     376          * It calls the corresponding user installed Error Handler method:
     377          * 'fatal', 'error', 'warning' depending on the severity of the error.
     378          * This classification is defined by the XML specification.
     379          *
     380          * @param errCode An integer code for the error.
     381          * @param msgDomain A const pointer to an Unicode string representing
     382          *                  the message domain to use.
     383          * @param errType An enumeration classifying the severity of the error.
     384          * @param errorText A const pointer to an Unicode string representing
     385          *                  the text of the error message.
     386          * @param systemId  A const pointer to an Unicode string representing
     387          *                  the system id of the XML file where this error
     388          *                  was discovered.
     389          * @param publicId  A const pointer to an Unicode string representing
     390          *                  the public id of the XML file where this error
     391          *                  was discovered.
     392          * @param lineNum   The line number where the error occurred.
     393          * @param colNum    The column number where the error occurred.
     394          * @see ErrorHandler
     395          */
     396        virtual void error
     397        (
     398                const   unsigned int                errCode
     399                , const XMLCh* const                msgDomain
     400                , const XMLErrorReporter::ErrTypes  errType
     401                , const XMLCh* const                errorText
     402                , const XMLCh* const                systemId
     403                , const XMLCh* const                publicId
     404                , const XMLFileLoc                  lineNum
     405                , const XMLFileLoc                  colNum
     406        );
     407
     408        /** Reset any error data before a new parse
     409         *
     410          * This method allows the user installed Error Handler callback to
     411          * 'reset' itself.
     412          *
     413          * <b>This method is a no-op for this DOM
     414          * implementation.</b>
     415          */
     416        virtual void resetErrors();
     417        //@}
     418
     419
     420        // -----------------------------------------------------------------------
     421        //  Implementation of the XMLEntityHandler interface.
     422        // -----------------------------------------------------------------------
     423
     424        /** @name Implementation of the XMLEntityHandler interface. */
     425        //@{
     426
     427        /** Handle an end of input source event
     428          *
     429          * This method is used to indicate the end of parsing of an external
     430          * entity file.
     431          *
     432          * <b>This method is a no-op for this DOM
     433          * implementation.</b>
     434          *
     435          * @param inputSource A const reference to the InputSource object
     436          *                    which points to the XML file being parsed.
     437          * @see InputSource
     438          */
     439        virtual void endInputSource(const InputSource& inputSource);
     440
     441        /** Expand a system id
     442          *
     443          * This method allows an installed XMLEntityHandler to further
     444          * process any system id's of external entities encountered in
     445          * the XML file being parsed, such as redirection etc.
     446          *
     447          * <b>This method always returns 'false'
     448          * for this DOM implementation.</b>
     449          *
     450          * @param systemId  A const pointer to an Unicode string representing
     451          *                  the system id scanned by the parser.
     452          * @param toFill    A pointer to a buffer in which the application
     453          *                  processed system id is stored.
     454          * @return 'true', if any processing is done, 'false' otherwise.
     455          */
     456        virtual bool expandSystemId
     457        (
     458                const   XMLCh* const    systemId
     459                ,       XMLBuffer&      toFill
     460        );
     461
     462        /** Reset any entity handler information
     463          *
     464          * This method allows the installed XMLEntityHandler to reset
     465          * itself.
     466          *
     467          * <b>This method is a no-op for this DOM
     468          * implementation.</b>
     469          */
     470        virtual void resetEntities();
     471
     472        /** Resolve a public/system id
     473          *
     474          * This method allows a user installed entity handler to further
     475          * process any pointers to external entities. The applications can
     476          * implement 'redirection' via this callback.
     477          *
     478          * @param resourceIdentifier An object containing the type of
     479          *        resource to be resolved and the associated data members
     480          *        corresponding to this type.
     481          * @return The value returned by the user installed resolveEntity
     482          *         method or NULL otherwise to indicate no processing was done.
     483          *         The returned InputSource is owned by the parser which is
     484          *         responsible to clean up the memory.
     485          * @see XMLEntityHandler
     486          * @see XMLEntityResolver
     487          */
     488        virtual InputSource* resolveEntity
     489        (
     490                XMLResourceIdentifier* resourceIdentifier
     491        );
     492
     493        /** Handle a 'start input source' event
     494          *
     495          * This method is used to indicate the start of parsing an external
     496          * entity file.
     497          *
     498          * <b>This method is a no-op for this DOM parse
     499          * implementation.</b>
     500          *
     501          * @param inputSource A const reference to the InputSource object
     502          *                    which points to the external entity
     503          *                    being parsed.
     504          */
     505        virtual void startInputSource(const InputSource& inputSource);
     506
     507        //@}
     508
     509        // -----------------------------------------------------------------------
     510        //  Grammar preparsing interface
     511        // -----------------------------------------------------------------------
     512
     513        /** @name Implementation of Grammar preparsing interface's. */
     514        //@{
     515        /**
     516          * Preparse schema grammar (XML Schema, DTD, etc.) via an input source
     517          * object.
     518          *
     519          * This method invokes the preparsing process on a schema grammar XML
     520          * file specified by the SAX InputSource parameter. If the 'toCache' flag
     521          * is enabled, the parser will cache the grammars for re-use. If a grammar
     522          * key is found in the pool, no caching of any grammar will take place.
     523          *
     524          *
     525          * @param source A const reference to the SAX InputSource object which
     526          *               points to the schema grammar file to be preparsed.
     527          * @param grammarType The grammar type (Schema or DTD).
     528          * @param toCache If <code>true</code>, we cache the preparsed grammar,
     529          *                otherwise, no caching. Default is <code>false</code>.
     530          * @return The preparsed schema grammar object (SchemaGrammar or
     531          *         DTDGrammar). That grammar object is owned by the parser.
     532          *
     533          * @exception SAXException Any SAX exception, possibly
     534          *            wrapping another exception.
     535          * @exception XMLException An exception from the parser or client
     536          *            handler code.
     537          * @exception DOMException A DOM exception as per DOM spec.
     538          *
     539          * @see InputSource#InputSource
     540          */
     541        Grammar* loadGrammar(const InputSource& source,
     542                                                 const Grammar::GrammarType grammarType,
     543                                                 const bool toCache = false);
     544
     545        /**
     546          * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL
     547          *
     548          * This method invokes the preparsing process on a schema grammar XML
     549          * file specified by the file path parameter. If the 'toCache' flag
     550          * is enabled, the parser will cache the grammars for re-use. If a grammar
     551          * key is found in the pool, no caching of any grammar will take place.
     552          *
     553          *
     554          * @param systemId A const XMLCh pointer to the Unicode string which
     555          *                 contains the path to the XML grammar file to be
     556          *                 preparsed.
     557          * @param grammarType The grammar type (Schema or DTD).
     558          * @param toCache If <code>true</code>, we cache the preparsed grammar,
     559          *                otherwise, no caching. Default is <code>false</code>.
     560          * @return The preparsed schema grammar object (SchemaGrammar or
     561          *         DTDGrammar). That grammar object is owned by the parser.
     562          *
     563          * @exception SAXException Any SAX exception, possibly
     564          *            wrapping another exception.
     565          * @exception XMLException An exception from the parser or client
     566          *            handler code.
     567          * @exception DOMException A DOM exception as per DOM spec.
     568          */
     569        Grammar* loadGrammar(const XMLCh* const systemId,
     570                                                 const Grammar::GrammarType grammarType,
     571                                                 const bool toCache = false);
     572
     573        /**
     574          * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL
     575          *
     576          * This method invokes the preparsing process on a schema grammar XML
     577          * file specified by the file path parameter. If the 'toCache' flag
     578          * is enabled, the parser will cache the grammars for re-use. If a grammar
     579          * key is found in the pool, no caching of any grammar will take place.
     580          *
     581          *
     582          * @param systemId A const char pointer to a native string which contains
     583          *                 the path to the XML grammar file to be preparsed.
     584          * @param grammarType The grammar type (Schema or DTD).
     585          * @param toCache If <code>true</code>, we cache the preparsed grammar,
     586          *                otherwise, no caching. Default is <code>false</code>.
     587          * @return The preparsed schema grammar object (SchemaGrammar or
     588          *         DTDGrammar). That grammar object is owned by the parser.
     589          *
     590          * @exception SAXException Any SAX exception, possibly
     591          *            wrapping another exception.
     592          * @exception XMLException An exception from the parser or client
     593          *            handler code.
     594          * @exception DOMException A DOM exception as per DOM spec.
     595          */
     596        Grammar* loadGrammar(const char* const systemId,
     597                                                 const Grammar::GrammarType grammarType,
     598                                                 const bool toCache = false);
     599
     600        /**
     601          * This method allows the user to reset the pool of cached grammars.
     602          */
     603        void resetCachedGrammarPool();
     604
     605        //@}
     606
     607    /** Called by the XMLParserImpl. This is a factory method to provide it with a templated version
     608      * of the XMLDocumentDisseminator; each of which is optimized for SAX, SAX2 or DOM, depending
     609      * on the parser being used.
    359610      *
    360611      */
    361     void resetDocumentPool();
    362 
    363     //@}
    364 
    365     // -----------------------------------------------------------------------
    366     //  Implementation of the XMLErrorReporter interface.
    367     // -----------------------------------------------------------------------
    368 
    369     /** @name Implementation of the XMLErrorReporter interface. */
    370     //@{
    371 
    372     /** Handle errors reported from the parser
    373       *
    374       * This method is used to report back errors found while parsing the
    375       * XML file. This method is also borrowed from the SAX specification.
    376       * It calls the corresponding user installed Error Handler method:
    377       * 'fatal', 'error', 'warning' depending on the severity of the error.
    378       * This classification is defined by the XML specification.
    379       *
    380       * @param errCode An integer code for the error.
    381       * @param msgDomain A const pointer to an Unicode string representing
    382       *                  the message domain to use.
    383       * @param errType An enumeration classifying the severity of the error.
    384       * @param errorText A const pointer to an Unicode string representing
    385       *                  the text of the error message.
    386       * @param systemId  A const pointer to an Unicode string representing
    387       *                  the system id of the XML file where this error
    388       *                  was discovered.
    389       * @param publicId  A const pointer to an Unicode string representing
    390       *                  the public id of the XML file where this error
    391       *                  was discovered.
    392       * @param lineNum   The line number where the error occurred.
    393       * @param colNum    The column number where the error occurred.
    394       * @see ErrorHandler
    395       */
    396     virtual void error
    397     (
    398         const   unsigned int                errCode
    399         , const XMLCh* const                msgDomain
    400         , const XMLErrorReporter::ErrTypes  errType
    401         , const XMLCh* const                errorText
    402         , const XMLCh* const                systemId
    403         , const XMLCh* const                publicId
    404         , const XMLFileLoc                  lineNum
    405         , const XMLFileLoc                  colNum
    406     );
    407 
    408     /** Reset any error data before a new parse
    409      *
    410       * This method allows the user installed Error Handler callback to
    411       * 'reset' itself.
    412       *
    413       * <b>This method is a no-op for this DOM
    414       * implementation.</b>
    415       */
    416     virtual void resetErrors();
    417     //@}
    418 
    419 
    420     // -----------------------------------------------------------------------
    421     //  Implementation of the XMLEntityHandler interface.
    422     // -----------------------------------------------------------------------
    423 
    424     /** @name Implementation of the XMLEntityHandler interface. */
    425     //@{
    426 
    427     /** Handle an end of input source event
    428       *
    429       * This method is used to indicate the end of parsing of an external
    430       * entity file.
    431       *
    432       * <b>This method is a no-op for this DOM
    433       * implementation.</b>
    434       *
    435       * @param inputSource A const reference to the InputSource object
    436       *                    which points to the XML file being parsed.
    437       * @see InputSource
    438       */
    439     virtual void endInputSource(const InputSource& inputSource);
    440 
    441     /** Expand a system id
    442       *
    443       * This method allows an installed XMLEntityHandler to further
    444       * process any system id's of external entities encountered in
    445       * the XML file being parsed, such as redirection etc.
    446       *
    447       * <b>This method always returns 'false'
    448       * for this DOM implementation.</b>
    449       *
    450       * @param systemId  A const pointer to an Unicode string representing
    451       *                  the system id scanned by the parser.
    452       * @param toFill    A pointer to a buffer in which the application
    453       *                  processed system id is stored.
    454       * @return 'true', if any processing is done, 'false' otherwise.
    455       */
    456     virtual bool expandSystemId
    457     (
    458         const   XMLCh* const    systemId
    459         ,       XMLBuffer&      toFill
    460     );
    461 
    462     /** Reset any entity handler information
    463       *
    464       * This method allows the installed XMLEntityHandler to reset
    465       * itself.
    466       *
    467       * <b>This method is a no-op for this DOM
    468       * implementation.</b>
    469       */
    470     virtual void resetEntities();
    471 
    472     /** Resolve a public/system id
    473       *
    474       * This method allows a user installed entity handler to further
    475       * process any pointers to external entities. The applications can
    476       * implement 'redirection' via this callback.
    477       *
    478       * @param resourceIdentifier An object containing the type of
    479       *        resource to be resolved and the associated data members
    480       *        corresponding to this type.
    481       * @return The value returned by the user installed resolveEntity
    482       *         method or NULL otherwise to indicate no processing was done.
    483       *         The returned InputSource is owned by the parser which is
    484       *         responsible to clean up the memory.
    485       * @see XMLEntityHandler
    486       * @see XMLEntityResolver
    487       */
    488     virtual InputSource* resolveEntity
    489     (
    490         XMLResourceIdentifier* resourceIdentifier
    491     );
    492 
    493     /** Handle a 'start input source' event
    494       *
    495       * This method is used to indicate the start of parsing an external
    496       * entity file.
    497       *
    498       * <b>This method is a no-op for this DOM parse
    499       * implementation.</b>
    500       *
    501       * @param inputSource A const reference to the InputSource object
    502       *                    which points to the external entity
    503       *                    being parsed.
    504       */
    505     virtual void startInputSource(const InputSource& inputSource);
    506 
    507     //@}
    508 
    509     // -----------------------------------------------------------------------
    510     //  Grammar preparsing interface
    511     // -----------------------------------------------------------------------
    512 
    513     /** @name Implementation of Grammar preparsing interface's. */
    514     //@{
    515     /**
    516       * Preparse schema grammar (XML Schema, DTD, etc.) via an input source
    517       * object.
    518       *
    519       * This method invokes the preparsing process on a schema grammar XML
    520       * file specified by the SAX InputSource parameter. If the 'toCache' flag
    521       * is enabled, the parser will cache the grammars for re-use. If a grammar
    522       * key is found in the pool, no caching of any grammar will take place.
    523       *
    524       *
    525       * @param source A const reference to the SAX InputSource object which
    526       *               points to the schema grammar file to be preparsed.
    527       * @param grammarType The grammar type (Schema or DTD).
    528       * @param toCache If <code>true</code>, we cache the preparsed grammar,
    529       *                otherwise, no caching. Default is <code>false</code>.
    530       * @return The preparsed schema grammar object (SchemaGrammar or
    531       *         DTDGrammar). That grammar object is owned by the parser.
    532       *
    533       * @exception SAXException Any SAX exception, possibly
    534       *            wrapping another exception.
    535       * @exception XMLException An exception from the parser or client
    536       *            handler code.
    537       * @exception DOMException A DOM exception as per DOM spec.
    538       *
    539       * @see InputSource#InputSource
    540       */
    541     Grammar* loadGrammar(const InputSource& source,
    542                          const Grammar::GrammarType grammarType,
    543                          const bool toCache = false);
    544 
    545     /**
    546       * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL
    547       *
    548       * This method invokes the preparsing process on a schema grammar XML
    549       * file specified by the file path parameter. If the 'toCache' flag
    550       * is enabled, the parser will cache the grammars for re-use. If a grammar
    551       * key is found in the pool, no caching of any grammar will take place.
    552       *
    553       *
    554       * @param systemId A const XMLCh pointer to the Unicode string which
    555       *                 contains the path to the XML grammar file to be
    556       *                 preparsed.
    557       * @param grammarType The grammar type (Schema or DTD).
    558       * @param toCache If <code>true</code>, we cache the preparsed grammar,
    559       *                otherwise, no caching. Default is <code>false</code>.
    560       * @return The preparsed schema grammar object (SchemaGrammar or
    561       *         DTDGrammar). That grammar object is owned by the parser.
    562       *
    563       * @exception SAXException Any SAX exception, possibly
    564       *            wrapping another exception.
    565       * @exception XMLException An exception from the parser or client
    566       *            handler code.
    567       * @exception DOMException A DOM exception as per DOM spec.
    568       */
    569     Grammar* loadGrammar(const XMLCh* const systemId,
    570                          const Grammar::GrammarType grammarType,
    571                          const bool toCache = false);
    572 
    573     /**
    574       * Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL
    575       *
    576       * This method invokes the preparsing process on a schema grammar XML
    577       * file specified by the file path parameter. If the 'toCache' flag
    578       * is enabled, the parser will cache the grammars for re-use. If a grammar
    579       * key is found in the pool, no caching of any grammar will take place.
    580       *
    581       *
    582       * @param systemId A const char pointer to a native string which contains
    583       *                 the path to the XML grammar file to be preparsed.
    584       * @param grammarType The grammar type (Schema or DTD).
    585       * @param toCache If <code>true</code>, we cache the preparsed grammar,
    586       *                otherwise, no caching. Default is <code>false</code>.
    587       * @return The preparsed schema grammar object (SchemaGrammar or
    588       *         DTDGrammar). That grammar object is owned by the parser.
    589       *
    590       * @exception SAXException Any SAX exception, possibly
    591       *            wrapping another exception.
    592       * @exception XMLException An exception from the parser or client
    593       *            handler code.
    594       * @exception DOMException A DOM exception as per DOM spec.
    595       */
    596     Grammar* loadGrammar(const char* const systemId,
    597                          const Grammar::GrammarType grammarType,
    598                          const bool toCache = false);
    599 
    600     /**
    601       * This method allows the user to reset the pool of cached grammars.
    602       */
    603     void resetCachedGrammarPool();
    604 
    605     //@}
    606 
     612    virtual XMLDocumentDisseminator * createDocumentDisseminator();
    607613
    608614private :
    609     // -----------------------------------------------------------------------
    610     //  Initialize/Cleanup methods
    611     // -----------------------------------------------------------------------
    612     void resetParse();
    613 
    614     // -----------------------------------------------------------------------
    615     //  Unimplemented constructors and operators
    616     // -----------------------------------------------------------------------
    617     XercesDOMParser(const XercesDOMParser&);
    618     XercesDOMParser& operator=(const XercesDOMParser&);
    619 
    620     // -----------------------------------------------------------------------
    621     //  Private data members
    622     //
    623     //  fEntityResolver
    624     //      The installed SAX entity resolver, if any. Null if none.
    625     //
    626     //  fErrorHandler
    627     //      The installed SAX error handler, if any. Null if none.
    628     //-----------------------------------------------------------------------
    629     EntityResolver*          fEntityResolver;
    630     XMLEntityResolver*       fXMLEntityResolver;
    631     ErrorHandler*            fErrorHandler;
     615        // -----------------------------------------------------------------------
     616        //  Initialize/Cleanup methods
     617        // -----------------------------------------------------------------------
     618        void resetParse();
     619
     620        // -----------------------------------------------------------------------
     621        //  Unimplemented constructors and operators
     622        // -----------------------------------------------------------------------
     623        XercesDOMParser(const XercesDOMParser&);
     624        XercesDOMParser& operator=(const XercesDOMParser&);
     625
     626        // -----------------------------------------------------------------------
     627        //  Private data members
     628        //
     629        //  fEntityResolver
     630        //      The installed SAX entity resolver, if any. Null if none.
     631        //
     632        //  fErrorHandler
     633        //      The installed SAX error handler, if any. Null if none.
     634        //-----------------------------------------------------------------------
     635        EntityResolver*          fEntityResolver;
     636        XMLEntityResolver*       fXMLEntityResolver;
     637        ErrorHandler*            fErrorHandler;
    632638};
    633639
     
    639645inline void XercesDOMParser::endInputSource(const InputSource&)
    640646{
    641     // The DOM entity resolver doesn't handle this
     647        // The DOM entity resolver doesn't handle this
    642648}
    643649
    644650inline bool XercesDOMParser::expandSystemId(const XMLCh* const, XMLBuffer&)
    645651{
    646     // The DOM entity resolver doesn't handle this
    647     return false;
     652        // The DOM entity resolver doesn't handle this
     653        return false;
    648654}
    649655
    650656inline void XercesDOMParser::resetEntities()
    651657{
    652     // Nothing to do on this one
     658        // Nothing to do on this one
    653659}
    654660
    655661inline void XercesDOMParser::startInputSource(const InputSource&)
    656662{
    657     // The DOM entity resolver doesn't handle this
     663        // The DOM entity resolver doesn't handle this
    658664}
    659665
     
    664670inline ErrorHandler* XercesDOMParser::getErrorHandler()
    665671{
    666     return fErrorHandler;
     672        return fErrorHandler;
    667673}
    668674
    669675inline const ErrorHandler* XercesDOMParser::getErrorHandler() const
    670676{
    671     return fErrorHandler;
     677        return fErrorHandler;
    672678}
    673679
    674680inline EntityResolver* XercesDOMParser::getEntityResolver()
    675681{
    676     return fEntityResolver;
     682        return fEntityResolver;
    677683}
    678684
    679685inline const EntityResolver* XercesDOMParser::getEntityResolver() const
    680686{
    681     return fEntityResolver;
     687        return fEntityResolver;
    682688}
    683689
    684690inline XMLEntityResolver* XercesDOMParser::getXMLEntityResolver()
    685691{
    686     return fXMLEntityResolver;
     692        return fXMLEntityResolver;
    687693}
    688694
    689695inline const XMLEntityResolver* XercesDOMParser::getXMLEntityResolver() const
    690696{
    691     return fXMLEntityResolver;
     697        return fXMLEntityResolver;
    692698}
    693699
  • icXML/icXML-devel/src/xercesc/sax/Locator.hpp

    r2722 r3565  
    2323#define XERCESC_INCLUDE_GUARD_LOCATOR_HPP
    2424
     25#include <xercesc/util/XMemory.hpp>
    2526#include <xercesc/util/XercesDefs.hpp>
    2627
     
    5657public:
    5758
     59    struct LocationInfo : public XMemory
     60    {
     61        const   XMLCh*          systemId;
     62        const   XMLCh*          publicId;
     63                XMLFileLoc      lineNumber;
     64                XMLFileLoc      colNumber;
     65    };
     66
     67
    5868    /** @name Constructors and Destructor */
    5969    //@{
     
    6979
    7080    //@}
     81
     82
     83    virtual void getLocationInfo(LocationInfo & locationInfo) const = 0;
    7184
    7285    /** @name The locator interface */
  • icXML/icXML-devel/src/xercesc/sax2/ContentHandler.hpp

    r2722 r3565  
    236236    virtual void startDocument() = 0;
    237237
     238
    238239  /**
    239240    * Receive notification of the beginning of an element.
  • icXML/icXML-devel/src/xercesc/sax2/SAX2XMLReader.hpp

    r3157 r3565  
    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;
    99106
    100107    /**
  • icXML/icXML-devel/src/xercesc/util/Base64.cpp

    r2722 r3565  
    280280    if (retStr)
    281281        returnExternalMemory(memMgr, canRepInByte);
    282 
    283282    return retStr;
    284283}
     
    297296     */
    298297    XMLSize_t srcLen = XMLString::stringLen(inputData);
    299     XMLByte *dataInByte = (XMLByte*) getExternalMemory(memMgr, (srcLen+1) * sizeof(XMLByte));
     298
     299    XMLByte *dataInByte = (XMLByte*) getExternalMemory(memMgr, (srcLen + 1) * sizeof(XMLByte));
    300300    ArrayJanitor<XMLByte> janFill(dataInByte, memMgr ? memMgr : XMLPlatformUtils::fgMemoryManager);
    301301
     
    345345     */
    346346    XMLSize_t decodedLength = 0;
    347     XMLByte*     canRepInByte = 0;
    348     XMLByte*     retStr = decode(
    349                               dataInByte
    350                             , &decodedLength
    351                             , canRepInByte
    352                             , memMgr
    353                             , conform);
     347    XMLByte* canRepInByte = 0;
     348    XMLByte* retStr = decode(dataInByte, &decodedLength, canRepInByte, memMgr, conform);
    354349
    355350    if (!retStr)
     
    360355     */
    361356    XMLSize_t canRepLen = XMLString::stringLen((char*)canRepInByte);
     357
    362358    XMLCh *canRepData = (XMLCh*) getExternalMemory(memMgr, (canRepLen + 1) * sizeof(XMLCh));
    363359               
  • icXML/icXML-devel/src/xercesc/util/BinInputStream.cpp

    r2722 r3565  
    1717
    1818/*
    19  * $Id: BinInputStream.cpp 670359 2008-06-22 13:43:45Z borisk $
     19 * $Id: BinInputStream.cpp 1137953 2011-06-21 10:52:28Z amassari $
    2020 */
    2121
     
    4343}
    4444
     45// ---------------------------------------------------------------------------
     46//  BinInputStream: Default implementations
     47// ---------------------------------------------------------------------------
     48const XMLCh* BinInputStream::getEncoding() const
     49{
     50    return 0;
     51}
     52
    4553XERCES_CPP_NAMESPACE_END
  • icXML/icXML-devel/src/xercesc/util/BinInputStream.hpp

    r2722 r3565  
    1717
    1818/*
    19  * $Id: BinInputStream.hpp 670359 2008-06-22 13:43:45Z borisk $
     19 * $Id: BinInputStream.hpp 1137953 2011-06-21 10:52:28Z amassari $
    2020 */
    2121
     
    6767    virtual const XMLCh* getContentType() const = 0;
    6868
     69    /**
     70     * Return the "out-of-band" encoding for the data supplied by this
     71     * input stream. If no such content type is provided for the data, 0 is
     72     * returned. This function is expected to return the correct value at
     73     * any time after the construction of the stream.
     74     *
     75     * An example of the stream that may return non-0 from this function is
     76     * an HTTP stream with the value returned taken from the "Content-Type"
     77     * HTTP header. Note also that if the encoding of the data is known
     78     * to the application by some other means then the setEncoding function
     79     * in the InputSource object should be used instead. The getEncoding
     80     * function should only be used to return information that is intrinsic
     81     * to the stream.
     82     *
     83     * @return The name of the encoding, or 0 if one is not available.
     84     */
     85    virtual const XMLCh *getEncoding() const;
    6986
    7087protected :
  • icXML/icXML-devel/src/xercesc/util/HexBin.cpp

    r2722 r3565  
    120120    janFill.release();
    121121    retVal[decodeLength] = 0;
     122
    122123    return retVal;
    123124}
  • icXML/icXML-devel/src/xercesc/util/MsgLoaders/Win32/Win32MsgLoader.cpp

    r2777 r3565  
    3030#include <icxercesc/util/XMLString.hpp>
    3131#include <xercesc/util/XMLUni.hpp>
    32 #include <xercesc/util/MsgLoaders/Win32/Win32MsgLoader.hpp>
     32#include "Win32MsgLoader.hpp"
    3333
    3434
  • icXML/icXML-devel/src/xercesc/util/NetAccessors/BinHTTPInputStreamCommon.cpp

    r2722 r3565  
    4646      : fBytesProcessed(0)
    4747      , fBuffer(1023, manager)
     48          , fBufferPos(0)
    4849      , fContentType(0)
     50          , fEncoding(0)
    4951      , fMemoryManager(manager)
    5052{
     
    5557{
    5658    if(fContentType) fMemoryManager->deallocate(fContentType);
     59    if(fEncoding) fMemoryManager->deallocate(fEncoding);
    5760}
    5861
     
    223226        }
    224227
     228        // connection closed
     229        if(ret == 0)
     230            break;
     231
    225232        fBuffer.append(tmpBuf, ret);
    226233
     
    262269    }
    263270    return fContentType;
     271}
     272
     273const XMLCh *BinHTTPInputStreamCommon::getEncoding() const
     274{
     275        if(fEncoding == 0) {
     276                const XMLCh* contentTypeHeader = getContentType();
     277                if(contentTypeHeader)
     278                {
     279                        const XMLCh szCharsetEquals[] = {chLatin_c, chLatin_h, chLatin_a, chLatin_r, chLatin_s, chLatin_e, chLatin_t, chEqual, chNull };
     280
     281                        BaseRefVectorOf<XMLCh>* tokens=XMLString::tokenizeString(contentTypeHeader, chSemiColon, fMemoryManager);
     282                        for(XMLSize_t i=0;i<tokens->size();i++)
     283                        {
     284                                XMLString::removeWS(tokens->elementAt(i), fMemoryManager);
     285                                if(XMLString::startsWithI(tokens->elementAt(i), szCharsetEquals))
     286                                {
     287                                        // mutable
     288                                        const XMLCh* encodingName=tokens->elementAt(i)+XMLString::stringLen(szCharsetEquals);
     289                                        const_cast<BinHTTPInputStreamCommon*>(this)->fEncoding = XMLString::replicate(encodingName, fMemoryManager);
     290                                        break;
     291                                }
     292                        }
     293                        // if the charset=value entry was not present, check if we should use a default value
     294                        if(fEncoding==0 && tokens->size()>0)
     295                        {
     296                                const XMLCh szTextSlash[] = { chLatin_t, chLatin_e, chLatin_x, chLatin_t, chForwardSlash, chNull };
     297                                const XMLCh szXml[] = {chLatin_x, chLatin_m, chLatin_l, chNull };
     298                                const XMLCh szXmlDash[] = {chLatin_x, chLatin_m, chLatin_l, chDash, chNull };
     299
     300                                XMLBuffer contentType(XMLString::stringLen(contentTypeHeader), fMemoryManager);
     301                                contentType.set(tokens->elementAt(0));
     302
     303                                XMLCh* strType = contentType.getRawBuffer();
     304                                XMLString::removeWS(strType, fMemoryManager);
     305                                if(XMLString::startsWithI(strType, szTextSlash))
     306                                {
     307                                        // text/* has a default encoding of iso-8859-1
     308                                       
     309                                        // text/xml, text/xml-external-parsed-entity, or a subtype like text/AnythingAtAll+xml
     310                                        // has a default encoding of us-ascii
     311                                        XMLCh* subType = strType+XMLString::stringLen(szTextSlash);
     312
     313                                        BaseRefVectorOf<XMLCh>* tokens=XMLString::tokenizeString(subType, chPlus, fMemoryManager);
     314                                        for(XMLSize_t i=0;i<tokens->size();i++)
     315                                        {
     316                                                XMLCh* part=tokens->elementAt(i);
     317                                                if(XMLString::compareIStringASCII(part, szXml)==0 || XMLString::startsWithI(part, szXmlDash))
     318                                                {
     319                                                        const_cast<BinHTTPInputStreamCommon*>(this)->fEncoding = XMLString::replicate(XMLUni::fgUSASCIIEncodingString, fMemoryManager);
     320                                                        break;
     321                                                }
     322                                        }
     323                                        if(fEncoding==0)
     324                                                const_cast<BinHTTPInputStreamCommon*>(this)->fEncoding = XMLString::replicate(XMLUni::fgISO88591EncodingString, fMemoryManager);
     325                                        delete tokens;
     326                                }
     327                        }
     328                        delete tokens;
     329                }
     330        }
     331    return fEncoding;
    264332}
    265333
  • icXML/icXML-devel/src/xercesc/util/NetAccessors/BinHTTPInputStreamCommon.hpp

    r2722 r3565  
    170170
    171171    virtual const XMLCh *getContentType() const;
     172    virtual const XMLCh *getEncoding() const;
    172173
    173174protected :
     
    209210    //      Pointers into fBuffer, showing start and end+1 of content
    210211    //      that readBytes must return.
     212        //  fContentType
     213        //      Holds the HTTP header for the Content-Type setting
     214        //  fEncoding
     215        //      Holds the encoding of this stream, extracted from the Content-Type setting
    211216    // -----------------------------------------------------------------------
    212217
     
    215220    char *              fBufferPos;
    216221    XMLCh *             fContentType;
     222    XMLCh *             fEncoding;
    217223    MemoryManager*      fMemoryManager;
    218224};
  • icXML/icXML-devel/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp

    r2722 r3565  
    1717
    1818/*
    19  * $Id: CurlURLInputStream.cpp 936316 2010-04-21 14:19:58Z borisk $
     19 * $Id: CurlURLInputStream.cpp 936317 2010-04-21 14:20:51Z borisk $
    2020 */
    2121
  • icXML/icXML-devel/src/xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.cpp

    r2722 r3565  
    1717
    1818/*
    19  * $Id: URLAccessCFBinInputStream.cpp 936316 2010-04-21 14:19:58Z borisk $
     19 * $Id: URLAccessCFBinInputStream.cpp 936317 2010-04-21 14:20:51Z borisk $
    2020 */
    2121
  • icXML/icXML-devel/src/xercesc/util/NetAccessors/Socket/UnixHTTPURLInputStream.cpp

    r2722 r3565  
    1717
    1818/*
    19  * $Id: UnixHTTPURLInputStream.cpp 936316 2010-04-21 14:19:58Z borisk $
     19 * $Id: UnixHTTPURLInputStream.cpp 936317 2010-04-21 14:20:51Z borisk $
    2020 */
    2121
  • icXML/icXML-devel/src/xercesc/util/NetAccessors/WinSock/BinHTTPURLInputStream.cpp

    r2722 r3565  
    1717
    1818/*
    19  * $Id: BinHTTPURLInputStream.cpp 936316 2010-04-21 14:19:58Z borisk $
     19 * $Id: BinHTTPURLInputStream.cpp 936317 2010-04-21 14:20:51Z borisk $
    2020 */
    2121
  • icXML/icXML-devel/src/xercesc/util/RefHash2KeysTableOf.c

    r2722 r3565  
    3232#include <assert.h>
    3333#include <new>
     34#include <icxmlc/XMLConfig.hpp>
    3435
    3536XERCES_CPP_NAMESPACE_BEGIN
     
    469470    // Search that bucket for the key
    470471    const RefHash2KeysTableBucketElem<TVal>* curElem = fBucketList[hashVal];
     472
    471473    while (curElem)
    472474    {
  • icXML/icXML-devel/src/xercesc/util/RefHash2KeysTableOf.hpp

    r2722 r3565  
    5050        {
    5151        }
    52     ~RefHash2KeysTableBucketElem() {};
     52    ~RefHash2KeysTableBucketElem() {}
    5353
    5454    TVal*                                fData;
  • icXML/icXML-devel/src/xercesc/util/RefHash3KeysIdPool.c

    r2722 r3565  
    220220            //    can be ignored since fAdoptedElements is false.
    221221            if (fAdoptedElems)
     222            {
    222223                delete curElem->fData;
    223 
     224                curElem->fData = 0;
     225            }
    224226            // Then delete the current element and move forward
    225227            // delete curElem;
  • icXML/icXML-devel/src/xercesc/util/RefStackOf.c

    r2722 r3565  
    2727#include <xercesc/util/RefStackOf.hpp>
    2828#endif
     29
     30#include <icxmlc/XMLConfig.hpp>
    2931
    3032XERCES_CPP_NAMESPACE_BEGIN
     
    7678    const XMLSize_t curSize = fVector.size();
    7779    if (curSize == 0)
    78         ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager());
    79 
     80    {
     81        assert (0);
     82        ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager());       
     83    }
    8084    return fVector.elementAt(curSize-1);
    8185}
     
    8589    const XMLSize_t curSize = fVector.size();
    8690    if (curSize == 0)
    87         ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager());
    88 
     91    {
     92        assert (0);
     93        ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager());       
     94    }
    8995    // Orphan off the element from the last slot in the vector
    9096    return fVector.orphanElementAt(curSize-1);
  • icXML/icXML-devel/src/xercesc/util/StringPool.cpp

    r2722 r3565  
    2525// ---------------------------------------------------------------------------
    2626#include <xercesc/util/StringPool.hpp>
     27#include <icxmlc/Array.hpp>
    2728#include <assert.h>
    2829
     
    3233//  XMLStringPool: Constructors and Destructor
    3334// ---------------------------------------------------------------------------
    34 XMLStringPool::XMLStringPool(const  unsigned int  modulus,
    35                              MemoryManager* const manager) :
     35XMLStringPool::XMLStringPool(const  unsigned int /* modulus */, MemoryManager* const manager)
     36: fMemoryManager(manager)
     37#ifndef XML_STRING_POOL_USES_INDIVIDUAL_HEAP_ALLOCATION
     38, fMemoryPool(manager)
     39#endif
     40{
     41    DEBUG_MESSAGE((size_t)(this) << ".XMLStringPool::XMLStringPool()")
     42}
    3643
    37     fMemoryManager(manager)
    38     , fIdMap(0)
    39     , fHashTable(0)
    40     , fMapCapacity(64)
    41     , fCurId(1)
     44XMLStringPool::XMLStringPool(MemoryManager* const manager)
     45: fMemoryManager(manager)
     46#ifndef XML_STRING_POOL_USES_INDIVIDUAL_HEAP_ALLOCATION
     47, fMemoryPool(manager)
     48#endif
    4249{
    43     // Create the hash table, passing it the modulus
    44     fHashTable = new (fMemoryManager) RefHashTableOf<PoolElem>(modulus, false, fMemoryManager);
    45 
    46     // Do an initial allocation of the id map and zero it all out
    47     fIdMap = (PoolElem**) fMemoryManager->allocate
    48     (
    49         fMapCapacity * sizeof(PoolElem*)
    50     ); //new PoolElem*[fMapCapacity];
    51     memset(fIdMap, 0, sizeof(PoolElem*) * fMapCapacity);
     50    DEBUG_MESSAGE((size_t)(this) << ".XMLStringPool::XMLStringPool()")
    5251}
    5352
    5453XMLStringPool::~XMLStringPool()
    5554{
    56     // delete all buckelements, since the hashtable doesn't adopt the elements anymore
    57     for (unsigned int index = 1; index < fCurId; index++)
    58     {
    59         //fIdMap[index]->~PoolElem();                                // we have no destructor
    60         fMemoryManager->deallocate((void*) fIdMap[index]->fString);  // deallocate memory
    61         fMemoryManager->deallocate(fIdMap[index]);                   // deallocate memory
    62     }
    63     delete fHashTable;
    64     fMemoryManager->deallocate(fIdMap); //delete [] fIdMap;
     55    DEBUG_MESSAGE((size_t)(this) << ".XMLStringPool::~XMLStringPool()")
     56    flushAll();
    6557}
    6658
     
    7062void XMLStringPool::flushAll()
    7163{
    72     // delete all buckelements, since the hashtable doesn't adopt the elements anymore
    73     for (unsigned int index = 1; index < fCurId; index++)
    74     {
    75         //fIdMap[index]->~PoolElem();                                // we have no destructor
    76         fMemoryManager->deallocate((void*) fIdMap[index]->fString);  // deallocate memory
    77         fMemoryManager->deallocate(fIdMap[index]);                   // deallocate memory
    78     }
    79     fCurId = 1;
    80     fHashTable->removeAll();
     64    DEBUG_MESSAGE((size_t)(this) << ".XMLStringPool::flushAll()")
     65    fHashMap.flush();
     66    #ifndef XML_STRING_POOL_USES_INDIVIDUAL_HEAP_ALLOCATION
     67    fMemoryPool.flushAll();
     68    #endif
    8169}
    8270
     
    8674unsigned int XMLStringPool::addNewEntry(const XMLCh* const newString)
    8775{
    88     // See if we need to expand the id map
    89     if (fCurId == fMapCapacity)
    90     {
    91         // Calculate the new capacity, create a temp new map, and zero it
    92         const unsigned int newCap = (unsigned int)(fMapCapacity * 1.5);
    93         PoolElem** newMap = (PoolElem**) fMemoryManager->allocate
    94         (
    95             newCap * sizeof(PoolElem*)
    96         ); //new PoolElem*[newCap];
    97         memset(newMap, 0, sizeof(PoolElem*) * newCap);
    98 
    99         //
    100         //  Copy over the old elements from the old map. They are just pointers
    101         //  so we can do it all at once.
    102         //
    103         memcpy(newMap, fIdMap, sizeof(PoolElem*) * fMapCapacity);
    104 
    105         // Clean up the old map and store the new info
    106         fMemoryManager->deallocate(fIdMap); //delete [] fIdMap;
    107         fIdMap = newMap;
    108         fMapCapacity = newCap;
    109     }
    110 
    111     //
    112     //  Ok, now create a new element and add it to the hash table. Then store
    113     //  this new element in the id map at the current id index, then bump the
    114     //  id index.
    115     //
    116     PoolElem* newElem = (PoolElem*) fMemoryManager->allocate(sizeof(PoolElem));
    117     newElem->fId      = fCurId;
    118     newElem->fString  = XMLString::replicate(newString, fMemoryManager);
    119     fHashTable->put((void*)newElem->fString, newElem);
    120     fIdMap[fCurId] = newElem;
    121 
    122     // Bump the current id and return the id of the new elem we just added
    123     fCurId++;
    124     return newElem->fId;
     76    const XMLSize_t length = XMLString::stringLen(newString);
     77    PoolElem newElem;
     78    #ifdef XML_STRING_POOL_USES_INDIVIDUAL_HEAP_ALLOCATION
     79    newElem.fString = XMLString::replicate(newString, length, fMemoryManager);
     80    #else
     81    newElem.fString = const_cast<XMLCh*>(fMemoryPool.insert(newString, length));
     82    #endif
     83    newElem.fLength = length;
     84    newElem.fId = fHashMap.count();
     85    return fHashMap.add(newElem);
    12586}
    12687
     
    145106    if (serEng.isStoring())
    146107    {
    147         serEng<<fCurId;
    148         for (unsigned int index = 1; index < fCurId; index++)
     108        serEng << fHashMap.count();
     109        for (unsigned int index = 0; index < fHashMap.count(); index++)
    149110        {
    150111            const XMLCh* stringData = getValueForId(index);
     
    156117        unsigned int mapSize;
    157118        serEng>>mapSize;
    158         assert(1 == fCurId);  //make sure empty
     119        assert(fHashMap.count() == 0);  //make sure empty
    159120
    160121        for (unsigned int index = 1; index < mapSize; index++)
     
    171132}
    172133
    173 XMLStringPool::XMLStringPool(MemoryManager* const manager) :
    174     fMemoryManager(manager)
    175     , fIdMap(0)
    176     , fHashTable(0)
    177     , fMapCapacity(64)
    178     , fCurId(1)
    179 {
    180     // Create the hash table, passing it the modulus
    181     fHashTable = new (fMemoryManager) RefHashTableOf<PoolElem>(109, false, fMemoryManager);
    182 
    183     // Do an initial allocation of the id map and zero it all out
    184     fIdMap = (PoolElem**) fMemoryManager->allocate
    185     (
    186         fMapCapacity * sizeof(PoolElem*)
    187     ); //new PoolElem*[fMapCapacity];
    188     memset(fIdMap, 0, sizeof(PoolElem*) * fMapCapacity);
    189 }
    190 
    191134XERCES_CPP_NAMESPACE_END
  • icXML/icXML-devel/src/xercesc/util/StringPool.hpp

    r2722 r3565  
    2525#include <icxercesc/util/RefHashTableOf.hpp>
    2626#include <xercesc/internal/XSerializable.hpp>
     27#include <icxmlc/stringpool.h>
     28#include <icxmlc/HashTable.hpp>
     29#include <icxmlc/XMLStringU.hpp>
     30
     31// #define XML_STRING_POOL_USES_INDIVIDUAL_HEAP_ALLOCATION
    2732
    2833XERCES_CPP_NAMESPACE_BEGIN
     
    4348class XMLUTIL_EXPORT XMLStringPool : public XSerializable, public XMemory
    4449{
     50    friend class XMLNamespaceTable;
     51    friend class QName;
     52    friend class XMLGrammarPoolImpl;
     53
    4554public :
    4655    // -----------------------------------------------------------------------
     
    6574    virtual const XMLCh* getValueForId(const unsigned int id) const;
    6675    virtual unsigned int getStringCount() const;
     76    const XMLCh* getInternedValue(const XMLCh * value);
     77
    6778
    6879    /***
     
    7384    XMLStringPool(MemoryManager* const manager);
    7485
     86    MemoryManager * getMemoryManager();
     87
    7588private :
    7689    // -----------------------------------------------------------------------
     
    8093    {
    8194        unsigned int  fId;
    82         XMLCh*        fString;
     95        XMLCh *       fString;
     96        XMLSize_t     fLength;
     97
     98        PoolElem()
     99        : fId(0)
     100        , fString(NULL)
     101        , fLength(0)
     102        {
     103
     104        }
     105
     106        const XMLCh * getKey() const { return fString; }
     107
     108        XMLSize_t getLength() const { return fLength; }
     109
     110        unsigned int getId() const { return fId; }
     111
     112        PoolElem & operator=(const PoolElem & elem)
     113        {
     114            fId = elem.fId;
     115            fString = elem.fString;
     116            fLength = elem.fLength;
     117            return *this;
     118        }
     119
     120        IDISA_ALWAYS_INLINE
     121        bool equals(const XMLCh * otherKey, const unsigned int length) const
     122        {
     123            return (getLength() == length) && (XMLStringU::equals(getKey(), otherKey, length));
     124        }
    83125    };
     126
    84127
    85128    // -----------------------------------------------------------------------
     
    96139
    97140
    98     // -----------------------------------------------------------------------
    99     //  Private data members
     141protected:
     142    // -----------------------------------------------------------------------
     143    //  protected data members
    100144    //
    101145    //  fIdMap
     
    113157    //
    114158    // -----------------------------------------------------------------------
    115     MemoryManager*              fMemoryManager;
    116     PoolElem**                  fIdMap;
    117     RefHashTableOf<PoolElem>*   fHashTable;
    118     unsigned int                fMapCapacity;
    119 
    120 protected:
    121     // protected data members
    122     //  fCurId
    123     //      This is the counter used to assign unique ids. It is just bumped
    124     //      up one for each new string added.
    125     unsigned int                fCurId;
     159    MemoryManager*                      fMemoryManager;
     160    HashTable<PoolElem, XMLCh, 64>      fHashMap;
     161#ifndef XML_STRING_POOL_USES_INDIVIDUAL_HEAP_ALLOCATION
     162    StringPool<XMLCh, 1024>             fMemoryPool;
     163#endif
    126164};
    127165
     
    130168inline unsigned int XMLStringPool::addOrFind(const XMLCh* const newString)
    131169{
    132     PoolElem* elemToFind = fHashTable->get(newString);
    133     if (elemToFind)
    134         return elemToFind->fId;
    135 
    136     return addNewEntry(newString);
     170    unsigned int id = getId(newString);
     171    if (unlikely(id == -1))
     172    {
     173        id = addNewEntry(newString);
     174    }
     175    return id;
    137176}
    138177
    139178inline unsigned int XMLStringPool::getId(const XMLCh* const toFind) const
    140179{
    141     PoolElem* elemToFind = fHashTable->get(toFind);
    142     if (elemToFind)
    143         return elemToFind->fId;
    144 
    145     // Not found, so return zero, which is never a legal id
    146     return 0;
     180    return fHashMap.find(toFind, XMLString::stringLen(toFind));
    147181}
    148182
    149183inline bool XMLStringPool::exists(const XMLCh* const newString) const
    150184{
    151     return fHashTable->containsKey(newString);
     185    return getId(newString) != -1;
    152186}
    153187
    154188inline bool XMLStringPool::exists(const unsigned int id) const
    155189{
    156     return (id > 0 && (id < fCurId));
     190    return (id < getStringCount());
    157191}
    158192
    159193inline const XMLCh* XMLStringPool::getValueForId(const unsigned int id) const
    160194{
    161     if (!id || (id >= fCurId))
     195    if (unlikely(!exists(id)))
     196    {
    162197        ThrowXMLwithMemMgr(IllegalArgumentException, XMLExcepts::StrPool_IllegalId, fMemoryManager);
    163 
     198    }
    164199    // Just index the id map and return that element's string
    165     return fIdMap[id]->fString;
     200    return fHashMap[id].fString;
     201}
     202inline const XMLCh* XMLStringPool::getInternedValue(const XMLCh * value)
     203{
     204    return fHashMap[addOrFind(value)].fString;
    166205}
    167206
    168207inline unsigned int XMLStringPool::getStringCount() const
    169208{
    170     return fCurId-1;
     209    return fHashMap.count();
     210}
     211
     212inline MemoryManager * XMLStringPool::getMemoryManager()
     213{
     214    return fMemoryManager;
    171215}
    172216
  • icXML/icXML-devel/src/xercesc/util/SynchronizedStringPool.cpp

    r2722 r3565  
    5353{
    5454    unsigned int id = fConstPool->getId(newString);
    55     if(id)
     55    if (id != -1)
     56    {
    5657        return id;
    57     // might have to add it to our own table.
    58     // synchronize this bit
     58    }
     59
     60    // might have to add it to our own table. synchronize this bit
    5961    unsigned int constCount = fConstPool->getStringCount();
    6062    XMLMutexLock lockInit(&fMutex);
    6163    id = XMLStringPool::addOrFind(newString);
    62     return id+constCount;
     64    return id + constCount;
    6365}
    6466
    6567bool XMLSynchronizedStringPool::exists(const XMLCh* const newString) const
    6668{
    67     if(fConstPool->exists(newString))
     69    if (fConstPool->exists(newString))
    6870        return true;
    6971
     
    8183    unsigned int constCount = fConstPool->getStringCount();
    8284
    83     if (id <= constCount)
     85    if (id < constCount)
    8486      return true;
    8587
     
    8789    //
    8890    XMLMutexLock lockInit(&const_cast<XMLSynchronizedStringPool*>(this)->fMutex);
    89     return id < fCurId + constCount;
     91    return id < (getStringCount() + constCount);
    9092}
    9193
     
    100102{
    101103    unsigned int retVal = fConstPool->getId(toFind);
    102     if(retVal)
     104    if (retVal != ((unsigned int)-1))
     105    {
    103106        return retVal;
    104 
     107    }
    105108    // make sure we return a truly unique id
    106109    unsigned int constCount = fConstPool->getStringCount();
     
    117120    unsigned int constCount = fConstPool->getStringCount();
    118121    XMLMutexLock lockInit(&const_cast<XMLSynchronizedStringPool*>(this)->fMutex);
    119     return XMLStringPool::getValueForId(id-constCount);
     122    return XMLStringPool::getValueForId(id - constCount);
    120123}
    121124
     
    124127    unsigned int constCount = fConstPool->getStringCount();
    125128    XMLMutexLock lockInit(&const_cast<XMLSynchronizedStringPool*>(this)->fMutex);
    126     return fCurId+constCount-1;
     129    return getStringCount() + constCount;
    127130}
    128131
  • icXML/icXML-devel/src/xercesc/util/ValueStackOf.c

    r2722 r3565  
    2727#include <xercesc/util/ValueStackOf.hpp>
    2828#endif
     29#include <icxmlc/XMLConfig.hpp>
    2930
    3031XERCES_CPP_NAMESPACE_BEGIN
     
    6061    const XMLSize_t curSize = fVector.size();
    6162    if (curSize == 0)
     63    {
     64        assert (0);
    6265        ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager());
    63 
     66    }
    6467    return fVector.elementAt(curSize-1);
    6568}
     
    6972    const XMLSize_t curSize = fVector.size();
    7073    if (curSize == 0)
     74    {
     75        assert (0);
    7176        ThrowXMLwithMemMgr(EmptyStackException, XMLExcepts::Stack_EmptyStack, fVector.getMemoryManager());
    72 
     77    }
    7378    TElem retVal = fVector.elementAt(curSize-1);
    7479    fVector.removeElementAt(curSize-1);
  • icXML/icXML-devel/src/xercesc/util/XMLEBCDICTranscoder.hpp

    r2722 r3565  
    5959    virtual ~XMLEBCDICTranscoder();
    6060
    61 
    6261private :
    6362    // -----------------------------------------------------------------------
  • icXML/icXML-devel/src/xercesc/util/XMLInitializer.cpp

    r2722 r3565  
    1717
    1818/*
    19  * $Id: XMLInitializer.cpp 635560 2008-03-10 14:10:09Z borisk $
     19 * $Id: XMLInitializer.cpp 1329261 2012-04-23 14:35:09Z amassari $
    2020 */
    2121
     
    7171        initializeDOMNodeListImpl();
    7272        initializeDOMNormalizer();
    73     }
     73
     74        // XInclude
     75        //
     76        initializeXInclude();
     77        }
    7478    catch(...) {
    7579        XMLPlatformUtils::panic(PanicHandler::Panic_AllStaticInitErr);
     
    8690    //
    8791
    88     // DOM
     92    // XInclude
     93    //
     94    terminateXInclude();
     95
     96        // DOM
    8997    //
    9098    terminateDOMNormalizer();
  • icXML/icXML-devel/src/xercesc/util/XMLInitializer.hpp

    r2722 r3565  
    1717
    1818/*
    19  * $Id: XMLInitializer.hpp 695427 2008-09-15 11:05:36Z borisk $
     19 * $Id: XMLInitializer.hpp 1329252 2012-04-23 14:24:41Z amassari $
    2020 */
    2121
     
    107107    static void initializeDOMNormalizer();
    108108
     109    // XInclude
     110    //
     111    static void initializeXInclude();
    109112
    110113    //
     
    144147    static void terminateDOMNormalizer();
    145148
     149    // XInclude
     150    //
     151    static void terminateXInclude();
     152
    146153    //
    147154    // Extra initialization.
  • icXML/icXML-devel/src/xercesc/util/XMLURL.cpp

    r3103 r3565  
    12171217{
    12181218    // Simplify things by checking for the psycho scenarios first
    1219     if (!*urlText)
     1219    if (!urlText || !*urlText)
    12201220        return false;
    12211221
  • icXML/icXML-devel/src/xercesc/util/XMLUri.cpp

    r3103 r3565  
    15381538        else if (authority[index] == chPercent)               // '%'
    15391539        {
    1540             if (XMLString::isHex(authority[index+1]) &&     // 1st hex
     1540            if ((index+2) < authLen &&
     1541                XMLString::isHex(authority[index+1]) &&     // 1st hex
    15411542                XMLString::isHex(authority[index+2])  )     // 2nd hex
    15421543                index +=3;
  • icXML/icXML-devel/src/xercesc/util/regx/ParserForXMLSchema.cpp

    r2722 r3565  
    157157    default:
    158158        {
    159         XMLCh chString[] = {chBackSlash, ch, chNull};       
     159        XMLCh chString[] = {chBackSlash, (XMLCh)ch, chNull};
    160160        ThrowXMLwithMemMgr1(ParseException,XMLExcepts::Parser_Process2, chString, getMemoryManager());
    161161        }
  • icXML/icXML-devel/src/xercesc/util/regx/RegxParser.cpp

    r2722 r3565  
    692692                // if regex = [-] then invalid...
    693693                // '[', ']', '-' not allowed and should be escaped
    694                 XMLCh chStr[] = { ch, chNull };
     694                XMLCh chStr[] = { (XMLCh)ch, chNull };
    695695                ThrowXMLwithMemMgr2(ParseException,XMLExcepts::Parser_CC6, chStr, chStr, getMemoryManager());
    696696            }
    697697            if (ch == chDash && getCharData() == chDash && getState() != REGX_T_BACKSOLIDUS && !wasDecoded) {
    698                 XMLCh chStr[] = { ch, chNull };
     698                XMLCh chStr[] = { (XMLCh)ch, chNull };
    699699                ThrowXMLwithMemMgr2(ParseException,XMLExcepts::Parser_CC6, chStr, chStr, getMemoryManager());
    700700            }
     
    721721
    722722                    XMLInt32 rangeEnd = getCharData();
    723                     XMLCh rangeEndStr[] = { rangeEnd, chNull };
     723                    XMLCh rangeEndStr[] = { (XMLCh)rangeEnd, chNull };
    724724
    725725                    if (type == REGX_T_CHAR) {
     
    738738
    739739                    if (ch > rangeEnd) {
    740                         XMLCh chStr[] = { ch, chNull };
     740                        XMLCh chStr[] = { (XMLCh)ch, chNull };
    741741                        ThrowXMLwithMemMgr2(ParseException,XMLExcepts::Parser_Ope3, rangeEndStr, chStr, getMemoryManager());
    742742                    }
     
    846846    default:
    847847    {
    848         XMLCh chString[] = {chBackSlash, ch, chNull};       
     848        XMLCh chString[] = {chBackSlash, (XMLCh)ch, chNull};
    849849        ThrowXMLwithMemMgr1(ParseException,XMLExcepts::Parser_Process2, chString, getMemoryManager());
    850850    }
  • icXML/icXML-devel/src/xercesc/validators/common/ContentSpecNode.cpp

    r2732 r3565  
    3838// ---------------------------------------------------------------------------
    3939
    40 ContentSpecNode::ContentSpecNode(const ContentSpecNode& toCopy) :
    41     XSerializable(toCopy)
    42     , XMemory(toCopy)
    43     , fMemoryManager(toCopy.fMemoryManager)
    44     , fElement(0)
    45     , fElementDecl(toCopy.fElementDecl)
    46     , fFirst(0)
    47     , fSecond(0)
    48     , fType(toCopy.fType)
    49     , fAdoptFirst(true)
    50     , fAdoptSecond(true)
    51     , fMinOccurs(toCopy.fMinOccurs)
    52     , fMaxOccurs(toCopy.fMaxOccurs)
    53 {
    54     const QName* tempElement = toCopy.getElement();
    55     if (tempElement)
    56         fElement = new (fMemoryManager) QName(*tempElement);
    57 
    58     const ContentSpecNode *tmp = toCopy.getFirst();
    59     if (tmp)
    60         fFirst = new (fMemoryManager) ContentSpecNode(*tmp);
    61 
    62     tmp = toCopy.getSecond();
    63     if (tmp)
    64         fSecond = new (fMemoryManager) ContentSpecNode(*tmp);
     40ContentSpecNode::ContentSpecNode(const ContentSpecNode& toCopy)
     41: XSerializable(toCopy)
     42, XMemory(toCopy)
     43, fMemoryManager(toCopy.fMemoryManager)
     44, fElement(toCopy.fElement ? new (fMemoryManager) QName(*toCopy.fElement) : 0)
     45, fElementDecl(toCopy.fElementDecl)
     46, fFirst(toCopy.getFirst() ? new (fMemoryManager) ContentSpecNode(*toCopy.getFirst()) : 0)
     47, fSecond(toCopy.getSecond() ? new (fMemoryManager) ContentSpecNode(*toCopy.getSecond()) : 0)
     48, fType(toCopy.fType)
     49, fAdoptFirst(true)
     50, fAdoptSecond(true)
     51, fMinOccurs(toCopy.fMinOccurs)
     52, fMaxOccurs(toCopy.fMaxOccurs)
     53, fStringPool(toCopy.fStringPool)
     54{
     55
    6556}
    6657
     
    281272IMPL_XSERIALIZABLE_TOCREATE(ContentSpecNode)
    282273
    283 void ContentSpecNode::serialize(XSerializeEngine& serEng)
    284 {
    285     /***
    286      *  Since fElement, fFirst, fSecond are NOT created by the default
    287      *  constructor, we need to create them dynamically.
    288      ***/
    289 
    290     if (serEng.isStoring())
    291     {
    292         serEng<<fElement;
    293         XMLElementDecl::storeElementDecl(serEng, fElementDecl);
    294         serEng<<fFirst;
    295         serEng<<fSecond;
    296 
    297         serEng<<(int)fType;
    298         serEng<<fAdoptFirst;
    299         serEng<<fAdoptSecond;
    300         serEng<<fMinOccurs;
    301         serEng<<fMaxOccurs;
    302     }
    303     else
    304     {
    305         serEng>>fElement;
    306         fElementDecl = XMLElementDecl::loadElementDecl(serEng);
    307         serEng>>fFirst;
    308         serEng>>fSecond;
    309 
    310         int type;
    311         serEng>>type;
    312         fType = (NodeTypes)type;
    313 
    314         serEng>>fAdoptFirst;
    315         serEng>>fAdoptSecond;
    316         serEng>>fMinOccurs;
    317         serEng>>fMaxOccurs;
    318     }
    319 
     274void ContentSpecNode::serialize(XSerializeEngine&)
     275{
     276    DEPRECATED_FEATURE_IN_ICXML;
    320277}
    321278
  • icXML/icXML-devel/src/xercesc/validators/common/ContentSpecNode.hpp

    r2722 r3565  
    2525#include <icxercesc/framework/XMLElementDecl.hpp>
    2626#include <xercesc/framework/MemoryManager.hpp>
    27 
    2827#include <xercesc/internal/XSerializable.hpp>
     28#include <icxmlc/XMLConfig.hpp>
    2929
    3030XERCES_CPP_NAMESPACE_BEGIN
     
    3232class XMLBuffer;
    3333class Grammar;
     34class XMLStringPool;
    3435
    3536
    3637class XMLUTIL_EXPORT ContentSpecNode : public XSerializable, public XMemory
    3738{
     39    friend class DFAContentModel;
     40
    3841public :
    3942    // -----------------------------------------------------------------------
     
    7174    // -----------------------------------------------------------------------
    7275    ContentSpecNode(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
     76
    7377    ContentSpecNode
    7478    (
     
    7680        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    7781    );
     82
    7883    ContentSpecNode
    7984    (
     
    8186        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    8287    );
     88
    8389    ContentSpecNode
    8490    (
     
    8793        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    8894    );
     95
    8996    ContentSpecNode
    9097    (
     
    9299        ,       ContentSpecNode* const  firstToAdopt
    93100        ,       ContentSpecNode* const  secondToAdopt
    94         , const bool                    adoptFirst = true
    95         , const bool                    adoptSecond = true
     101        ,       XMLStringPool* const    qNameManager = 0
    96102        ,       MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager
    97103    );
     104
     105    ContentSpecNode
     106    (
     107        const   NodeTypes               type
     108        ,       ContentSpecNode* const  firstToAdopt
     109        ,       ContentSpecNode* const  secondToAdopt
     110        , const bool                    adoptFirst
     111        , const bool                    adoptSecond
     112        ,       XMLStringPool* const    qNameManager
     113        ,       MemoryManager* const    manager
     114    );
     115
     116
    98117    ContentSpecNode(const ContentSpecNode&);
     118
    99119        ~ContentSpecNode();
     120
     121    // -----------------------------------------------------------------------
     122    //  Deprecated Constructor
     123    // -----------------------------------------------------------------------
     124    ContentSpecNode(const  NodeTypes, ContentSpecNode* const, ContentSpecNode* const, const bool, const bool, MemoryManager* const);
    100125
    101126    // -----------------------------------------------------------------------
     
    198223    int                 fMinOccurs;
    199224    int                 fMaxOccurs;
     225    XMLStringPool *     fStringPool;
    200226};
    201227
     
    203229//  ContentSpecNode: Constructors and Destructor
    204230// ---------------------------------------------------------------------------
    205 inline ContentSpecNode::ContentSpecNode(MemoryManager* const manager) :
    206 
    207     fMemoryManager(manager)
    208     , fElement(0)
    209     , fElementDecl(0)
    210     , fFirst(0)
    211     , fSecond(0)
    212     , fType(ContentSpecNode::Leaf)
    213     , fAdoptFirst(true)
    214     , fAdoptSecond(true)
    215     , fMinOccurs(1)
    216     , fMaxOccurs(1)
    217 {
     231inline ContentSpecNode::ContentSpecNode(MemoryManager* const manager)
     232: fMemoryManager(manager)
     233, fElement(0)
     234, fElementDecl(0)
     235, fFirst(0)
     236, fSecond(0)
     237, fType(ContentSpecNode::Leaf)
     238, fAdoptFirst(true)
     239, fAdoptSecond(true)
     240, fMinOccurs(1)
     241, fMaxOccurs(1)
     242, fStringPool(0)
     243{
     244
    218245}
    219246
    220247inline
    221 ContentSpecNode::ContentSpecNode(QName* const element,
    222                                  MemoryManager* const manager) :
    223 
    224     fMemoryManager(manager)
    225     , fElement(0)
    226     , fElementDecl(0)
    227     , fFirst(0)
    228     , fSecond(0)
    229     , fType(ContentSpecNode::Leaf)
    230     , fAdoptFirst(true)
    231     , fAdoptSecond(true)
    232     , fMinOccurs(1)
    233     , fMaxOccurs(1)
    234 {
    235     if (element)
    236         fElement = new (fMemoryManager) QName(*element);
     248ContentSpecNode::ContentSpecNode(QName* const element, MemoryManager* const manager)
     249: fMemoryManager(manager)
     250, fElement(new (fMemoryManager) QName(*element))
     251, fElementDecl(0)
     252, fFirst(0)
     253, fSecond(0)
     254, fType(ContentSpecNode::Leaf)
     255, fAdoptFirst(true)
     256, fAdoptSecond(true)
     257, fMinOccurs(1)
     258, fMaxOccurs(1)
     259, fStringPool(element->fStringPool)
     260{
     261
    237262}
    238263
    239264inline
    240 ContentSpecNode::ContentSpecNode(XMLElementDecl* const elemDecl,
    241                                  MemoryManager* const manager) :
    242 
    243     fMemoryManager(manager)
    244     , fElement(0)
    245     , fElementDecl(elemDecl)
    246     , fFirst(0)
    247     , fSecond(0)
    248     , fType(ContentSpecNode::Leaf)
    249     , fAdoptFirst(true)
    250     , fAdoptSecond(true)
    251     , fMinOccurs(1)
    252     , fMaxOccurs(1)
    253 {
    254     if (elemDecl)
    255         fElement = new (manager) QName(*(elemDecl->getElementName()));
     265ContentSpecNode::ContentSpecNode(XMLElementDecl* const elemDecl, MemoryManager* const manager)
     266: fMemoryManager(manager)
     267, fElement(new (manager) QName(*(elemDecl->getElementName())))
     268, fElementDecl(elemDecl)
     269, fFirst(0)
     270, fSecond(0)
     271, fType(ContentSpecNode::Leaf)
     272, fAdoptFirst(true)
     273, fAdoptSecond(true)
     274, fMinOccurs(1)
     275, fMaxOccurs(1)
     276, fStringPool(elemDecl->fElementName->fStringPool)
     277{
     278
    256279}
    257280
    258281inline
    259 ContentSpecNode::ContentSpecNode( QName* const element
    260                                 , const bool copyQName
    261                                 , MemoryManager* const manager) :
    262 
    263     fMemoryManager(manager)
    264     , fElement(0)
    265     , fElementDecl(0)
    266     , fFirst(0)
    267     , fSecond(0)
    268     , fType(ContentSpecNode::Leaf)
    269     , fAdoptFirst(true)
    270     , fAdoptSecond(true)
    271     , fMinOccurs(1)
    272     , fMaxOccurs(1)
    273 {
    274     if (copyQName)
    275     {
    276         if (element)
    277             fElement = new (fMemoryManager) QName(*element);
    278     }
    279     else
    280     {
    281         fElement = element;
    282     }
     282ContentSpecNode::ContentSpecNode( QName* const element, const bool copyQName, MemoryManager* const manager)
     283: fMemoryManager(manager)
     284, fElement(copyQName ? new (fMemoryManager) QName(*element) : element)
     285, fElementDecl(0)
     286, fFirst(0)
     287, fSecond(0)
     288, fType(ContentSpecNode::Leaf)
     289, fAdoptFirst(true)
     290, fAdoptSecond(true)
     291, fMinOccurs(1)
     292, fMaxOccurs(1)
     293, fStringPool(element->fStringPool)
     294{
     295
     296}
     297
     298inline
     299ContentSpecNode::ContentSpecNode(const  NodeTypes              type
     300                                ,       ContentSpecNode* const firstAdopt
     301                                ,       ContentSpecNode* const secondAdopt
     302                                ,       XMLStringPool* const   qNameManager
     303                                ,       MemoryManager* const   manager)
     304: fMemoryManager(manager)
     305, fElement(0)
     306, fElementDecl(0)
     307, fFirst(firstAdopt)
     308, fSecond(secondAdopt)
     309, fType(type)
     310, fAdoptFirst(true)
     311, fAdoptSecond(true)
     312, fMinOccurs(1)
     313, fMaxOccurs(1)
     314, fStringPool(qNameManager)
     315{
     316
     317
     318
    283319}
    284320
     
    289325                                , const bool                   adoptFirst
    290326                                , const bool                   adoptSecond
    291                                 ,       MemoryManager* const   manager) :
    292 
    293     fMemoryManager(manager)
    294     , fElement(0)
    295     , fElementDecl(0)
    296     , fFirst(firstAdopt)
    297     , fSecond(secondAdopt)
    298     , fType(type)
    299     , fAdoptFirst(adoptFirst)
    300     , fAdoptSecond(adoptSecond)
    301     , fMinOccurs(1)
    302     , fMaxOccurs(1)
    303 {
    304 }
     327                                ,       XMLStringPool* const   qNameManager
     328                                ,       MemoryManager* const   manager)
     329: fMemoryManager(manager)
     330, fElement(0)
     331, fElementDecl(0)
     332, fFirst(firstAdopt)
     333, fSecond(secondAdopt)
     334, fType(type)
     335, fAdoptFirst(adoptFirst)
     336, fAdoptSecond(adoptSecond)
     337, fMinOccurs(1)
     338, fMaxOccurs(1)
     339, fStringPool(qNameManager)
     340{
     341
     342
     343
     344}
     345
    305346
    306347inline ContentSpecNode::~ContentSpecNode()
     
    308349    // Delete our children, which cause recursive cleanup
    309350    if (fAdoptFirst) {
    310                 delete fFirst;
     351        delete fFirst;
    311352    }
    312353
    313354    if (fAdoptSecond) {
    314                 delete fSecond;
     355        delete fSecond;
    315356    }
    316357
     
    407448{
    408449    delete fElement;
    409     fElement = 0;
    410     if (element)
    411         fElement = new (fMemoryManager) QName(*element);
     450    fElement = (element) ? new (fMemoryManager) QName(*element)  : 0;
    412451}
    413452
     
    463502}
    464503
     504#ifdef PRINT_DEBUG_MESSAGE
     505static std::ostream & operator << (std::ostream & out, const ContentSpecNode & node)
     506{
     507    out << '{' << node.getElement() << ',';
     508
     509    #define PRINT_CONTENT_SPEC_NODE_TYPE(x) case ContentSpecNode::x: out << #x; break
     510
     511    switch (node.getType())
     512    {
     513        PRINT_CONTENT_SPEC_NODE_TYPE(Leaf);
     514        PRINT_CONTENT_SPEC_NODE_TYPE(ZeroOrOne);
     515        PRINT_CONTENT_SPEC_NODE_TYPE(ZeroOrMore);
     516        PRINT_CONTENT_SPEC_NODE_TYPE(OneOrMore);
     517        PRINT_CONTENT_SPEC_NODE_TYPE(Choice);
     518        PRINT_CONTENT_SPEC_NODE_TYPE(Sequence);
     519        PRINT_CONTENT_SPEC_NODE_TYPE(Any);
     520        PRINT_CONTENT_SPEC_NODE_TYPE(Any_Other);
     521        PRINT_CONTENT_SPEC_NODE_TYPE(Any_NS);
     522        PRINT_CONTENT_SPEC_NODE_TYPE(All);
     523        PRINT_CONTENT_SPEC_NODE_TYPE(Any_NS_Choice);
     524        PRINT_CONTENT_SPEC_NODE_TYPE(ModelGroupSequence);
     525        PRINT_CONTENT_SPEC_NODE_TYPE(Any_Lax);
     526        PRINT_CONTENT_SPEC_NODE_TYPE(Any_Other_Lax);
     527        PRINT_CONTENT_SPEC_NODE_TYPE(ModelGroupChoice);
     528        PRINT_CONTENT_SPEC_NODE_TYPE(Any_Skip);
     529        PRINT_CONTENT_SPEC_NODE_TYPE(Any_Other_Skip);
     530        PRINT_CONTENT_SPEC_NODE_TYPE(Any_NS_Skip);
     531        PRINT_CONTENT_SPEC_NODE_TYPE(UnknownType);
     532    }
     533
     534    #undef PRINT_CONTENT_SPEC_NODE_TYPE
     535
     536    out << ',' << node.getMinOccurs() << '-' << node.getMaxOccurs();
     537    if (node.getFirst())
     538    {
     539        out << ",first=" << node.getFirst();
     540    }
     541    if (node.getSecond())
     542    {
     543        out << ",second=" << node.getSecond();
     544    }
     545    out  << '}';
     546    return out;
     547}
     548
     549static std::ostream & operator << (std::ostream & out, const ContentSpecNode * node)
     550{
     551    if (likely(node != 0))
     552    {
     553        out << *node;
     554    }
     555    return out;
     556}
     557#endif
     558
     559
     560inline
     561ContentSpecNode::ContentSpecNode(const  NodeTypes, ContentSpecNode* const, ContentSpecNode* const, const bool, const bool, MemoryManager* const)
     562{
     563    DEPRECATED_FEATURE_IN_ICXML;
     564}
     565
     566
    465567XERCES_CPP_NAMESPACE_END
    466568
  • icXML/icXML-devel/src/xercesc/validators/datatype/UnionDatatypeValidator.cpp

    r2722 r3565  
    4343,fEnumeration(0)
    4444,fMemberTypeValidators(0)
    45 
     45,fValidatingMemberType(0)
    4646{}
    4747
     
    238238                                        ,       MemoryManager*     const manager)
    239239{
    240 
    241     DatatypeValidator* bv = getBaseValidator();
     240    UnionDatatypeValidator * bv = (UnionDatatypeValidator*)getBaseValidator();
    242241    if (bv)
    243         ((UnionDatatypeValidator*)bv)->checkContent(content, context, true, manager);
     242    {
     243        bv->checkContent(content, context, true, manager);
     244        fValidatingMemberType = bv->fValidatingMemberType;
     245    }
    244246    else
    245     {   // 3) native union type
     247    {
     248        fValidatingMemberType = 0;
     249        // 3) native union type
    246250        // check content against each member type validator in Union
    247251        // report an error only in case content is not valid against all member datatypes.
     
    259263               
    260264                //set the validator of the type actually used to validate the content
    261                 DatatypeValidator *dtv = fMemberTypeValidators->elementAt(i);               
     265                DatatypeValidator * dtv = fMemberTypeValidators->elementAt(i);
    262266                // context will be null during schema construction
    263                 if(context)
     267                fValidatingMemberType = dtv;
     268                // context will be null during schema construction
     269                if (context)
     270                {
    264271                    context->setValidatingMemberType(dtv);
     272                }
    265273            }
    266274            catch (XMLException&)
  • icXML/icXML-devel/src/xercesc/validators/datatype/UnionDatatypeValidator.hpp

    r2722 r3565  
    9898                        ) const;
    9999
     100
     101    DatatypeValidator * getValidatingMemberType() const;
     102
    100103    //@}
    101104
     
    211214     bool                             fMemberTypesInherited;
    212215     RefArrayVectorOf<XMLCh>*         fEnumeration;
    213      RefVectorOf<DatatypeValidator>*  fMemberTypeValidators;   
     216     RefVectorOf<DatatypeValidator>*  fMemberTypeValidators;
     217     DatatypeValidator *              fValidatingMemberType;
    214218};
    215219
     
    311315}
    312316
     317inline DatatypeValidator * UnionDatatypeValidator::getValidatingMemberType() const
     318{
     319    return fValidatingMemberType;
     320}
     321
    313322XERCES_CPP_NAMESPACE_END
    314323
  • icXML/icXML-devel/src/xercesc/validators/schema/XSDLocator.hpp

    r2722 r3565  
    4747
    4848    //@}
     49
     50
     51
     52    virtual void getLocationInfo(LocationInfo & locationInfo) const;
    4953
    5054    /** @name The locator interface */
     
    137141}
    138142
     143inline void XSDLocator::getLocationInfo(LocationInfo & locationInfo) const
     144{
     145    locationInfo.systemId = fSystemId;
     146    locationInfo.publicId = fPublicId;
     147    locationInfo.lineNumber = fLineNo;
     148    locationInfo.colNumber = fColumnNo;
     149}
     150
    139151XERCES_CPP_NAMESPACE_END
    140152
  • icXML/icXML-devel/src/xercesc/validators/schema/XercesAttGroupInfo.cpp

    r2722 r3565  
    5656    , fMemoryManager(manager)
    5757{
    58 
     58    DEBUG_MESSAGE("XercesAttGroupInfo::XercesAttGroupInfo(" << attGroupNameId << ',' << attGroupNamespaceId << ')')
    5959}
    6060
     
    6666}
    6767
    68 bool XercesAttGroupInfo::containsAttribute(const XMLCh* const name,
    69                                            const unsigned int uri) {
    70 
    71     if (fAttributes) {
    72 
     68bool XercesAttGroupInfo::containsAttribute(const XMLCh* const name, const unsigned int uri)
     69{
     70    if (fAttributes)
     71    {
    7372        XMLSize_t attCount = fAttributes->size();
    7473
    75         if (attCount) {
    76 
    77             for (XMLSize_t i=0; i < attCount; i++) {
    78 
     74        if (attCount)
     75        {
     76            for (XMLSize_t i=0; i < attCount; i++)
     77            {
    7978                QName* attName = fAttributes->elementAt(i)->getAttName();
    80 
    81                 if (attName->getURI() == uri &&
    82                     XMLString::equals(attName->getLocalPart(),name)) {
     79                if (attName->getURI() == uri && attName->getLocalPart() == name)
     80                {
    8381                    return true;
    8482                }
  • icXML/icXML-devel/src/xercesc/validators/schema/XercesAttGroupInfo.hpp

    r2779 r3565  
    201201                                             const bool toClone) {
    202202
    203     if (!fAttributes) {
     203    if (!fAttributes)
     204    {
    204205        fAttributes = new (fMemoryManager) RefVectorOf<SchemaAttDef>(4, true, fMemoryManager);
    205206    }
    206207
    207     if (toClone) {
     208    if (toClone)
     209    {
    208210        SchemaAttDef* clonedAttDef = new (fMemoryManager) SchemaAttDef(toAdd);
    209 
    210         if (!clonedAttDef->getBaseAttDecl())
    211             clonedAttDef->setBaseAttDecl(toAdd);
    212 
    213211        fAttributes->addElement(clonedAttDef);
    214212    }
    215     else {
     213    else
     214    {
    216215        fAttributes->addElement(toAdd);
    217216    }
    218217}
    219218
    220 inline void XercesAttGroupInfo::addAnyAttDef(SchemaAttDef* const toAdd,
    221                                              const bool toClone) {
    222 
    223     if (!fAnyAttributes) {
     219inline void XercesAttGroupInfo::addAnyAttDef(SchemaAttDef* const toAdd, const bool toClone)
     220{
     221    if (!fAnyAttributes)
     222    {
    224223        fAnyAttributes = new (fMemoryManager) RefVectorOf<SchemaAttDef>(2, true, fMemoryManager);
    225224    }
    226225
    227     if (toClone) {
     226    if (toClone)
     227    {
    228228        SchemaAttDef* clonedAttDef = new (fMemoryManager) SchemaAttDef(toAdd);
    229 
    230         if (!clonedAttDef->getBaseAttDecl())
    231             clonedAttDef->setBaseAttDecl(toAdd);
    232 
    233229        fAnyAttributes->addElement(clonedAttDef);
    234230    }
    235     else {
     231    else
     232    {
    236233        fAnyAttributes->addElement(toAdd);
    237234    }
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/FieldActivator.cpp

    r2722 r3565  
    2727#include <xercesc/validators/schema/identity/ValueStoreCache.hpp>
    2828#include <xercesc/validators/schema/identity/XPathMatcherStack.hpp>
     29#include <xercesc/util/StringPool.hpp>
    2930
    3031XERCES_CPP_NAMESPACE_BEGIN
     
    8586//  FieldActivator: Operator methods
    8687// ---------------------------------------------------------------------------
    87 XPathMatcher* FieldActivator::activateField(IC_Field* const field, const int initialDepth) {
    88 
     88XPathMatcher* FieldActivator::activateField(IC_Field* const field, XMLStringPool * const stringPool, const int initialDepth)
     89{
    8990    ValueStore* valueStore = fValueStoreCache->getValueStoreFor(field, initialDepth);
    90     XPathMatcher* matcher = field->createMatcher(this, valueStore, fMemoryManager);
     91    XPathMatcher* matcher = field->createMatcher(this, valueStore, stringPool, fMemoryManager);
    9192
    9293    setMayMatch(field, true);
     
    118119}
    119120
     121XPathMatcher* FieldActivator::activateField(IC_Field* const, const int)
     122{
     123    DEPRECATED_FEATURE_IN_ICXML;
     124}
     125
    120126XERCES_CPP_NAMESPACE_END
    121127
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/FieldActivator.hpp

    r2722 r3565  
    4343class IC_Field;
    4444class XPathMatcherStack;
    45 
     45class XMLStringPool;
    4646
    4747class VALIDATORS_EXPORT FieldActivator : public XMemory
     
    5151    //  Constructors/Destructor
    5252    // -----------------------------------------------------------------------
    53     FieldActivator(ValueStoreCache* const valueStoreCache,
    54                    XPathMatcherStack* const matcherStack,
    55                    MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
     53    FieldActivator
     54    (
     55        ValueStoreCache* const      valueStoreCache
     56        , XPathMatcherStack* const  matcherStack
     57        , MemoryManager* const      manager = XMLPlatformUtils::fgMemoryManager
     58    );
     59
    5660        FieldActivator(const FieldActivator& other);
     61
     62
    5763        ~FieldActivator();
    5864
     
    8995      */
    9096    XPathMatcher* activateField(IC_Field* const field, const int initialDepth);
     97
     98    XPathMatcher* activateField(IC_Field* const field, XMLStringPool * const stringPool, const int initialDepth);
    9199
    92100    /**
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/IC_Field.cpp

    r3153 r3565  
    3434//  FieldMatcher: Constructors and Destructor
    3535// ---------------------------------------------------------------------------
    36 FieldMatcher::FieldMatcher(XercesXPath* const xpath,
    37                            IC_Field* const aField,
    38                            ValueStore* const valueStore,
    39                            FieldActivator* const fieldActivator,
    40                            MemoryManager* const manager)
    41     : XPathMatcher(xpath, (IdentityConstraint*) 0, manager)
    42     , fValueStore(valueStore)
    43     , fField(aField)   
    44     , fFieldActivator(fieldActivator)
     36FieldMatcher::FieldMatcher
     37(
     38    XercesXPath* const      xpath
     39    , IC_Field* const       aField
     40    , ValueStore* const     valueStore
     41    , FieldActivator* const fieldActivator
     42    , XMLStringPool* const  stringPool
     43    , MemoryManager* const  manager
     44)
     45: XPathMatcher(xpath, (IdentityConstraint*) 0, stringPool, manager)
     46, fValueStore(valueStore)
     47, fField(aField)
     48, fFieldActivator(fieldActivator)
    4549{
    4650}
     51
    4752
    4853// ---------------------------------------------------------------------------
     
    7378    , fIdentityConstraint(identityConstraint)
    7479{
     80
    7581}
    7682
     
    99105XPathMatcher* IC_Field::createMatcher(FieldActivator* const fieldActivator,
    100106                                      ValueStore* const valueStore,
     107                                      XMLStringPool * const stringPool,
    101108                                      MemoryManager* const manager)
    102109{
    103     return new (manager) FieldMatcher(fXPath, this, valueStore, fieldActivator, manager);
     110    return new (manager) FieldMatcher(fXPath, this, valueStore, fieldActivator, stringPool, manager);
    104111}
    105112
     
    134141}
    135142
     143FieldMatcher::FieldMatcher(XercesXPath* const, IC_Field* const , ValueStore* const , FieldActivator* const , MemoryManager* const )
     144: XPathMatcher(0, (IdentityConstraint*)0, 0, 0)
     145{
     146    DEPRECATED_FEATURE_IN_ICXML;
     147}
     148
     149XPathMatcher* IC_Field::createMatcher(FieldActivator* const, ValueStore* const, MemoryManager* const)
     150{
     151    DEPRECATED_FEATURE_IN_ICXML;
     152}
     153
     154
    136155XERCES_CPP_NAMESPACE_END
    137156
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/IC_Field.hpp

    r2722 r3565  
    4646    //  Constructors/Destructor
    4747    // -----------------------------------------------------------------------
    48     IC_Field(XercesXPath* const xpath,
    49              IdentityConstraint* const identityConstraint);
     48    IC_Field
     49    (
     50        XercesXPath* const xpath
     51        , IdentityConstraint* const identityConstraint
     52    );
     53
     54
     55
    5056        ~IC_Field();
    5157
     
    6975        FieldActivator* const fieldActivator
    7076        , ValueStore* const valueStore
     77        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     78    );
     79
     80    XPathMatcher* createMatcher
     81    (
     82        FieldActivator* const fieldActivator
     83        , ValueStore* const valueStore
     84        , XMLStringPool * const stringPool
    7185        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    7286    );
     
    124138                 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
    125139
     140    FieldMatcher(XercesXPath* const anXPath,
     141                 IC_Field* const aField,
     142                 ValueStore* const valueStore,
     143                 FieldActivator* const fieldActivator,
     144                 XMLStringPool* const stringPool,
     145                 MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
     146
    126147    // -----------------------------------------------------------------------
    127148    //  Unimplemented constructors and operators
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/IC_Key.cpp

    r2722 r3565  
    3030//  IC_Key: Constructors and Destructor
    3131// ---------------------------------------------------------------------------
    32 IC_Key::IC_Key(const XMLCh* const identityConstraintName,
    33                const XMLCh* const elemName,
    34                            MemoryManager* const manager)
    35 :IdentityConstraint(identityConstraintName, elemName, manager)
     32IC_Key::IC_Key
     33(
     34    const XMLCh* const      identityConstraintName
     35    , const XMLCh* const    elemName
     36    , XMLStringPool* const  stringPool
     37    , MemoryManager* const  manager
     38)
     39:IdentityConstraint(identityConstraintName, elemName, stringPool, manager)
    3640{
    3741}
     
    6064}
    6165
     66IC_Key::IC_Key(const XMLCh* const, const XMLCh* const, MemoryManager* const)
     67:IdentityConstraint(0, 0, 0, 0)
     68{
     69    DEPRECATED_FEATURE_IN_ICXML;
     70}
     71
     72
    6273XERCES_CPP_NAMESPACE_END
    6374
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/IC_Key.hpp

    r3153 r3565  
    3737    //  Constructors/Destructor
    3838    // -----------------------------------------------------------------------
    39     IC_Key(const XMLCh* const identityConstraintName,
    40            const XMLCh* const elemName,
    41            MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
     39    IC_Key
     40    (
     41        const XMLCh* const identityConstraintName
     42        , const XMLCh* const elemName
     43        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     44    );
     45
     46    explicit IC_Key
     47    (
     48        const XMLCh* const identityConstraintName
     49        , const XMLCh* const elemName
     50        , XMLStringPool* const stringPool
     51        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     52    );
     53
    4254        ~IC_Key();
    4355
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/IC_KeyRef.cpp

    r2722 r3565  
    3030//  IC_KeyRef: Constructors and Destructor
    3131// ---------------------------------------------------------------------------
    32 IC_KeyRef::IC_KeyRef(const XMLCh* const identityConstraintName,
    33                      const XMLCh* const elemName,
    34                      IdentityConstraint* const icKey,
    35                      MemoryManager* const manager)
    36     : IdentityConstraint(identityConstraintName, elemName, manager)
    37     , fKey(icKey)
     32IC_KeyRef::IC_KeyRef
     33(
     34    const XMLCh* const          identityConstraintName
     35    , const XMLCh* const        elemName
     36    , IdentityConstraint* const icKey
     37    , XMLStringPool* const      stringPool
     38    , MemoryManager* const      manager
     39)
     40: IdentityConstraint(identityConstraintName, elemName, stringPool, manager)
     41, fKey(icKey)
    3842{
     43
    3944}
    4045
     
    6671
    6772IC_KeyRef::IC_KeyRef(MemoryManager* const manager)
    68 :IdentityConstraint(0, 0, manager)
     73:IdentityConstraint(0, 0, 0, manager)
    6974,fKey(0)
    7075{
     76
    7177}
     78
     79IC_KeyRef::IC_KeyRef(const XMLCh* const , const XMLCh* const , IdentityConstraint* const , MemoryManager* const )
     80: IdentityConstraint(0, 0, 0, 0)
     81{
     82    DEPRECATED_FEATURE_IN_ICXML;
     83}
     84
    7285
    7386XERCES_CPP_NAMESPACE_END
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/IC_KeyRef.hpp

    r3153 r3565  
    3737    //  Constructors/Destructor
    3838    // -----------------------------------------------------------------------
    39     IC_KeyRef(const XMLCh* const identityConstraintName,
    40               const XMLCh* const elemName,
    41               IdentityConstraint* const icKey,
    42               MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
     39    IC_KeyRef
     40    (
     41        const XMLCh* const identityConstraintName
     42        , const XMLCh* const elemName
     43        , IdentityConstraint* const icKey
     44        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     45    );
     46
     47    explicit IC_KeyRef
     48    (
     49        const XMLCh* const identityConstraintName
     50        , const XMLCh* const elemName
     51        , IdentityConstraint* const icKey
     52        , XMLStringPool* const stringPool
     53        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     54    );
     55
    4356        ~IC_KeyRef();
    4457
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/IC_Selector.cpp

    r3153 r3565  
    2828#include <icxercesc/validators/schema/identity/IdentityConstraint.hpp>
    2929#include <xercesc/validators/schema/identity/FieldActivator.hpp>
     30#include <xercesc/util/StringPool.hpp>
    3031
    3132XERCES_CPP_NAMESPACE_BEGIN
     
    3435//  SelectorMatcher: Constructors and Destructor
    3536// ---------------------------------------------------------------------------
    36 SelectorMatcher::SelectorMatcher(XercesXPath* const xpath,
    37                                  IC_Selector* const selector,
    38                                  FieldActivator* const fieldActivator,
    39                                  const int initialDepth,
    40                                  MemoryManager* const manager)
    41     : XPathMatcher(xpath, selector->getIdentityConstraint(), manager)
    42     , fInitialDepth(initialDepth)
    43     , fElementDepth(0)
    44     , fMatchedDepth(-1)
    45     , fSelector(selector)
    46     , fFieldActivator(fieldActivator)
    47 {
    48 }
     37SelectorMatcher::SelectorMatcher
     38(
     39    XercesXPath* const xpath
     40    , IC_Selector* const selector
     41    , FieldActivator* const fieldActivator
     42    , const int initialDepth
     43    , XMLStringPool * stringPool
     44    , MemoryManager* const manager
     45)
     46: XPathMatcher(xpath, selector->getIdentityConstraint(), stringPool, manager)
     47, fInitialDepth(initialDepth)
     48, fElementDepth(0)
     49, fMatchedDepth(-1)
     50, fSelector(selector)
     51, fStringPool(stringPool)
     52, fFieldActivator(fieldActivator)
     53{
     54
     55}
     56
     57
    4958
    5059// ---------------------------------------------------------------------------
     
    7180    // activate the fields, if selector is matched
    7281    unsigned char matched = isMatched();
    73     if ((fMatchedDepth == -1 && ((matched & XP_MATCHED) == XP_MATCHED))
    74         || ((matched & XP_MATCHED_D) == XP_MATCHED_D)) {
    75 
     82    if ((fMatchedDepth == -1 && ((matched & XP_MATCHED) == XP_MATCHED)) || ((matched & XP