Alex
Alex

Reputation: 7511

Can I find an example of Java XML configuration without XSD schema or XPATH?

I need to create an XML configuration file as simple as possible. As I understand using jaxb requires creating a schema file. Using XPathAPI does not allow direct conversion XML to a Java bean – one needs to use XPATH. The same is with Apache commons Configuration.

Is it possible to avoid using schema or XPath, maybe with XMLEncoder?

Upvotes: 0

Views: 152

Answers (1)

Ian Roberts
Ian Roberts

Reputation: 122394

It sounds like you're looking for a tool like XStream, which can serialize and deserialize arbitrary object graphs into XML. It will often make a pretty good guess at what element names to use, but you can configure the mapping using annotations or by making method calls on the XStream object before marshalling/unmarshalling.

Upvotes: 1

Related Questions