diff --git a/src/xercesc/internal/IGXMLScanner.cpp b/src/xercesc/internal/IGXMLScanner.cpp index c659f40985c79b1087f0e1c8ea36fd69a9ef39a5..a94f71538303e8fad500c2cda4b2cf47b80786c4 100644 --- a/src/xercesc/internal/IGXMLScanner.cpp +++ b/src/xercesc/internal/IGXMLScanner.cpp @@ -1956,6 +1956,8 @@ bool IGXMLScanner::scanStartTagNS(bool& gotData) ContentLeafNameTypeVector* cv = 0; XMLContentModel* cm = 0; int currentScope = Grammar::TOP_LEVEL_SCOPE; + bool laxThisOne = false; + if (!isRoot && fGrammarType == Grammar::SchemaGrammarType) { SchemaElementDecl* tempElement = (SchemaElementDecl*) fElemStack.topElement()->fThisElement; SchemaElementDecl::ModelTypes modelType = tempElement->getModelType(); @@ -1968,6 +1970,9 @@ bool IGXMLScanner::scanStartTagNS(bool& gotData) cv = cm->getContentLeafNameTypeVector(); currentScope = fElemStack.getCurrentScope(); } + else if (modelType == SchemaElementDecl::Any) { + laxThisOne = true; + } } // Now, since we might have to update the namespace map for this element, @@ -2042,7 +2047,6 @@ bool IGXMLScanner::scanStartTagNS(bool& gotData) //if schema, check if we should lax or skip the validation of this element bool parentValidation = fValidate; - bool laxThisOne = false; if (cv) { QName element(fPrefixBuf.getRawBuffer(), &qnameRawBuf[prefixColonPos + 1], uriId); // elementDepth will be > 0, as cv is only constructed if element is not diff --git a/src/xercesc/internal/SGXMLScanner.cpp b/src/xercesc/internal/SGXMLScanner.cpp index 417cb4e21a9a48303b2180e39f0339d1cb8950f4..67db8590f2ad2116a24227de2bce609c92431a69 100644 --- a/src/xercesc/internal/SGXMLScanner.cpp +++ b/src/xercesc/internal/SGXMLScanner.cpp @@ -1110,6 +1110,7 @@ bool SGXMLScanner::scanStartTag(bool& gotData) ContentLeafNameTypeVector* cv = 0; XMLContentModel* cm = 0; int currentScope = Grammar::TOP_LEVEL_SCOPE; + bool laxThisOne = false; if (!isRoot) { SchemaElementDecl* tempElement = (SchemaElementDecl*) fElemStack.topElement()->fThisElement; @@ -1123,6 +1124,9 @@ bool SGXMLScanner::scanStartTag(bool& gotData) cv = cm->getContentLeafNameTypeVector(); currentScope = fElemStack.getCurrentScope(); } + else if (modelType == SchemaElementDecl::Any) { + laxThisOne = true; + } } // Now, since we might have to update the namespace map for this element, @@ -1162,7 +1166,6 @@ bool SGXMLScanner::scanStartTag(bool& gotData) //if schema, check if we should lax or skip the validation of this element bool parentValidation = fValidate; - bool laxThisOne = false; if (cv) { QName element(fPrefixBuf.getRawBuffer(), &qnameRawBuf[prefixColonPos + 1], uriId); // elementDepth will be > 0, as cv is only constructed if element is not @@ -1851,7 +1854,7 @@ void SGXMLScanner::resizeElemState() { fElemStateSize = newSize; } -// This method is called from scanStartTagNS() to build up the list of +// This method is called from scanStartTag() to build up the list of // XMLAttr objects that will be passed out in the start tag callout. We // get the key/value pairs from the raw scan of explicitly provided attrs, // which have not been normalized. And we get the element declaration from diff --git a/src/xercesc/validators/schema/TraverseSchema.cpp b/src/xercesc/validators/schema/TraverseSchema.cpp index fb4f4b9c00b9eb067cdefcf4491507491c2525d2..6c67aaa3c3466765a61f44644801b699ce0664b6 100644 --- a/src/xercesc/validators/schema/TraverseSchema.cpp +++ b/src/xercesc/validators/schema/TraverseSchema.cpp @@ -2599,7 +2599,7 @@ QName* TraverseSchema::traverseElementDecl(const DOMElement* const elem, elemDecl->setAttWildCard(new SchemaAttDef(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, fEmptyNamespaceURI, XMLAttDef::Any_Any, - XMLAttDef::ProcessContents_Strict)); + XMLAttDef::ProcessContents_Lax)); } // key/keyref/unique processing @@ -5656,7 +5656,7 @@ void TraverseSchema::processComplexContent(const DOMElement* const ctElem, fEmptyNamespaceURI), false); - anySpecNode->setType(ContentSpecNode::Any); + anySpecNode->setType(ContentSpecNode::Any_Lax); anySpecNode->setMinOccurs(0); anySpecNode->setMaxOccurs(SchemaSymbols::UNBOUNDED); @@ -5995,7 +5995,7 @@ void TraverseSchema::processAttributes(const DOMElement* const elem, baseAttWildCard = new SchemaAttDef(XMLUni::fgZeroLenString, XMLUni::fgZeroLenString, fEmptyNamespaceURI, XMLAttDef::Any_Any, - XMLAttDef::ProcessContents_Strict); + XMLAttDef::ProcessContents_Lax); janBaseAttWildCard.reset(baseAttWildCard); }