XML : XML schema to Java pojos to json

I'm generating a Java class hierarchy from a complicated xml schema. The content stored in xml (returned via a REST endpoint) is verbose, plus consumers want only subsets of the xml content returned as json (that they define).

I know there are brute force ways to accomplish this, but does anyone know of a more elegant approach? Maybe some kind of mapping that the consumer could pass to the service that would allow them to dynamically select the content (via xpath in the mapping) and also produce custom json wrapping that content?

The consumers will have an understanding of the schema and content structure, but nothing about Java or its object hierarchy.

I know, a lot here. Any suggestions?

No comments:

Post a Comment