java - Dynamic xml into mongoDB -


i'am working on application (java), , can figured out best way solve issue. need store data in mongodb (with actual data type when supported bson format), data in xml file, , schema (both created dynamically @ runtime, have no idea what's in it).

to more specific, didn't have information on fields, names of data. user can create new "object" (for there no java class in application) dynamically. when user create new object, receive xml schema describe object. when user try add object of type (data in xml format new entity), validate xml schema , need store object in mogodb. need able transform xml in bson (or basic java object mongo java driver) , xml after query.

example:

if user want manage people, define people schema:

<people>    <name>...</name>    <lastname>...</lastname>    <age>...</age>    ... </people> 

here got xsd (a valid xsd format informations). when user add people data that:

<people>    <name>john</name>    <lastname>smith</lastname>    <age>32</age>    ... </people> 

so wonder if best approach jackson: xml -> pojo -> bson, or xslt xml -> json/bson (with encoding data types). or reading xml file , basic java objects manually.

did have advice on how implements 1 of solutions or better solutions?

best approach seem go xml <-> json see: quickest way convert xml json in java

then can go json <-> bson using com.mongodb.util.json parse , serialize.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -