This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes A question about XML/Java Type Mappings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "A question about XML/Java Type Mappings" Watch "A question about XML/Java Type Mappings" New topic
Author

A question about XML/Java Type Mappings

Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 61
Hi all,

Is there any xml-type which can be mapped to Map or something something similar in Java? Such as:

xs:xxx -> HashMap
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
XML Schema doesn't support Java Collections classes, so you'd need to roll your own.
Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 61
For example?
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
That depends on which library you use for the mapping. You mentioned XML Schema, and that doesn't support Collections. Any given XML/Java binding library may very well support Collections, just not using XML Schema.
 
Have you checked out Aspose?
 
subject: A question about XML/Java Type Mappings
 
jQuery in Action, 3rd edition