Approach

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'.

Features
Features

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

Transformation Rules

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

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>
						
Transformation Rules in Detail Transformation Rules in Detail

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

Usage

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 ant

xsd2crud (scripts and documentation) is still under development. A At first you can try xsd2crud using the ant script transAddress.xml.