Closed Bug 526376 Opened 15 years ago Closed 15 years ago

schema-validation: validate complex types with simpleContent

Categories

(Core Graveyard :: XForms, defect)

1.9.1 Branch
x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: imphil, Assigned: imphil)

Details

Attachments

(2 files)

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?
Attached file testcase
Attached patch patchSplinter Review
Attachment #410098 - Flags: review?(aaronr)
Comment on attachment 410098 [details] [diff] [review]
patch

Looks ok to me.  Doron should probably review, too, though.
Attachment #410098 - Flags: review?(aaronr) → review+
Attachment #410098 - Flags: review?(doronr)
Attachment #410098 - Flags: review?(doronr) → review+
alex, could you check this into hg?
sure, landed - http://hg.mozilla.org/schema-validation/rev/710191b42011
Assignee: nobody → mail
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Does this need to go into cvs trunk, too?
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.

Attachment

General

Created:
Updated:
Size: