开发者

Process XML data with Java

开发者 https://www.devze.com 2023-03-29 23:54 出处:网络
I am software written in Java which read an external XML file (let\'s call it \"datasource.xml\"). This file contains different information and this information are extracted using XPath queries.

I am software written in Java which read an external XML file (let's call it "datasource.xml"). This file contains different information and this information are extracted using XPath queries.

The fact is that, according to what kind of information is extracted from that file (datasource.xml) a different work flow is needed. At the moment workflows are "hard coded" in my Java classes but I want to make my software indipedent so that it can work with any datasource.xml, no matter of its structure. But of course I have to specify somewhere how t开发者_如何学JAVAo deal with the extracted data. I was thinking to use (again) JAXB and specify inside the XML file (and from its XSD I will create JAXB classes) the kind of workflow is needed.

Could it be a good solution??

Thanks


have you checked out Drools (a project from JBoss) very easy to learn & is an excellent workflow tool.

building your own workflow engine is quite complex & there are a lot of considerations to be taken into account.


You can think of using activiti, Another workflow solution. It has APIs available and can be used as a workflow service layer in your application.


Like others, I think you will be better off using a higher-level tool for this rather than hand-coding the logic in Java. Take a look at XProc (for example the Calabash implementation), or Orbeon, or Cocoon. They all have a learning curve associated with them, but once mastered, you will have a much more flexible architecture than with hard-coded Java logic.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号