xsd2crud generates complete CRUD Applications derived from an XML schema.
As xsd2crud.xsl is a (set of) xslt script(s) you can use it easily at any environment containing an appropriate XSL processor. So at least a current java runtime environment has to be installed (Java 5 includes the XSLTC transformer (based on Xalan 2.6.0 (+ controlled bug fixes))).
Install as follows:
1. copy downloaded directories and files into an arbitrary <installation directory>.
1. kopieren Sie die heruntergeladenen Verzeichnisse und Dateien ein beliebiges <Installationsverzeichnis>.
The process runs and ends without any message. After the programs terminates you should find a file called test1.xhtml in the output directory.
For further details concerning command-line start refer to :
either http://www.saxonica.com/documentation/using-xsl/commandline.html for using Saxon
or http://xml.apache.org/xalan-j/commandline.html for using Xalan
Running the transformation in this manner includes a well formed check but not a valid check. So make sure to use only valid schemata.
xsd2crud is designed to work as simple as possible. You can apply the script without any changes directly on your XML schema and get an result which can be used within further development steps. Though you have the possibility to refine the transformation by customization. For further details see the section 'Reference'.
XForms control/construct |
Transformation Mode |
Status |
Annotation |
---|---|---|---|
input/output controls |
|||
group |
automatic |
done |
|
repeat |
automatic |
done |
|
input |
automatic |
done |
|
textarea |
configure |
done |
|
secret |
configure |
done |
|
output |
configure |
done |
|
select1 |
automatic |
done |
|
select |
automatic/configure |
done |
|
upload |
./. |
not planned |
|
range |
./. |
not planned |
|
complex list |
? |
not yet decided |
|
generate control controls |
|||
trigger |
configure |
started |
|
submit |
configure |
started |
|
generate information attributes |
|||
label |
automatic/configure |
done |
|
alert |
automatic/configure |
done |
|
hint |
automatic/configure |
done |
|
help |
automatic/configure |
done |
|
generate control attributes |
|||
appearance |
automatic/configure |
majority done |
|
navindex |
configure |
planned |
|
selection=open |
configure |
planned |
Mainstream of Transformation
element with attribute 'maxOccurs' >1 becomes: repeat control
element with 'sequence' subelement becomes: group control
element with 'sequence' subelement and attribute 'maxOccurs' >1 becomes: group control with subelement repeat control
element with 'restriction' subelement becomes: select1 control.
Source
<xs:element name="cost2" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="cost2Account" default="1002"> <xs:simpleType> <xs:restriction base="xs:integer"> . . </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="cost2Amount" type="xs:decimal" default="1"> </xs:element> </xs:sequence> </xs:complexType> </xs:element>
Target
<xforms:group id="xsd2crud.cost2GroupUI" appearance="full"> . . <xforms:repeat id="xsd2crud.cost2RepeatUI" appearance="compact" bind="B01300"> <xforms:select1 id="xsd2crud.cost2AccountUI" xforms:bind="B01400" xforms:appearance="minimal"> . . <xforms:input id="cost2AmountUI" xforms:bind="B01500"> </xforms:input> </xforms:repeat> </xforms:group>
determine appropriate xforms ui control |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
---|---|---|---|---|---|---|---|---|---|
is an element |
n |
j |
j |
j |
j |
j |
j |
j |
j |
has a sequence as child or grandchild before another element as child or grandchild appears |
- |
n |
n |
n |
n |
n |
n |
j |
- |
minOccurs<1 |
- |
n |
n |
n |
n |
n |
? |
- |
|
maxOccurs>1 (incl. unbounded) |
- |
- |
- |
- |
- |
- |
? |
- |
j |
has a restriction as child or grandchild before another element as child or grandchild appears |
- |
n |
n |
n |
n |
j |
j |
- |
- |
annotation/appinfo/appearance=textarea |
- |
n |
j |
- |
- |
- |
- |
- |
- |
annotation/appinfo/appearance=secret |
- |
n |
- |
j |
- |
- |
- |
- |
- |
annotation/appinfo/appearance=output |
- |
n |
- |
- |
j |
- |
- |
- |
- |
|
|
|
|
|
|
|
|
|
|
generate group |
|
|
|
|
|
|
|
x |
|
generate repeat |
|
|
|
|
|
|
|
|
x |
generate input |
|
x |
|
|
|
|
|
|
|
|
|
|
x |
|
|
|
|
|
|
generate secret |
|
|
|
x |
|
|
|
|
|
generate output |
|
|
|
|
x |
|
|
|
|
generate select1 |
|
|
|
|
|
x |
|
|
|
generate select |
|
|
|
|
|
|
x |
|
|
generate repeat triggers |
|
|
|
|
|
|
|
x |
|
do nothing |
|
|
|
|
|
|
|
x |
|
|
|
|
|
|
|
|
|
|
|
done |
|
x |
x |
x |
x |
x |
|
x |
|
todo |
|
|
|
|
|
x |
x |
|
|
rules 5 and 6 needs some work
As xsd2crud.xml is a (set of) xslt script(s) you can use it easily at any environment with an appropriate xsl processor.
Run with antxsd2crud (scripts and documentation) is still under development. A At first you can try xsd2crud using the ant script transAddress.xml.