the xml is generated from a closed product, i'm designing how the
output is going to be generated (and no , it won't be xsd), based on
that xml, i'm going to create an spring beans file, as well as classes
and interaces.
you see the closed tool is actually a java questionair generator which
can build html screens for online questionairs, but also can recive
data using xml. the end user can design the questionair, so i have to
adap with minmim change.
the fields are usually grouped in inside same subject elements, for
example you can have several fields called name, age, and weight, the
fact the these fields belong to an element called person, cannot be
change by the end user
however what can be changed is how these fields appear, validated and
displayed. such defintions, are located in something called source (not
source code)
so field called name would can have different defintions in two
seperate sources, when you start answering a questionair you select
which sources you want be used, based on that infomation the the
selected sources are in union thus creating a questionair.
so let's say you have
class Person {
private String name
public getName
public setName;
private int age
public getAge
public setAge;
private int weight
public getweight
public setweight;
}
but you selected that only name and age would be in a source. number 1
so you get
interface PersonSource1{
private String name
public getName
public setName;
private int age
public getAge
public setAge;
}
and have the person class implement that interface.
so if have like 20 sources, i'll have 20 interfaces generated for that
class
so xml i'm building is going to reflect that structure by saying (more
simplifed)
<Element Name="Person">
<Attribute Name="Name>
<Sources>
</Source Id="1"/>
</Source Id="2"/>
</Sources>
</Attribute
<Attribute Name="Age>
<Sources>
</Source Id="1"/>
</Sources>
</Attribute
</Element>
the relationship between these elemetns is fixed so i won't have to
regenerate it each time.