Solved

How do I create a java map from xsd

Posted on 2008-06-10
3
1,448 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb example issues 3 47
Java: The Public Class Main 4 44
Problem to Alipay 10 67
project copy paste issue 1 61
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This video teaches viewers about errors in exception handling.
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…

679 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