267
267
// Now, since we might have to update the namespace map for this element,
268
268
// but we don't have the element decl yet, we just tell the element stack
269
269
// to expand up to get ready.
270
unsigned int elemDepth = fElemStack.addLevel();
270
XMLSize_t elemDepth = fElemStack.addLevel();
271
271
fElemStack.setValidationFlag(fValidate);
272
272
fElemStack.setPrefixColonPos(prefixColonPos);
344
344
// We do something different here according to whether we found the
345
345
// element or not.
346
bool bXsiTypeSet= (fValidator)?((SchemaValidator*)fValidator)->getIsXsiTypeSet():false;
346
347
if (wasAdded || !elemDecl->isDeclared())
349
if (laxThisOne && !bXsiTypeSet) {
349
350
fValidate = false;
350
351
fElemStack.setValidationFlag(fValidate);
357
358
// faulted-in, was not an element in the grammar pool originally
358
359
elemDecl->setCreateReason(XMLElementDecl::JustFaultIn);
360
fValidator->emitError
362
XMLValid::ElementNotDefined, elemDecl->getFullName()
362
fValidator->emitError
364
XMLValid::ElementNotDefined, elemDecl->getFullName()
434
436
// clean up after ourselves:
435
437
// clear the map used to detect duplicate attributes
436
fUndeclaredAttrRegistryNS->removeAll();
438
fUndeclaredAttrRegistry->removeAll();
439
441
// Since the element may have default values, call start tag now regardless if it is empty or not
661
664
const XMLCh* valuePtr = curPair->getValue();
662
665
const XMLCh* suffPtr = attName.getLocalPart();
664
if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE)) {
665
fXsiType.set(valuePtr);
667
if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE))
669
// normalize the attribute according to schema whitespace facet
670
DatatypeValidator* tempDV = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_QNAME);
671
((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, valuePtr, fXsiType, true);
667
else if (XMLString::equals(suffPtr, SchemaSymbols::fgATT_NILL)
668
&& XMLString::equals(valuePtr, SchemaSymbols::fgATTVAL_TRUE)) {
669
((SchemaValidator*)fValidator)->setNillable(true);
673
else if (XMLString::equals(suffPtr, SchemaSymbols::fgATT_NILL))
675
// normalize the attribute according to schema whitespace facet
676
XMLBuffer& fXsiNil = fBufMgr.bidOnBuffer();
677
DatatypeValidator* tempDV = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_BOOLEAN);
678
((SchemaValidator*) fValidator)->normalizeWhiteSpace(tempDV, valuePtr, fXsiNil, true);
679
if(XMLString::equals(fXsiNil.getRawBuffer(), SchemaSymbols::fgATTVAL_TRUE))
680
((SchemaValidator*)fValidator)->setNillable(true);
681
else if(XMLString::equals(fXsiNil.getRawBuffer(), SchemaSymbols::fgATTVAL_FALSE))
682
((SchemaValidator*)fValidator)->setNillable(false);
684
emitError(XMLErrs::InvalidAttValue, fXsiNil.getRawBuffer(), valuePtr);
685
fBufMgr.releaseBuffer(fXsiNil);