in DTD generation. Now its again invalid.
There's a valid reason to do this?
The only reason that I can imaging is who you want to include your dtd definition inside XML document.
In my copy of your fantastic tool I have patched DTDGenerator with:
your perfectly right, the DTD doesn't work that way. I've submitted several patches regarding that issue to CVS, please check them. One known open bug is regarding tags that may hold other tags or character data. Do you know how to declare stuff like that in DTDs?
Best regards,
Christian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
<!ELEMENT paragraph (#PCDATA | B | I | U)*>
<!ATTLIST paragraph
align (center | left | right | justify) #IMPLIED
font CDATA #IMPLIED
indentation CDATA #IMPLIED
id CDATA #IMPLIED
>
PCDATA is what you want. There are other several improvement in your DTD. As example, if you want to use a default attribute:
<!ATTLIST paragraph
align (center | left | right | justify) "left"
>
If you want to use ONLY letters, digits and point [ . ] , hyphen [ - ], underline [ _ ] and colon [ : ] you can use NMTOKEN instead CDATA:
<!ATTLIST paragraph
font NMTOKEN #IMPLIED
leftMargin NMTOKEN "10"
>
or NMTOKENS if you want use white space too. I hope this help you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't understand why have add this line:
out.write("<!DOCTYPE document [\n");
:
:
out.write("]>\n");
in DTD generation. Now its again invalid.
There's a valid reason to do this?
The only reason that I can imaging is who you want to include your dtd definition inside XML document.
In my copy of your fantastic tool I have patched DTDGenerator with:
out.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
Gianni
Hi Gianni,
your perfectly right, the DTD doesn't work that way. I've submitted several patches regarding that issue to CVS, please check them. One known open bug is regarding tags that may hold other tags or character data. Do you know how to declare stuff like that in DTDs?
Best regards,
Christian
Its very simple. You can use #PCDATA. Example:
<!ELEMENT paragraph (#PCDATA | B | I | U)*>
<!ATTLIST paragraph
align (center | left | right | justify) #IMPLIED
font CDATA #IMPLIED
indentation CDATA #IMPLIED
id CDATA #IMPLIED
>
PCDATA is what you want. There are other several improvement in your DTD. As example, if you want to use a default attribute:
<!ATTLIST paragraph
align (center | left | right | justify) "left"
>
If you want to use ONLY letters, digits and point [ . ] , hyphen [ - ], underline [ _ ] and colon [ : ] you can use NMTOKEN instead CDATA:
<!ATTLIST paragraph
font NMTOKEN #IMPLIED
leftMargin NMTOKEN "10"
>
or NMTOKENS if you want use white space too. I hope this help you.