The default bug view has changed. See this FAQ.

complexType without complexContent fails validation

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
11 years ago
9 months ago

People

(Reporter: aaronr, Assigned: Steve Speicher)

Tracking

({fixed1.8.0.12, fixed1.8.1.4})

Trunk
x86
All
fixed1.8.0.12, fixed1.8.1.4

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

11 years ago
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.
(Reporter)

Comment 1

11 years ago
Created attachment 225054 [details]
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"
(Assignee)

Comment 2

10 years ago
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?
(Reporter)

Comment 3

10 years ago
(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.
(Assignee)

Comment 4

10 years ago
Created attachment 256069 [details] [diff] [review]
allows empty content for complex types
Attachment #256069 - Flags: review?(doronr)

Comment 5

10 years ago
Comment on attachment 256069 [details] [diff] [review]
allows empty content for complex types

looks good
Attachment #256069 - Flags: review?(doronr) → review+
(Reporter)

Comment 6

10 years ago
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)
(Reporter)

Updated

10 years ago
Attachment #256069 - Flags: review?(aaronr) → review+

Updated

10 years ago
Assignee: xforms → sspeiche
(Assignee)

Comment 7

10 years ago
Created attachment 257507 [details] [diff] [review]
patch with nits fixed, ready for checkin

patch for checkin

Comment 8

10 years ago
Fixed in trunk.  Does this need to go into any branches?
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
(Assignee)

Comment 9

10 years ago
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
(Reporter)

Comment 10

10 years ago
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16
Keywords: fixed1.8.0.12, fixed1.8.1.4
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.