Closed
Bug 340995
Opened 19 years ago
Closed 18 years ago
complexType without complexContent fails validation
Categories
(Core Graveyard :: XForms, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: aaronr, Assigned: sspeiche)
Details
(Keywords: fixed1.8.0.12, fixed1.8.1.4)
Attachments
(3 files)
|
3.66 KB,
application/xhtml+xml
|
Details | |
|
8.53 KB,
patch
|
doronr
:
review+
aaronr
:
review+
|
Details | Diff | Splinter Review |
|
8.43 KB,
patch
|
Details | Diff | Splinter Review |
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.
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•18 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?
(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•18 years ago
|
||
Attachment #256069 -
Flags: review?(doronr)
Comment 5•18 years ago
|
||
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+
Updated•18 years ago
|
Assignee: xforms → sspeiche
| Assignee | ||
Comment 7•18 years ago
|
||
patch for checkin
Comment 8•18 years ago
|
||
Fixed in trunk. Does this need to go into any branches?
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 9•18 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•18 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
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•