views:

26

answers:

1

I am working in a project where we create XSD schemas, and would like to generate sample xml instances for testing purposes. In eclipse, there is an XSD editor that has the option Generate > XML which does it by a click of a button. But I would like to convert this mouse click to a Builder, Maven or Ant task. Any ideas of how to do it?

A: 

You might have to write your own ant task and make use of a java library to convert a schema to xml. For example:

By the way, I don't see why you want to generate test xml files as part of your build process. Shouldn't test resources be kept static instead of being regenerated every time?

dogbane
Thanks - i am investigating the XML gen that you suggested - and can run it with an ant task. I was just wondering if it is possible to get a hook to the underlying generator in the Eclipse MDT XSD project.Why I want to regenerate the test ressources? Well the schemas keep changing - its a BIG project - and I want to have unit tests (based on xpath) that make sure they are still consistent, and live up to companys standards.Agata
Agata Przybyszewska