Closed Bug 340995 Opened 19 years ago Closed 18 years ago

complexType without complexContent fails validation

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: aaronr, Assigned: sspeiche)

Details

(Keywords: fixed1.8.0.12, fixed1.8.1.4)

Attachments

(3 files)

If the user has a schema containing a complexType that does not contain complexContent or sequence, etc., then we will fail document validation inside nsSchemaValidator::ValidateComplextype. The mContentType that we'll encounter will be nsISchemaComplexType::CONTENT_MODEL_EMPTY which is not implemented currently.
Attached file testcase
testcase that shows the problem. You won't see any problem visually, but if you go to the error console, you'll see that the error, "ERR: XForms Warning (3): Instance document did not validate"
I tested the associated test case with patch from bug 310962 (attachment 253149 [details] [diff] [review]) and it works. Perhaps this bug depend on 310962?
(In reply to comment #2) > I tested the associated test case with patch from bug 310962 (attachment > 253149 [details]) and it works. Perhaps this bug depend on 310962? > Looks like 310962 depends on trunk only features. But perhaps we can use the piece of it that fixes this problem? That might live only in the extension and thus be able to be checked into 1.8.
Attachment #256069 - Flags: review?(doronr)
Comment on attachment 256069 [details] [diff] [review] allows empty content for complex types looks good
Attachment #256069 - Flags: review?(doronr) → review+
Comment on attachment 256069 [details] [diff] [review] allows empty content for complex types >Index: schema-validation/src/nsSchemaValidator.cpp >=================================================================== > nsresult >+nsSchemaValidator::ValidateComplexModelEmpty(nsIDOMNode* aNode, >+ nsISchemaComplexType *aSchemaComplexType, >+ PRBool *aResult) >+{ >+ PRBool isValid = PR_TRUE; >+ nsresult rv = NS_OK; >+ >+ nsCOMPtr<nsIDOMNode> currentNode; >+ aNode->GetFirstChild(getter_AddRefs(currentNode)); >+ NS_ENSURE_SUCCESS(rv, rv); nit: why do you need rv? You never use it. Just return NS_OK at the end. >Index: schema-validation/src/nsSchemaValidator.h >=================================================================== >RCS file: /cvsroot/mozilla/extensions/schema-validation/src/nsSchemaValidator.h,v >retrieving revision 1.10 >diff -u -8 -p -r1.10 nsSchemaValidator.h >--- schema-validation/src/nsSchemaValidator.h 15 May 2006 21:34:38 -0000 1.10 >+++ schema-validation/src/nsSchemaValidator.h 22 Feb 2007 20:58:17 -0000 >@@ -298,16 +298,20 @@ private: > nsresult ValidateComplextype(nsIDOMNode *aNode, > nsISchemaComplexType *aSchemaComplexType, > PRBool *aResult); > > nsresult ValidateComplexModelElement(nsIDOMNode *aNode, > nsISchemaComplexType *aSchemaComplexType, > PRBool *aResult); > >+ nsresult ValidateComplexModelEmpty(nsIDOMNode *aNode, >+ nsISchemaComplexType *aSchemaComplexType, >+ PRBool *aResult); >+ nit: line up param types...looks like that is what the surrounding ones do. with those, r=me
Attachment #256069 - Flags: review?(aaronr)
Attachment #256069 - Flags: review?(aaronr) → review+
Assignee: xforms → sspeiche
patch for checkin
Fixed in trunk. Does this need to go into any branches?
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
I'll just tag it xf-to-branch and can go with rest of XForms 0.8 items. Thanks for the ci
Whiteboard: xf-to-branch
checked into 1.8 branch on 2007-04-12 checked into 1.8.0 branch on 2007-04-16
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: