writeDtdToFile can generate a DTD for the data specified in the model.

Comments are written to the DTD file inside the attribute declaration.
Is this really the right place? XML Spy reports an error. I am not sure,
if comments are allowed inside of the attribute declaration of a XML DTD. I didn't find an description where comments in a XML DTD are allowed. In a SGML DTD comments (starting with -- ) are allowed anywhere.

Is this a bug of DdlUtils or of XML Spy?

Example:
<!ELEMENT author EMPTY>
<!ATTLIST author
<!-- organisation: JDBC type: VARCHAR(50) -->
    author_id CDATA #REQUIRED


Perhaps the comments should stay before the attribute declaration like that:
<!ELEMENT author EMPTY>
<!-- organisation: JDBC type: VARCHAR(50) -->
<!ATTLIST author
    author_id CDATA #REQUIRED


The source file src/java/org/apache/ddlutils/io/DataDtdWriter.java is
responsible for that. I made a change to this file for my usage.

Achim

Reply via email to