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.
Created attachment 193180 [details] [diff] [review] patch
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.
Comment on attachment 193180 [details] [diff] [review] patch going to check this in without review for time reason.
checked into trunk
new patch checked in.
checked into 1.8.1
reopening since we need this on 1.8.0.x
fixed on 188.8.131.52