logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: schemabuilder with Xerces: msg#00016

Subject: Re: schemabuilder with Xerces
> we should test-case these so we can change later. not sure, if the 
> XForms group won't change its mind about this. the XForms 1.1 
> requirements paper mentions the use of binds to reference other binds. 
> wouldn't be of much sense maybe if you couldn't attach multiple 
> model-item-props of the same type (at least for constraint) to one 
nodeset.
OK. For the test, the "basicTest" seems to test this correctly. So for now 
we can use the simplified version, without extensions. 
Implementing this with only one bind for each node seems a little 
problematic, because we'll have to remove unwanted elements in the 
instance if the user changes his mind about which element he wants to use. 
We'll have to see...

> did you notice the namespace problem in the old schema2xforms version?
> e.g. the root node was creatd with createElement and no namespace. then 
> an attribute for the namespace declaration was added. - this will not 
> work. you've to create with createElementNS. the xerces API says that 
> you should never mix DOM1 and DOM2 methods. so we have to always use the 

> *NS-method to create elements, attrs. for no or empty namespace you just 

> pass "" or null as argument.
No, In fact I hadn't, thanks for having pointed this out !
Well, I've corrected the "createElement" tags to use "createElementNS", 
but strangely the problem is still here...I'll have another look at it 
later on, but since the saved documents are correct, I think it's not the 
most urgent. 

> > thank you for this great work.
Well, I hope we won't have too much problem with this library... There is 
one other place in the AbstractSchemaFormBuilder class that is a little 
dirty, it is a "getDataTypeName" method that I had to write because 
built-in datatypes in Xerces are only modelled as "short" values in the 
XSConstants class, so I didn't find any way to lookup their name 
programmatically and had to write this method manually. I hope it can be 
removed in another version of the lib, or if someone sees a better way to 
do this.

> > please just checkin your code. i've created a tag named 
'T-0-9-4-castor' 
> > which allows us to revert to the current castor version. maybe in the 
> > meantime someone likes to look after the new code.

OK, it's done. 
 
> wish you a very nice holiday.
Thanks !

Sophie




joern turner <joern.turner-S0/GAf8tV78@xxxxxxxxxxxxxxxx> 
Sent by: chiba-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
04/03/2004 15:18

To
sophie.ramel-bqDqoxiz9wg@xxxxxxxxxxxxxxxx
cc
Chiba <chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx>, 
chiba-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
Subject
Re: [Chiba-developer] schemabuilder with Xerces






sophie.ramel-bqDqoxiz9wg@xxxxxxxxxxxxxxxx wrote:

> Hi, 
> 
> 
>>>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.
>>
>>you're talking about datatype extensions, right?
> 
> Yes, the extensions on complex types. The ones on simple types seem to 
> work correctly. 
> 
> 
>>right, we changed this according to the spec which says:
>>4.2.1 The xforms-model-construct Event (under 4.c.):
>>"If the node already contains a model item property of the same name, 
>>XForms processing for this containing document halts with an exception"
>>we interpret this as follows:
>>each instance data item may have model item properties such as readonly, 

> 
> 
>>required etc. for every single instance data item there's only one model 

> 
> 
>>item property of a specific type allowed (only one required property, 
>>only one readonly property,...).
> 
> 
> OK, no problem, we'll just have to see how to implement extensions to 
take 
> this into account. 
we should test-case these so we can change later. not sure, if the 
XForms group won't change its mind about this. the XForms 1.1 
requirements paper mentions the use of binds to reference other binds. 
wouldn't be of much sense maybe if you couldn't attach multiple 
model-item-props of the same type (at least for constraint) to one 
nodeset.

> 
> 
>>>- 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 ?)
>>
>>which switch do you mean here?
> 
> When complex types "b" and "c" extended a complex type "a", for example, 

> you had the choice to supply the element of type "a" between: 
> - giving the values only in a
> - giving the values in a + the values in b
> - giving the values in a + the values in c
> This was done with a select1, to select between the types a, b and c, 
> which changed a switch containing the controls. These controls referred 
to 
> different binds pointing on the same nodes. 
> 
> 
>>thank you for this great work.
>>please just checkin your code. i've created a tag named 'T-0-9-4-castor' 

> 
> 
>>which allows us to revert to the current castor version. maybe in the 
>>meantime someone likes to look after the new code.
> 
> OK, I'll commit it, but I wanted to do this yesterday and I noticed a 
> problem in a repeat, which wasn't shown by the "purchaseOrder-repeats" 
> test. I'll just have to debug this before committing...
did you notice the namespace problem in the old schema2xforms version?

the tests broke not because of an error in DOMComparator but due to 
namespace problems that not necessarily show up in the external 
representation of the DOM.

e.g. the root node was creatd with createElement and no namespace. then 
an attribute for the namespace declaration was added. - this will not 
work. you've to create with createElementNS. the xerces API says that 
you should never mix DOM1 and DOM2 methods. so we have to always use the 
*NS-method to create elements, attrs. for no or empty namespace you just 
pass "" or null as argument.

don't know how much you've refactored the code and if this issue is 
still relevant. - just remembered that behaviour when i last looked at 
the code and the test-cases. maybe you've noted that i did a fake to 
make the tests running because of this problem.


Joern

> 
> Sophie
> 
> 
> 
> 
> joern turner <joern.turner-S0/GAf8tV78@xxxxxxxxxxxxxxxx> 
> Sent by: 
> chiba-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
> 02/03/2004 23:08
> 
> To
> sophie.ramel-bqDqoxiz9wg@xxxxxxxxxxxxxxxx
> cc
> Chiba <chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx>
> Subject
> Re: [Chiba-developer] schemabuilder with Xerces
> 
> 
> 
> 
> 
> 
> hello Sophie,
> 
> sophie.ramel-bqDqoxiz9wg@xxxxxxxxxxxxxxxx wrote:
> 
> 
>>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 !), ...
> 
> sorry for that. it looked quite good at first sight but sure it's 
> another thing to really work with a lib.
> 
> seems that the API is not as stable as the release notes implies and 
> they're still refactoring things. so, we'll have to live with these 
> changes for a while.
> 
> 
>>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.
> 
> you're talking about datatype extensions, right?
> 
> 
>>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")
> 
> right, we changed this according to the spec which says:
> 
> 4.2.1 The xforms-model-construct Event (under 4.c.):
> "If the node already contains a model item property of the same name, 
> XForms processing for this containing document halts with an exception"
> 
> we interpret this as follows:
> each instance data item may have model item properties such as readonly, 

> required etc. for every single instance data item there's only one model 

> item property of a specific type allowed (only one required property, 
> only one readonly property,...).
> 
> 
>>- 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 ?)
> 
> which switch do you mean here?
> 
> 
>>- 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...). 
> 
> thank you for this great work.
> 
> please just checkin your code. i've created a tag named 'T-0-9-4-castor' 

> which allows us to revert to the current castor version. maybe in the 
> meantime someone likes to look after the new code.
> 
> wish you a very nice holiday.
> 
> best,
> 
> Joern
> 
> 
> 
> 
>>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
>>_______________________________________________
>>Chiba-developer mailing list
>>Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
>>https://lists.sourceforge.net/lists/listinfo/chiba-developer
>>
> 
> 
> 
> 
> -------------------------------------------------------
> 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
> _______________________________________________
> Chiba-developer mailing list
> Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
> https://lists.sourceforge.net/lists/listinfo/chiba-developer
> 
> 
> 
> 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Chiba-developer mailing list
Chiba-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/chiba-developer





-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click


<Prev in Thread] Current Thread [Next in Thread>