Hi,
I've finally finished to adapt the schemabuilder tool to the Xerces schema
API: it took longer than I had thought... writing the code was OK, but
debugging it was another matter !
I must say I'm not 100% happy with the Xerces API: there are some strange
behaviour for some methods, some processing that is not made in the
library and that has to be made directly in the code (for example to get
the occurance of an element, if it is only defined on the complex type
particle and not on the element declaration), some string parameters whose
order changed in methods between 2.6.0 and 2.6.1 (see
XSModel.getElementDeclaration and XSModel.getTypeDefinition : name and
namespace parameters are switched between versions !), ...
In any case, the code works now, but there is still a problem: the
inheritance ("extension" for complexTypes) does not work correctly,
because Xerces behaves differently than Castor about compatible types (it
includes base types in the model group). This may require a little more
time to solve, and in particular because it didn't work before neither: I
think the behavior of extensions should be refactored a little.
For basicTest.xsd, which contains extensions, even if the test case was
corresponding to the expected xforms, this xforms didn't work in chiba,
for different reasons:
- when there is an extension, the bind element used in different
possibilities in the introduced switch were repeated (we got different
binds for the same elements). This may have worked in a previous version
of chiba, but in this version it doesn't work (we get an error: "property
'type' already present at model item")
- there was also a problem with the switch introduced for an extension,
which didn't work (I don't know why: perhaps an event was missing ?)
- to find which extension was chosen, an attribute "xsi_type" was used,
but because it's created, it was never in the instance document, so we get
an error like this: "No value for xpath: /test/a/@xsi_type".
So I made another test case, "basicTest-noInheritence", based on basicTest
but without extensions, to test that all other functionnalities work.
So I finally come to my question: do you thing I should commit my work
now, or wait before inheritance works correctly before commiting? (because
I'm not sure I'll have time to work on inheritance right now, and I'm on
holiday next week...).
Thanks,
Sophie
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
|