Pretty printing for DTDs

Are you missing a feature? Request its implementation here.
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Pretty printing for DTDs

Post 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
Frank Ralf
parson AG
www.parson-europe.com
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Pretty printing for DTDs

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Pretty printing for DTDs

Post 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
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Pretty printing for DTDs

Post 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
Frank Ralf
parson AG
www.parson-europe.com
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Pretty printing for DTDs

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Pretty printing for DTDs

Post by Frank Ralf »

Thanks for the clarification, Adrian.
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 457
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

DTD syntax-highlighting for Notepad++

Post 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
Frank Ralf
parson AG
www.parson-europe.com
Post Reply