~ubuntu-branches/ubuntu/precise/xerces-c/precise-security

« back to all changes in this revision

Viewing changes to src/xercesc/internal/ValidationContextImpl.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jay Berkenbilt
  • Date: 2010-02-06 16:46:23 UTC
  • mfrom: (2.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100206164623-xbntkcs6ks20nboa
Tags: 3.1.0-1
* New upstream release
* Updated standards version to 3.8.4.  No changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
6
 * (the "License"); you may not use this file except in compliance with
7
7
 * the License.  You may obtain a copy of the License at
8
 
 * 
 
8
 *
9
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 
 * 
 
10
 *
11
11
 * Unless required by applicable law or agreed to in writing, software
12
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
16
 */
17
17
 
18
18
/*
19
 
 * $Id: ValidationContextImpl.cpp 810580 2009-09-02 15:52:22Z amassari $
 
19
 * $Id: ValidationContextImpl.cpp 903149 2010-01-26 09:58:40Z borisk $
20
20
 */
21
21
 
22
22
 
131
131
}
132
132
 
133
133
void ValidationContextImpl::toCheckIdRefList(bool toCheck)
134
 
 
134
{
135
135
    fToCheckIdRefList = toCheck;
136
136
}
137
137
 
152
152
    return tempPool;
153
153
 
154
154
}
155
 
           
 
155
 
156
156
void ValidationContextImpl::checkEntity(const XMLCh * const content) const
157
157
{
158
158
 
169
169
        }
170
170
 
171
171
    }
172
 
    else 
 
172
    else
173
173
    {
174
174
        ThrowXMLwithMemMgr1
175
175
        (
182
182
 
183
183
}
184
184
 
185
 
/* QName 
 
185
/* QName
186
186
 */
187
 
bool ValidationContextImpl::isPrefixUnknown(XMLCh* prefix) {     
 
187
bool ValidationContextImpl::isPrefixUnknown(XMLCh* prefix) {
188
188
    bool unknown = false;
189
189
    if (XMLString::equals(prefix, XMLUni::fgXMLNSString)) {
190
 
        return true;                
191
 
    }            
 
190
        return true;
 
191
    }
192
192
    else if (!XMLString::equals(prefix, XMLUni::fgXMLString)) {
193
193
        if(fElemStack && !fElemStack->isEmpty())
194
194
            fElemStack->mapPrefixToURI(prefix, unknown);
195
195
        else if(fNamespaceScope)
196
196
            unknown = (fNamespaceScope->getNamespaceForPrefix(prefix)==fNamespaceScope->getEmptyNamespaceId());
197
 
    }                
 
197
    }
198
198
    return unknown;
199
199
}
200
200
 
201
 
const XMLCh* ValidationContextImpl::getURIForPrefix(XMLCh* prefix) { 
 
201
const XMLCh* ValidationContextImpl::getURIForPrefix(XMLCh* prefix) {
202
202
    bool unknown = false;
203
 
    unsigned int uriId;
 
203
    unsigned int uriId = 0;
204
204
    if(fElemStack)
205
205
        uriId = fElemStack->mapPrefixToURI(prefix, unknown);
206
206
    else if(fNamespaceScope)
207
 
        unknown = ((uriId = fNamespaceScope->getNamespaceForPrefix(prefix))==fNamespaceScope->getEmptyNamespaceId());
 
207
    {
 
208
      uriId = fNamespaceScope->getNamespaceForPrefix(prefix);
 
209
      unknown = uriId == fNamespaceScope->getEmptyNamespaceId();
 
210
    }
208
211
    if (!unknown)
209
212
        return fScanner->getURIText(uriId);
210
 
    
211
 
    return XMLUni::fgZeroLenString; 
 
213
 
 
214
    return XMLUni::fgZeroLenString;
212
215
}
213
216
 
214
217
XERCES_CPP_NAMESPACE_END
215