How do I create a java map from xsd

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="" xmlns=""
    targetNamespace="" elementFormDefault="qualified">

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

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

Who is Participating?
CEHJConnect With a Mentor Commented:
Map is not supported. It it were, what would the keys and values be?
pmartin8Connect With a Mentor Commented:
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!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.