Schema Validation does not handle inheritance of simple types

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
12 years ago
10 months ago

People

(Reporter: Doron Rosenberg (IBM), Assigned: Doron Rosenberg (IBM))

Tracking

({fixed1.8.0.2, fixed1.8.1})

Trunk
x86
All
fixed1.8.0.2, fixed1.8.1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

12 years ago
Currently, the code assumes that schema simpletypes inherit from builtin types.
 So xsd:restriction and unions/lists can only inherit from builtin types right now.

So for example, type Foo may restrict type Bar (say with an enumeration), which
itself restricts xsd:string.  So to validate against Foo,  we need to walk the
inheritance tree until we find something that isn't a restriction (builtin or
union/list).  As we walk, we store the restriction facets, making sure that once
we find a facet, we don't overwrite it with the same facet defined on an
inherited type.

Solution:

I added a nsSchemaDerivedSimpleType struct, which contains all possible facets
and a baseType member.  nsSchemaDerivedSimpleType gets passed around when needed
and added to.
(Assignee)

Comment 1

12 years ago
Created attachment 193180 [details] [diff] [review]
patch
Attachment #193180 - Flags: superreview?(peterv)
(Assignee)

Comment 2

12 years ago
peterv: could you take a look at this anytime soon?  We'd like this in 1.8,
since complex types won't make it I assume (too big of a patch).

I've verified it passes my testsuite and all, so no regressions.
(Assignee)

Comment 3

11 years ago
Comment on attachment 193180 [details] [diff] [review]
patch

going to check this in without review for time reason.
Attachment #193180 - Flags: superreview?(peterv)
(Assignee)

Comment 4

11 years ago
checked into trunk
Status: NEW → ASSIGNED
Whiteboard: xf-to-branch
(Assignee)

Comment 5

11 years ago
Created attachment 209905 [details] [diff] [review]
patch that doesn't break :)
(Assignee)

Comment 6

11 years ago
new patch checked in.
(Assignee)

Comment 7

11 years ago
checked into 1.8.1
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
(Assignee)

Comment 8

11 years ago
reopening since we need this on 1.8.0.x
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 9

11 years ago
fixed on 1.8.0.2
Status: REOPENED → RESOLVED
Last Resolved: 11 years ago11 years ago
Keywords: fixed1.8.0.2
Resolution: --- → FIXED

Updated

11 years ago
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.