-1

I have a Java application. How can I generate a DTD from a Java class? I don't know how to do that.

Arnaud
  • 7,259
  • 10
  • 50
  • 71
Nina PRO
  • 91
  • 2
  • 13

1 Answers1

2

First of all you would not use DTDs any more.

I assume you are using a serialize framework like JAXB. As a part of the jaxb distribution is schemagen. With schemagen you can create xsd file for your classes.

Have a look at this:

https://jaxb.java.net/2.2.4/docs/schemagen.html

Marcinek
  • 2,144
  • 1
  • 19
  • 25
  • No, I don't use JAXB, my app without framework so how can I generate DTD from this? any idea plz? – Nina PRO Jan 12 '16 at 10:07
  • Use Jaxb, or its schemagen, to generate the schema files. You can how ever then generate dtd from xsd. – Marcinek Jan 12 '16 at 10:08