Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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] Sat, 09 April 2011 02:25 Go to next message
No real name is currently offline No real nameFriend
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 17:05 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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


Ed Merks
Professional Support: https://www.macromodeling.com/
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: Fri Mar 29 10:26:12 GMT 2024

Powered by FUDForum. Page generated in 0.02389 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top