Page 1 of 1

Pretty printing for DTDs

Posted: Mon Mar 17, 2014 2:34 pm
by Frank Ralf
I'd like to have the attribute declarations indentated and the tags preferably in a different color than the element declaration. Can I set this somewhere in the preferences?
...
<!ELEMENT p (#PCDATA | i | xref)*>
<!ATTLIST p class CDATA #IMPLIED>
...
TIA
Frank

Re: Pretty printing for DTDs

Posted: Mon Mar 17, 2014 3:27 pm
by adrian
Hi,

Please note that Oxygen does not provide a format and indent (pretty print) operation for DTDs. So there's nothing to configure in this regard.

If you want to change the color of the DTD tokens, go to Options > Preferences, Editor > Colors and expand the DTD node to reveal the configurable token colors.

Regards,
Adrian

Re: Pretty printing for DTDs

Posted: Mon Mar 17, 2014 4:40 pm
by Frank Ralf
Thanks for the quick reply, Adrian.

I've found out that the indentation can be easily achieved by a simple search & replace (regular expression:

Code: Select all


 Search:   \<!ATTLIST
Replace: \t<!ATTLIST
(Note:
The backslash in the search expression is required to escape the <. In the replace expression it's part of the tab \t.)

Cheers,
Frank

Re: Pretty printing for DTDs

Posted: Wed Mar 19, 2014 2:55 pm
by Frank Ralf
Hi Adrian,
adrian wrote: If you want to change the color of the DTD tokens, go to Options > Preferences, Editor > Colors and expand the DTD node to reveal the configurable token colors.
This setting seems to be missing in oXygen Author. I only have settings for XML, JavaScript, XQuery/XPath, PHP, CSS, and Text. Is this intentionally only available in the Editor and/or Developer version?

Kind regards,
Frank

Re: Pretty printing for DTDs

Posted: Wed Mar 19, 2014 3:24 pm
by adrian
Hi,

The Author doesn't have a specialized DTD editor (or for any other schema type) and no corresponding option either, so you're basically editing the DTD as plain text. As you've guessed, the specialized DTD editor is only available in the Developer and the Editor.

Regards,
Adrian

Re: Pretty printing for DTDs

Posted: Wed Mar 19, 2014 3:32 pm
by Frank Ralf
Thanks for the clarification, Adrian.

DTD syntax-highlighting for Notepad++

Posted: Fri Aug 29, 2014 2:38 pm
by Frank Ralf
For all users of Notepad++, I've created a User Defined Language file for DTD syntax-highlighting. It's available on GitHub: https://raw.githubusercontent.com/nakoh ... ng_DTD.xml

Just import the XML file via Language > Define your language... > Import....

Kind regards,
Frank