Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do I create a java map from xsd

Posted on 2008-06-10
3
Medium Priority
?
1,477 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 150 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 750 total points
ID: 21755708
0
 
LVL 1

Assisted Solution

by:pmartin8
pmartin8 earned 150 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

886 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