Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Can we use list of user data structure as an element
Can we use list of user data structure as an element [message #664461] Fri, 08 April 2011 22:25 Go to next message
No real name is currently offline No real name
Messages: 1
Registered: April 2011
Junior Member
Embarrassed
Hi,

I am working with xml, xsd and jaxb for xml to java and java to xml conversion

I have xml of this format

<Configuration>
<SelectedDataList>
<Data id="name" seq="1"/>
<Data id="taxid" seq="2"/>
</SelectedDataList>
</Configuration>

From This i basically need a java object mapping

class Configuration{

protected List<Data> SelectedDataList;

}

class Data{
string id;
int seq;
}

I am new to xsd so having little trouble in designing xsd which will result in above java-xml translation.

Your help is appreciated.

Thanks
Anup
Re: Can we use list of user data structure as an element [message #664487 is a reply to message #664461] Sat, 09 April 2011 13:05 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25910
Registered: July 2009
Senior Member
Anup,

Most schema to Java mappers will produce an intermediate object to
represent SelectedDataList so I think you're out of luck.


anup.mayank@gmail.com wrote:
> :blush: Hi,
>
> I am working with xml, xsd and jaxb for xml to java and java to xml
> conversion
>
> I have xml of this format
>
> <Configuration>
> <SelectedDataList>
> <Data id="name" seq="1"/>
> <Data id="taxid" seq="2"/>
> </SelectedDataList>
> </Configuration>
>
> From This i basically need a java object mapping
>
> class Configuration{
>
> protected List<Data> SelectedDataList;
>
> }
>
> class Data{
> string id;
> int seq;
> }
>
> I am new to xsd so having little trouble in designing xsd which will
> result in above java-xml translation.
>
> Your help is appreciated.
>
> Thanks
> Anup
Previous Topic:Is it possible to manually specify schema to use for XML for wst xml editor?
Next Topic:view xml file with internal web browser
Goto Forum:
  


Current Time: Tue Jul 22 21:57:12 EDT 2014

Powered by FUDForum. Page generated in 0.02410 seconds