> > All these things seem to point toward the constraint we discussed for
> > ID/IDREF...
>
> If we consider type-assignment for data binding tools, everything becomes
> more difficult. I have a feeling that we have to drop or weaken my second goal
> "Type-assignment should be useful for data binding tools". I will soon
> write my understanding of data binding for relaxer. Since you have done
> more work than me about type assignment for data binding, your opinion
> is very welcome.
It seems to me that there are many different levels of type-assignment.
The first, easier level would be just determine declarations for
elements, attributes, and possibly for texts. This can be done easily
and useful for things like schema-guided editor or XQuery.
For it to be useful for data-binding tools, I think what we need is
"start-end detection" (for lack of better word) where the receiver would
like to know when a new primitive starts and when it ends.
With the following grammar,
<element name="foo" id="p1">
<oneOrMore id="p2">
<element name="bar" id="p3"><empty id="p4"/></element>
</oneOrMore>
</element>
and the following instance:
<foo><bar/><bar/></foo>
Such a type assignment produces:
start(p1) start(p2)
start(p3) start(p4) end(p4) end(p3)
start(p3) start(p4) end(p4) end(p3)
end(p2) end(p1)
This is pretty much what RelaxNGCC does internally (so as JAXB RI), and
I believe the algorithm is the same for Relaxer as well.
regards,
--
Kohsuke KAWAGUCHI
Sun Microsystems