Solved

How do I create a java map from xsd

Posted on 2008-06-10
3
1,444 Views
Last Modified: 2013-11-18
Hi experts,

I am trying to use xsd to create java class. For example I have class A as followings:

----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xxx.com/AAA/entities"
    targetNamespace="http://www.xxx.com/AAA/entities" elementFormDefault="qualified">

    <xs:element name="classA">
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="namer" />
                <xs:element ref="value />
                <xs:element ref="myMap" type="xs:string" maxOccurs="unbounded" /> ---> line 00
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

---------------------------------------------------
 How do I modify line 00 so that I can have a hash map in my class? Thanks!


0
Comment
Question by:meow00
3 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 50 total points
ID: 21754997
Map is not supported. It it were, what would the keys and values be?
0
 
LVL 92

Accepted Solution

by:
objects earned 250 total points
ID: 21755708
0
 
LVL 1

Assisted Solution

by:pmartin8
pmartin8 earned 50 total points
ID: 21761112
If you are looking for a quick/easy way to do it.....

Use XStream to deserialize tthe XSD, then build your own map with the object you get from XStream!

I could provide some code if you want!
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question