Package org.eclipse.lemminx.extensions.generators.xml2dtd

## Class XML2DTDGenerator

- java.lang.Object
- - org.eclipse.lemminx.extensions.generators.AbstractXML2GrammarGenerator<DTDGeneratorSettings>
  - - org.eclipse.lemminx.extensions.generators.xml2dtd.XML2DTDGenerator

All Implemented Interfaces:
  `IFileContentGenerator<Document,​DTDGeneratorSettings>`

    public class XML2DTDGenerator
    extends AbstractXML2GrammarGenerator<DTDGeneratorSettings>

File Generator implementation to generate DTD from a given XML source.

### Constructor Summary

Constructors
`XML2DTDGenerator()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `generate​(Grammar grammar, DTDGeneratorSettings settings, XMLBuilder dtd, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)` Generate the grammar content from the given grammar information into the given builder.
`protected String` `getFileExtension()` Returns the grammar file extension (ex : xsd, dtd) to generate.
`protected boolean` `isFlat()` Returns true if element declaration must be stored as flat mode and false otherwise.

### Methods inherited from class org.eclipse.lemminx.extensions.generators.AbstractXML2GrammarGenerator

`generate`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### XML2DTDGenerator

    public XML2DTDGenerator()

### Method Detail

#### generate

    protected void generate​(Grammar grammar,
                            DTDGeneratorSettings settings,
                            XMLBuilder dtd,
                            org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)

Description copied from class: `AbstractXML2GrammarGenerator`
Generate the grammar content from the given grammar information into the given builder.

Specified by:
  `generate` in class `AbstractXML2GrammarGenerator<DTDGeneratorSettings>`
Parameters:
  `grammar` - the grammar information.
  `settings` - the grammar settings
  `dtd` - the XML builder to update.

#### getFileExtension

    protected String getFileExtension()

Description copied from class: `AbstractXML2GrammarGenerator`
Returns the grammar file extension (ex : xsd, dtd) to generate.

Specified by:
  `getFileExtension` in class `AbstractXML2GrammarGenerator<DTDGeneratorSettings>`
Returns:
  the grammar file extension (ex : xsd, dtd) to generate.

#### isFlat

    protected boolean isFlat()

Description copied from class: `AbstractXML2GrammarGenerator`
Returns true if element declaration must be stored as flat mode and false otherwise.

- flat=true: helpful for DTD which declares
- flat=false: helpful for XSD which declares xs:element with hierarchy.

Overrides:
  `isFlat` in class `AbstractXML2GrammarGenerator<DTDGeneratorSettings>`
Returns:
  true if element declaration must be stored as flat mode and false otherwise.