Closed Bug 286630 Opened 20 years ago Closed 20 years ago

nsSchemaLoader doesn't bail on invalid elements as direct children of xs:schema

Categories

(Core Graveyard :: Web Services, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: doronr, Assigned: doronr)

Details

Attachments

(2 files)

Attached patch 1.0Splinter Review
Attachment #177766 - Flags: superreview?(peterv)
Comment on attachment 177766 [details] [diff] [review] 1.0 >Index: extensions/webservices/schema/src/nsSchemaLoader.cpp >=================================================================== >+ } else if ((tagName != nsSchemaAtoms::sAnnotation_atom) && >+ (tagName != nsSchemaAtoms::sInclude_atom) && >+ (tagName != nsSchemaAtoms::sImport_atom) && >+ (tagName != nsSchemaAtoms::sRedefine_atom) && >+ (tagName != nsSchemaAtoms::sNotation_atom) && >+ (tagName != nsSchemaAtoms::sAnnotation_atom) && >+ (tagName != nsSchemaAtoms::sUnique_atom) && >+ (tagName != nsSchemaAtoms::sKey_atom) && >+ (tagName != nsSchemaAtoms::sKeyref_atom) && >+ (tagName != nsSchemaAtoms::sSelector_atom) && >+ (tagName != nsSchemaAtoms::sField_atom)) { You have sAnnotation__atom twice. I don't think the identity-constraint elements should be in this if, the comment probably indicates that they're ignored in ProcessElement etc. but they're not valid children of the schema element. And drop the inner braces, they're not needed. > if (NS_FAILED(rv)) { > nsAutoString elementName; > nsresult rc = aElement->GetTagName(elementName); > NS_ENSURE_SUCCESS(rc, rc); > > nsAutoString errorMsg; > errorMsg.AppendLiteral("Failure processing schema, unexpected element \""); > errorMsg.Append(elementName); > errorMsg.AppendLiteral("\" in <schema .../>"); Bah, this error message is shown for all errors, even those unrelated to unexpected elements.
Attachment #177766 - Flags: superreview?(peterv) → superreview-
Attached patch v 2Splinter Review
fixed it and moved error firing to the else case.
Attachment #177880 - Flags: superreview?(peterv)
Comment on attachment 177880 [details] [diff] [review] v 2 >Index: extensions/webservices/schema/src/nsSchemaAtomList.h >=================================================================== > SCHEMA_ATOM(sPattern_atom, "pattern") >+ No need to add this newline. >Index: extensions/webservices/schema/src/nsSchemaLoader.cpp >=================================================================== >+ } else if (tagName != nsSchemaAtoms::sAnnotation_atom && } else if {
Attachment #177880 - Flags: superreview?(peterv)
Attachment #177880 - Flags: superreview+
Attachment #177880 - Flags: review+
checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: