views:

261

answers:

1

How can I convert a DTD to a Schema as part of a Maven build?

Specifically, I am looking for a Maven plugin to which I can give the URL to a DTD and it will generate an XML Schema Definition file.

Failing a good Maven plugin, perhaps I can embed an ANT task into my Maven build

+1  A: 

I do not know any Maven plugin for automatically convert DTD to Schema. My advice to you is not to go there.

There are many differences between DTD and XSD, IMHO the most important ones are: * XSD has namespace definitions - You will not be able to gain much of that in an automatic manner. * XSD has a type system.

My advice is to do the conversion operation manually, so you will be able to define your namespace and think your type system. Both of them will long life after the operation is completed ;-)

Lior Bornshtain