schema-validation: validate complex types with simpleContent

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
8 years ago
a year ago

People

(Reporter: imphil, Assigned: imphil)

Tracking

1.9.1 Branch
x86
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

1.51 KB, application/x-bzip2
Details
1.53 KB, patch
aaronr
: review+
Doron Rosenberg (IBM)
: review+
Details | Diff | Splinter Review
(Assignee)

Description

8 years ago
Binding to a node with such a schema will currently result in no schema validation:

<xsd:element name="Testelement">
  <xsd:complexType>
    <xsd:simpleContent>
      <xsd:extension base="xsd:integer">
        <xsd:attribute name="checked" type="xsd:boolean"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>
</xsd:element>

The attached patch fixes that (and only that) case, where we only extend the element with attributes, and don't restrict the node content itself. 

The latter problem would require probably major changes in the way schema-validation passes type information to xforms. Currently this is done by attaching the schema type to the instance node. This is probably not possible with complex types (bug 349810 is about that)?

I know the patch doesn't solve the problem entirely, but at least it makes the current code work a bit better without completely rethinking the interaction between xforms and schema-validation. And it solves my problem for now ;-)
Doron, Aaron, et al.: any ideas on how to accomplish this?
(Assignee)

Comment 1

8 years ago
Created attachment 410097 [details]
testcase
(Assignee)

Comment 2

8 years ago
Created attachment 410098 [details] [diff] [review]
patch
(Assignee)

Updated

8 years ago
Attachment #410098 - Flags: review?(aaronr)

Comment 3

8 years ago
Comment on attachment 410098 [details] [diff] [review]
patch

Looks ok to me.  Doron should probably review, too, though.
Attachment #410098 - Flags: review?(aaronr) → review+
(Assignee)

Updated

8 years ago
Attachment #410098 - Flags: review?(doronr)

Updated

8 years ago
Attachment #410098 - Flags: review?(doronr) → review+
(Assignee)

Comment 4

8 years ago
alex, could you check this into hg?

Comment 5

8 years ago
sure, landed - http://hg.mozilla.org/schema-validation/rev/710191b42011
Assignee: nobody → mail
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Comment 6

8 years ago
Does this need to go into cvs trunk, too?
(Assignee)

Comment 7

8 years ago
I didn't test it on 1.9.0, but it shouldn't cause any problems. It seems Mozilla wants continue to support Firefox 3.0 for at least some more months, so yes, get it on cvs trunk.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.