DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5675>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5675 use of setExternalSchemaLocation() yields inconsistent behavior [EMAIL PROTECTED] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Additional Comments From [EMAIL PROTECTED] 2002-01-03 10:40 ------- Fix is in CVS. FYI here is the diff: Index: TraverseSchema.cpp =================================================================== @@ -4741,9 +4741,6 @@ SchemaInfo* impInfo = fSchemaInfo->getImportInfo(fURIStringPool->addOrFind(typeURI)); if (!impInfo) { - - reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::UnresolvedPrefix, prefix); - noErrorDetected = false; return 0; } @@ -5060,36 +5057,53 @@ // check for different namespace SchemaInfo* saveInfo = fSchemaInfo; SchemaInfo::ListType infoType = SchemaInfo::INCLUDE; + SchemaAttDef* refAttDef = 0; if (XMLString::compareString(uriStr, fTargetNSURIString) != 0) { - SchemaInfo* impInfo = fSchemaInfo->getImportInfo(attURI); + Grammar* grammar = fGrammarResolver->getGrammar(uriStr); - if (!impInfo) { + if (grammar == 0 || grammar->getGrammarType() != Grammar::SchemaGrammarType) { - reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::TopLevelAttributeNotFound, refName); + reportSchemaError(XMLUni::fgValidityDomain, XMLValid::GrammarNotFound, uriStr); return; } - infoType = SchemaInfo::IMPORT; - fSchemaInfo->setCurrentScope(fCurrentScope); - fSchemaInfo->setScopeCount(fScopeCount); - restoreSchemaInfo(impInfo, infoType); + refAttDef = (SchemaAttDef*) ((SchemaGrammar*) grammar)->getAttributeDeclRegistry()->get(localPart); + + if (!refAttDef) { + + SchemaInfo* impInfo = fSchemaInfo->getImportInfo(attURI); + + if (!impInfo) { + + reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::TopLevelAttributeNotFound, refName); + return; + } + + infoType = SchemaInfo::IMPORT; + fSchemaInfo->setCurrentScope(fCurrentScope); + fSchemaInfo->setScopeCount(fScopeCount); + restoreSchemaInfo(impInfo, infoType); + } } // if Global attribute registry does not contain the ref attribute, get // the referred attribute declaration and traverse it. - if (fAttributeDeclRegistry->containsKey(localPart) == false) { + if (!refAttDef) { + + if (fAttributeDeclRegistry->containsKey(localPart) == false) { - DOM_Element referredAttribute = - fSchemaInfo->getTopLevelComponent(SchemaSymbols::fgELT_ATTRIBUTE, localPart, &fSchemaInfo); + DOM_Element referredAttribute = + fSchemaInfo->getTopLevelComponent(SchemaSymbols::fgELT_ATTRIBUTE, localPart, &fSchemaInfo); - if (referredAttribute != 0) { - traverseAttributeDecl(referredAttribute, 0); + if (referredAttribute != 0) { + traverseAttributeDecl(referredAttribute, 0); + } } - } - SchemaAttDef* refAttDef = (SchemaAttDef*) fAttributeDeclRegistry->get(localPart); + refAttDef = (SchemaAttDef*) fAttributeDeclRegistry->get(localPart); + } // restore schema information, if necessary if (fSchemaInfo != saveInfo) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
