About Schem2XForms (java)

View: New views
2 Messages — Rating Filter:   Alert me  

About Schem2XForms (java)

by Christian Gagneraud-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Following ticket #411
(https://www.chibaxforms.org/cgi-bin/trac.cgi/ticket/411), i've
installed the zip and re-build everything (painfully but)
successfully, and i'm able to use it.
I have some questions, some remarks (feature request) and some
problems (bug reports)

1. Stupid question (I'm not familiar with java)
How can i run the Schema2XForms apps from the command line?
For now I'm using eclipse to run it, but i had to do some ugly
tweaking into the project's property to get it built and running, and
it's painful to do it this way, especially when you only want to
generate code from your schemas...
So I guess there is a magic invocation with java -jar, but i didn't
find it, i got errors about manifest, main class, ...

2. Feature request (or bug report?)
My schemas are split on several files, each one defining it's own
namespace. I have a top-level schemas where i want to allows any
elements fron the others namespace, this is roughly what i did:

<xsd:schema
   xmlns:xsd="..."
   targetNamespace="http://me.home/top-level"
   xmlns="http://me.home/top-level">
<xsd:import
   namesapce="http://me.home/namespace1"
   schemaLocation="/home/me/.../namespace1.xsd">
<xsd:import ... namespace2.../>
<xsd:import ... namespace3.../>

<xsd:element name="main">
  <xsd:complexType>
   <xsd:sequuence>
    <xsd:element name="test1" type="xs:string" maxOccurs="unbounded"/>
    <xsd:any namespace="http://me.home/namespace1"/>
    <xsd:any namespace="http://me.home/namespace2"/>
...
</xsd:schema>


But Schema2XForms seems to ignore the xsd:import and the xsd:any, i'm
expected to see my elements from my namespace1 and 2 (they are present
in the instance document) after "test1", but i can see only test1 and
the associated buttons.
Does Schema2XForms support xsd:import and the xsd:any? If yes, does my
example shows that's it's not working, or perhaps did i miss something
about schema, especially i have some doubts about the ability of the
tool to associate the namespace used in the xsd:any with the correct
XMLSchema definition (that's the reason of the import), but xmllint
manage to do it (i validate all my xsd and my schema instance before
giving a try with Schema2Xforms)

3. Bug report.
A real one, i think.
If i declare targetNamespace="http://me.home/#top-level" with a
xmlns:top-level="ttp://me.home/#top-level" (note the sharp), then
Schema2XForms complain about a malformed schemas because i use
<top-level:something/> and not <#top-level:something>, which is really
weird... Using targetNamespace="http://me.home/top-level" and
xmlns:top-level="ttp://me.home/top-level" solve the problem...

4. Minor Bug report.
This happens both in the demo and in the xhtml generated by
Schema2XFroms. When using repeat, there are generally 2 buttons
"insert after selected" and "delete selected", if you delete all the
repeated element, then you are stuck with an empty list, "insert after
selected" doesn't work anymore, because there no more elements, so
none are selected (check demo/repeats.xhtml). It could be nice if the
default behavior is to have always a "append" button, which work even
if the list is empty (like in actions.xhtnl with "Repeat - insert,
delete, ...").


With best regards,
Christian

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Chiba-users mailing list
Chiba-users@...
https://lists.sourceforge.net/lists/listinfo/chiba-users

Re: About Schem2XForms (java)

by Christian Gagneraud-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2008-08-05 at 16:33 +0100, Christian Gagneraud wrote:

> Hi all,
>
> Following ticket #411
> (https://www.chibaxforms.org/cgi-bin/trac.cgi/ticket/411), i've
> installed the zip and re-build everything (painfully but)
> successfully, and i'm able to use it.
> I have some questions, some remarks (feature request) and some
> problems (bug reports)
>
> 1. Stupid question (I'm not familiar with java)
> How can i run the Schema2XForms apps from the command line?
> For now I'm using eclipse to run it, but i had to do some ugly
> tweaking into the project's property to get it built and running, and
> it's painful to do it this way, especially when you only want to
> generate code from your schemas...
> So I guess there is a magic invocation with java -jar, but i didn't
> find it, i got errors about manifest, main class, ...
>
> 2. Feature request (or bug report?)
> My schemas are split on several files, each one defining it's own
> namespace. I have a top-level schemas where i want to allows any
> elements fron the others namespace, this is roughly what i did:
>
> <xsd:schema
>    xmlns:xsd="..."
>    targetNamespace="http://me.home/top-level"
>    xmlns="http://me.home/top-level">
> <xsd:import
>    namesapce="http://me.home/namespace1"
>    schemaLocation="/home/me/.../namespace1.xsd">
> <xsd:import ... namespace2.../>
> <xsd:import ... namespace3.../>
>
> <xsd:element name="main">
>   <xsd:complexType>
>    <xsd:sequuence>
>     <xsd:element name="test1" type="xs:string" maxOccurs="unbounded"/>
>     <xsd:any namespace="http://me.home/namespace1"/>
>     <xsd:any namespace="http://me.home/namespace2"/>
> ...
> </xsd:schema>
>
>
> But Schema2XForms seems to ignore the xsd:import and the xsd:any, i'm
> expected to see my elements from my namespace1 and 2 (they are present
> in the instance document) after "test1", but i can see only test1 and
> the associated buttons.
> Does Schema2XForms support xsd:import and the xsd:any? If yes, does my
> example shows that's it's not working, or perhaps did i miss something
> about schema, especially i have some doubts about the ability of the
> tool to associate the namespace used in the xsd:any with the correct
> XMLSchema definition (that's the reason of the import), but xmllint
> manage to do it (i validate all my xsd and my schema instance before
> giving a try with Schema2Xforms)

Ok, i went into the source and yes the XSWildcard is not yet
supported... :(
Unfortunately, i have not the skills to contribute here, but i will try
to go further just in case...


>
> 3. Bug report.
> A real one, i think.
> If i declare targetNamespace="http://me.home/#top-level" with a
> xmlns:top-level="ttp://me.home/#top-level" (note the sharp), then
> Schema2XForms complain about a malformed schemas because i use
> <top-level:something/> and not <#top-level:something>, which is really
> weird... Using targetNamespace="http://me.home/top-level" and
> xmlns:top-level="ttp://me.home/top-level" solve the problem...

Clearly, the code in AbstractSchemaFormBuilber::getElementName try to
invent a prefix in case of non-prefix namespace for this element, and it
takes it from the URI: from the last / to the end of the string, thus my
problem with the '#'.


Hum, i should definitely try to build the documentation and get the
logger working, i would have save time...
Anyone knows how to run this stuff from the command line, and get the
log on stdout at the same time?

Chris.

>
> 4. Minor Bug report.
> This happens both in the demo and in the xhtml generated by
> Schema2XFroms. When using repeat, there are generally 2 buttons
> "insert after selected" and "delete selected", if you delete all the
> repeated element, then you are stuck with an empty list, "insert after
> selected" doesn't work anymore, because there no more elements, so
> none are selected (check demo/repeats.xhtml). It could be nice if the
> default behavior is to have always a "append" button, which work even
> if the list is empty (like in actions.xhtnl with "Repeat - insert,
> delete, ...").
>
>
> With best regards,
> Christian
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Chiba-users mailing list
> Chiba-users@...
> https://lists.sourceforge.net/lists/listinfo/chiba-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Chiba-users mailing list
Chiba-users@...
https://lists.sourceforge.net/lists/listinfo/chiba-users
LightInTheBox - Buy quality products at wholesale price!